lozemc/laravel-actions

Simple command to create actions in Laravel

11.0 2024-04-21 09:09 UTC

This package is auto-updated.

Last update: 2024-08-21 18:11:03 UTC


README

Installation

To get started with Laravel Action Command, simply require the package via Composer:

composer require lozemc/laravel-actions



Installation for Laravel 10.x

Next, add the following line to the $commands array in your /app/Console/Kernel.php file:

protected $commands = [
    
    // ...

    \App\Console\Commands\ActionMakeCommand::class,
];

If the protected $commands array does not exist, you will need to add it.


Installation for Laravel 11.x

Then add the following line to the returned array in /bootstrap/providers.php:

return [

    // ...

    \Lozemc\Actions\Providers\MakeActionProvider::class,
];

Usage

Once installed and configured, you can use the artisan command to create a new action:

php artisan make:action UpdatePostAction

This will generate a new action class named UpdatePostAction in the App\Actions namespace. You can then implement your business logic within this action class.

Other