⌘K
Noting Found

View all related articles

Scaffold Multiple Files in one command with laracommand package.

Open Source 1 min read

Table of Content

    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.

    Prerequisite

    You need to know the following:

    • Need to know PHP
    • Basics on Laravel & the artisan command Laravel
    • Basics on composer [Composer][https://getcomposer.org]

    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:

    1composer require coderflexx/laracommand --dev

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

    Usage

    Use the commands like using laravel make commands

    • make model command
    1php artisan laracommand:make-model FirstModel SecondModel

    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:

    1php artisan laracommand:make-model FirstModel SecondModel ThirdModel --controller

    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.

    Related Tags

    About the Author

    Oussama's Profile Picture
    Oussama
    Full Stack Web Developer | Technical Writer

    Oussama is an experienced full-stack web developer with a strong focus on Laravel. He's passionate about crafting web applications with Filament and the TALL Stack. With 8+ years of experience, and he's a dedicated open-source contributor.

    Comments

    Join our newsletter

    Subscribe to Our Newsletter and never miss our offers, latest news, Articles, etc.

    We care about the protection of your data. Read our Privacy Policy.