dimanche 2 octobre 2016

add control to resource routes

My resource route looks like :

$router->resource('subnets', 'subnetController');

I saw on the documentation that a resource route can have an array of parameters... is there a parameter that permits you to choose who can access to those routes ? If I was using basic routing that would be something like :

Route::get('/subnets', function () {
   if (Auth::user()['attributes']['role'] == 'admin') return view('subnets.index');
   else return view ('errors.403');
});



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire