Skip to content

Middleware & Macros

Auth middleware

Assign auth:carro to protect routes:

php
Route::middleware(['auth:carro'])
    ->group(function () {
        // ...
    });

Route::get('/', [HomeController::class, 'index'])->middleware('auth:carro');

Route macros

Use role and permission methods on routes.

Role

php
Route::post('/draft', 'draft')->role('role-name');

Permission

php
Route::post('/draft', 'draft')->permission('submission:create');

The MIT License (MIT). Please see License File in the repository for more information.