DEV Community

Oussama
Oussama

Posted on • Originally published at coderflex.com on

Scaffold Multiple Files in one command with laracommand package.

Introduction

There are many CLI tools nowadays built for Laravel, and this is one of those.

laracommand is a CLI tool to save you time, and gives you the power to scaffold all of your models, controllers, commands in one go.

laracommand Logo

laracommand Example

Prerequisite

You need to know the following:

Why this package?

At the beginning of any project, we need to create many files (models, controllers, views, factories...) Thanks to Laravel artisan commands, to make this happens without any efforts counts but, imagine you want to create 10 models, you need to run the command php artisan make:model 10 times right?
With this tool, no need for that! All what you need to do is run the command and name as many as models you want, and it will create them all for you.

Installation

You can install the package via composer:

composer require coderflexx/laracommand --dev
Enter fullscreen mode Exit fullscreen mode

The --dev option is to install it in development purposes.

Usage

Use the commands like using laravel make commands

  • make model command
php artisan laracommand:make-model FirstModel SecondModel
Enter fullscreen mode Exit fullscreen mode

You can generate as many as you want of models, and you can add options like make:model command

Check out the docs for more, just replace make:model with laracommand:make-model

If you want to create the model and controller for example, you need to do the following:

php artisan laracommand:make-model FirstModel SecondModel ThirdModel --controller
Enter fullscreen mode Exit fullscreen mode

if pass the flag -c instead of --controller

Note

This package is for development use only, you are free to disable/remove it once you are done with.

Changelog

You can follow the changes on this package by accessing the changelog or the releases

Contributing

If you want to contribute, feel free to read the CONTRIBUTING guidelines, and make your PR

Conclusion

Today we s learned about Laracommand package, and how to use it. To make our development process easier and save us time.

Top comments (0)