Download the PHP package intellow/make-route-for-laravel without Composer
On this page you can find all versions of the php package intellow/make-route-for-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download intellow/make-route-for-laravel
More information about intellow/make-route-for-laravel
Files in intellow/make-route-for-laravel
Package make-route-for-laravel
Short Description Adds a php artisan make:route command. This scaffolds the route in web.php, controller, and even generates a unit test
License MIT
Homepage https://github.com/intellow/make-route-for-laravel
Informations about the package make-route-for-laravel
Make Route For Laravel
This is an opinionated package that creates boilerplate in your routes and controller files.
Installation
You can install the package via composer:
Usage
In your command line, you can now use a single artisan command to create the following:
- Entry in your routes file (web.php)
- Controller created if one does not exist
- Your specified method added to the bottom of the controller
- Model is created if one doesn't already exist (optional)
- Migration for the model is created if one doesn't already exist (optional)
- An empty view is created
- For index and create actions, a basic unit test is created
- More to come in future releases
Model Routes
If you are creating a route associated with a model, this is a great way to scaffold everything you need for that route.
So if you run the following command
You will get the following:
web.php
Http\Controllers\PizzaPieController.php
- This file will be created if it doesn't exist already
- The method will be added to the bottom of the controller
resources\views\models\pizza_pie\index.blade.php
- Create this directory if it doesn't exist already
- Add a blank file with the following comment
tests/Feature/AutomatedRouteTests.php
- This is only done on index and create actions
- Create this file if it doesn't already exist
- A basic feature test to hit this route (GET only) and assert a successful response
Create Model and Migration
- If you have not yet created the model, you will be given the option to create it. If you choose to create the model, you can also choose to create the migration as well.
- This package will run
php artisan make:model PizzaPie
orphp artisan make:model PizzaPie -m
based on your choices
Non-Model Routes
If you are creating a route that is not associated with a model, the package works a bit differently.
So if you run the following command
You will get the following:
web.php
Http\Controllers\SendActivationEmailController.php
- This file will be created if it doesn't exist already
- The method will be added to the bottom of the controller
No view is created because this is a store action, and no test is created either since it is not an index or create action.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Kevin McKee
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.