limewell / laravel-make-extender
This package helps to generate and autoload custom helpers, It can generate multilevel helpers in the context of the directory.
Installs: 4 684
Dependents: 0
Suggesters: 0
Security: 0
Stars: 35
Watchers: 2
Forks: 3
Open Issues: 0
Requires
- php: >=7.1.3
- illuminate/support: ^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- phpunit/phpunit: ^9.0|^10.5
README
Generate below stub
- Generate and autoload custom helpers, It can generate multilevel helpers in the context of the directory.
- Generate Service class for process chunk of codes
- Generate Trait for process chunk of codes
- Generate Global Scope class for Model
- Generate Custom Casts
- Generate Collections Macros
- Generate View Composers
This package helps to generate and autoload custom helpers, It can generate multilevel helpers in the context of the directory.
Installation
You can install the package via composer:
composer require limewell/laravel-make-extender
Generate Helper file
Generate UserHelper.php under App/Helpers directory
php artisan make:helper UserHelper
Generate Module/UserHelper.php under App/Helpers/Module directory
php artisan make:helper Module/UserHelper
Generate Service
Generate UserService.php under App/Services directory
php artisan make:service UserService
(new UserService())->handle();
Generate invokable UserService.php under App/Services directory
php artisan make:service UserService --invokable
(new UserService())();
Generate Trait
Generate UserTrait.php under App/Traits directory
php artisan make:trait UserTrait
Generate bootable UserTrait.php under App/Traits directory
php artisan make:trait UserTrait --bootable
Generate Scope
Generate UserScope.php under App/Scopes directory
php artisan make:scope UserScope
see document here for how to use global scopes
Generate Custom Casts
Generate JsonCast.php under App/Casts directory
php artisan make:cast JsonCast
see document here for how to use Custom Casts
Generate Collections Macro
Generate toUpper.php under App/Macros directory
php artisan make:macro toUpper
see document here for how to use Macro
Generate View composers
Generate config file for register view composers
php artisan vendor:publish --provider="Limewell\LaravelMakeExtender\LaravelMakeExtenderServiceProvider" --tag="config"
Generate view composers class
php artisan make:composer MovieComposer
Register view composers Edit config (config/viewcomposers.php)
use App\ViewComposers\MovieComposer; return [ MovieComposer::class => [ 'view1','view2' ], ];
see document here for how to use View Composers
Customize Stubs
php artisan vendor:publish --provider="Limewell\LaravelMakeExtender\LaravelMakeExtenderServiceProvider" --tag="stubs"
This will export stubs into /stubs/vendor/laravel-make-extender for customization
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.