Laravel Extended Commands

Laravel Extended Commands stats

Downloads
11
Stars
34
Open Issues
1
Forks
2

View on GitHub →

This package will have some commands which are not available in laravel.

This package has some commands which are not available in laravel.

Installation

You can install the package via composer:

composer require mrpunyapal/laravel-extended-commands

You can publish the config file with:

php artisan vendor:publish --tag="laravel-extended-commands-config"

This is the contents of the published config file:

return [
// Nothing to configure yet.
];

Usage

Make Builder

php artisan make:builder {name}

Make Builder with Model

php artisan make:builder {name} --model={model}

Make Collection

Create a new Eloquent custom collection class. By default the class is generated into the App\Models\Collections namespace and extends Illuminate\Database\Eloquent\Collection.

php artisan make:collection {name}

Create a collection with a model generic PHPDoc (adds @template and @extends in the generated class):

php artisan make:collection {name} --model={model}

When generating a model you can also scaffold a collection for it and inject a newCollection() method into the model using the --collection flag:

php artisan make:model {name} --collection

This will generate App\Models\Collections\{Name}Collection and add a newCollection(array $models = []) method to the model which returns the new collection instance.

Make Model with Builder

php artisan make:model {name} --builder

Make Action

Create a new action class. By default the class is generated into the App\Actions namespace and contains a handle() method.

php artisan make:action {name}

Create an invokable action (generates an __invoke method):

php artisan make:action {name} --invokable

Force overwrite an existing action file:

php artisan make:action {name} --force

Make Concern

Create a new concern (trait). By default the trait is generated into the App\\Concerns namespace.

php artisan make:concern {name}

Force overwrite an existing concern file:

php artisan make:concern {name} --force

Make Contract

Create a new contract (interface). By default the interface is generated into the App\\Contracts namespace.

php artisan make:contract {name}

Force overwrite an existing contract file:

php artisan make:contract {name} --force

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.

MrPunyapal photo

Full Stack Developer and Laravel Artisan. Building robust, scalable, and user-friendly web solutions. Passionate about code, design and all things tech.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Mrpunyapal Laravel Extended Commands Related Articles

Laravel Extended Commands image

Laravel Extended Commands

Read article
Tighten logo

Tighten

We help companies turn great ideas into amazing apps, products, and services.

Tighten
Celebian logo

Celebian

Celebian is a social media marketing agency specializing in helping their clients go viral on TikTok. Whether you're looking to reach a bigger audience or gain more Tiktok followers, likes, and views, they've got you covered.

Celebian
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Blastup logo

Blastup

Blastup provides social media enhancement services including buying Instagram likes, followers, and views, with features like instant delivery and a variety of packages to suit different needs.

Blastup
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec