This package introduces set of multi-purpose helper classes that provides a new way of organising the logic of your Laravel applications.
You can install the package via composer:
$ composer require rjchauhan/laravel-finer
Keep your Laravel applications DRY with single action classes.
use Rjchauhan\LaravelFiner\Action\Action;
class DeactivateUser extends Action
{
protected function canBePerformed()
{
return $this->model->is_active;
}
protected function perform()
{
$this->model->is_active = false;
$this->model->save();
}
}
class UserActivationController extends Controller
{
public function deactivate(User $user)
{
$user = (new DeactivateUser($user))->execute();
return UserResource::make($user);
}
}
Please see the changelog for more information on what has changed recently.
$ composer test
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email Raviraj Chauhan instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.