ajaykushwaha25 / custom-make-command
A custom Artisan command for creating trait files.
Installs: 294
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:laravel-package
README
This package allows you to create custom make commands for your Laravel application, such as make:trait
and more.
Installation
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.
Laravel without auto-discovery:
If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
AjayKushwaha25\CustomMakeCommand\MakeCommandServiceProvider::class,
Commands available
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.
UsesUUID Trait
The UsesUUID
trait allows you to easily add UUID (Universally Unique Identifier) functionality to your Laravel model classes.
Usage
To use the UsesUUID trait in your model class, follow these steps:
- Import the trait at the top of your model class file:
use AjayKushwaha25\CustomMakeCommand\Traits\UsesUUID;
- Apply the trait to your model class:
class MyModel extends Model { use UsesUUID; // ... }
That's it! Your model class now has the UUID functionality provided by the UsesUUID
trait.