Skip to content

Route

You can generate a route by running the following command.

bash
php artisan better:route blog v1 --api

INFO

Generated route will be at routes/api/v1/blog.php

Arguments

  • route — name of the generated route file
  • versionOrDirectory (optional) — version or subdirectory where the route file will be generated

Options

Calling a Controller Action

php
Route::group(['prefix' => '/v1/blogs'], function () {
    Route::post('/', [BlogController::class, 'store']);
});