ajaykushwaha25/custom-make-command
Laravel dev package adding custom Artisan generators: make:trait plus custom:class, custom:action, and custom:service to scaffold files under App (and subfolders). Also includes a UsesUUID trait to add UUID IDs to Eloquent models.
This package allows you to create custom make commands for your Laravel application, such as make:trait and more.
To install this package, require it using Composer. It is recommended to only require the package for development purposes.
composer require ajaykushwaha25/custom-make-command
Since Laravel uses Package Auto-Discovery, you don't need to manually add the ServiceProvider.
If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
AjayKushwaha25\CustomMakeCommand\MakeCommandServiceProvider::class,
The following commands are available after installing this package:
php artisan make:trait CustomTrait
php artisan custom:class CustomClass
php artisan custom:action ActionClass
php artisan custom:service ServiceClass
The make:trait command will create a trait file in the App\Traits folder.
The custom:class command will create a custom class file in the App folder. You can also specify a specific folder in which the class file should be generated. Note: The specified folder will be created inside the App folder.
The UsesUUID trait allows you to easily add UUID (Universally Unique Identifier) functionality to your Laravel model classes.
To use the UsesUUID trait in your model class, follow these steps:
use AjayKushwaha25\CustomMakeCommand\Traits\UsesUUID;
class MyModel extends Model
{
use UsesUUID;
// ...
}
That's it! Your model class now has the UUID functionality provided by the UsesUUID trait.
How can I help you explore Laravel packages today?