Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lozemc/laravel-actions

Simple command to create Actions class in Laravel
https://github.com/lozemc/laravel-actions

action actions command commands laravel

Last synced: 27 days ago
JSON representation

Simple command to create Actions class in Laravel

Awesome Lists containing this project

README

        

# Laravel Action Command

## Installation

To get started with Laravel Action Command, simply require the package
via [Composer](https://packagist.org/packages/lozemc/laravel-actions):

```bash
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:

```php
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`:
```php
return [

// ...

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

## Usage

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

```bash
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
- [Laravel Service Command](https://github.com/lozemc/laravel-services)