Download the PHP package sethios/laravel-tools without Composer
On this page you can find all versions of the php package sethios/laravel-tools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sethios/laravel-tools
More information about sethios/laravel-tools
Files in sethios/laravel-tools
Package laravel-tools
Short Description Several tools for Laravel development
License MIT
Informations about the package laravel-tools
Laravel Tools
A set of tools for generating basic Laravel scaffolding (including Model, Controller, View, Seeders, Migrations...).
It also includes a tool for database reseeding via Factories and/or CSV file.
Installation:
Require the package with composer:
composer require --dev sethios/laravel-tools
After installation run this command for the DB reseed function to work:
php artisan vendor:publish --tag=config
The generated config file includes basic User model configuration. You can add any other model.
Database reseed
Reseed a table (or tables) with php artisan by running:
php artisan db:reseed user
Parameters
- "reset" -> (optional) name of migration file, used if you wish to re-migrate
- "tables" -> array of database table names you wish to reset when running a db:reseed
- "class" -> name od model seeder class ex. UserSeeder
Create MVC
Generate scaffolding for a model by running:
php artisan create:mvc user
The default command will generate the following files:app/Models/User.php
It will also try and modify these files by searching for the commented line "Create mvc" used as a placeholder: [^1]
Options
There are several flags that can be used that reduce the amount of files generated i.e. specify which files you want to generate:
To Do
- Remove the need for commented placeholders in files that need to be modified [^1]
- Include a JSON and/or config file to pre-setup a models generation i.e. pre-define models attributes / database columns. Make it so it also generates the code for Seeders and Factories
- Automated model relations via pre-defined attributes configuration