cleaniquecoders / laravel-action
Simple Actionable for Laravel
1.5.0
2024-03-21 03:58 UTC
Requires
- php: ^8.1 | ^8.2 | ^8.3
- cleaniquecoders/laravel-contract: ^1.0
- illuminate/contracts: ^9.0 | ^10.0 | ^11.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.0
- orchestra/testbench: ^8.0 | ^9.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5 | ^10.0
This package is auto-updated.
Last update: 2024-04-29 03:25:36 UTC
README
Simple Actionable for Laravel.
Installation
You can install the package via composer:
composer require cleaniquecoders/laravel-action
You can publish the config file with:
php artisan vendor:publish --tag="laravel-action-config"
Optionally, you can publish the views using
Usage
php artisan make:action User\\CreateOrUpdateUser --model=User
This will create an action in app\Actions\User
:
<?php namespace App\Actions\User; use App\Models\User; use CleaniqueCoders\LaravelAction\AbstractAction as Action; class CreateOrUpdateUser extends Action { public $model = User::class; public function rules(): array { return []; } }
Then you can use it like:
use App\Actions\User\CreateOrUpdateUser; $user = (new CreateOrUpdateUser(['name' => 'Nasrul Hazim', 'email' => 'nasrul@work.com'])); // do more with \App\Models\User object // $user->assignRole(...)
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.