Adds a php artisan make:route command. This scaffolds the route in web.php, controller, and even generates a unit test
intellow/make-route-for-laravel is a Laravel package for adds a php artisan make:route command. this scaffolds the route in web.php, controller, and even generates a unit test.
It currently has 2 GitHub stars and 232 downloads on Packagist (latest version 0.2).
Install it with composer require intellow/make-route-for-laravel.
Discover more Laravel packages by intellow
or browse all Laravel packages to compare alternatives.
Last updated
This is an opinionated package that creates boilerplate in your routes and controller files.
You can install the package via composer:
composer require intellow/make-route-for-laravel
In your command line, you can now use a single artisan command to create the following:
If you are creating a route associated with a model, this is a great way to scaffold everything you need for that route.
php artisan make:model-route Model resourcefulAction
So if you run the following command
php artisan make:model-route PizzaPie index
You will get the following:
Route::get('/pizza-pies/', [\App\Http\Controllers\PizzaPieController::class, 'index']);
public function index()
{
return view('models.pizza_pie.index');
}
{{--Create Something Amazing--}}
public function testPizzaPieIndex()
{
$response = $this->get('pizza-pies');
$response->assertStatus(200);
}
php artisan make:model PizzaPie or php artisan make:model PizzaPie -m based on your choices
If you are creating a route that is not associated with a model, the package works a bit differently.
php artisan make:route <slug> <resourceful-action> [<controller-name>]
So if you run the following command
php artisan make:route /send-activation-email store
You will get the following:
Route::post('/send-activation-email/', [\App\Http\Controllers\SendActivationEmailController::class, 'store']);
public function store(Request $request)
{
}
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.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.