Scaffold Multiple Files in one command with laracommand package.
Tags: opensource, laravel, packages
Published: 2022-02-15 00:21:29

---
title: Scaffold Multiple Files in one command with laracommand package.
published: true
date: 2022-02-08 09:06:42 UTC
tags: OpenSource, laravel, packages
canonical_url: https://coderflex.com/blog/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.


<p align="center">
    <img src="https://raw.githubusercontent.com/coderflexx/laracommand/main/docs/images/logo.png" alt="laracommand Logo" width="300">
    <br><br>
    <img src="https://raw.githubusercontent.com/coderflexx/laracommand/main/docs/images/example.png" alt="laracommand Example" height="500">
</p>

# Prerequisite
You need to know the following:
- Need to know [PHP](https://php.net)
- Basics on Laravel & the artisan command [Laravel](https://laravel.com)
- 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:

```bash
composer 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
  
```bash
php 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](https://laravel.com/docs/8.x/eloquent#generating-model-classes) 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:

```bash
php 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](https://github.com/coderflexx/laracommand) by accessing the [changelog](https://github.com/coderflexx/laracommand/blob/main/CHANGELOG.md) or the [releases](https://github.com/coderflexx/laracommand/releases)

# Contributing
If you want to contribute, feel free to read the [CONTRIBUTING](https://github.com/coderflexx/laracommand/blob/main/.github/CONTRIBUTING.md) guidelines, and make your `PR`

# Conclusion
Today we s learned about [Laracommand](https://github.com/coderflexx/laracommand) package, and how to use it. To make our development process easier and save us time.