Open sraiyani opened 4 years ago
if i am adding middleware route function is not working
Route::group(['middleware' => ['prevent-back-history','auth']],function(){ Route::get('/role', ['middleware' => ['permission:role.view'],'uses'=>'Admin\RoleController@index']); Route::get('/role/create', ['middleware' => ['permission:role.create'],'uses'=>'Admin\RoleController@create']); Route::post('/role/store', ['middleware' => ['permission:role.create'],'uses'=>'Admin\RoleController@store']); Route::get('/role/edit/{id}', ['middleware' => ['permission:role.edit'],'uses'=>'admin\RoleController@edit', 'as'=>'role-edit']); Route::put('/role/edit/{id}', ['middleware' => ['permission:role.edit'],'uses'=>'admin\RoleController@update', 'as'=>'role-update']); });
controller code
class RoleController extends Controller { public function __construct() { $this->middleware('auth'); }
public function index() { $page_name = "Role"; //$data = Permission::all(); $data = Role::paginate(15); return view('admin.role.list',compact('data','page_name')); }
} getting this error whar is the issue Please suggest me
if i am adding middleware route function is not working
Route::group(['middleware' => ['prevent-back-history','auth']],function(){ Route::get('/role', ['middleware' => ['permission:role.view'],'uses'=>'Admin\RoleController@index']); Route::get('/role/create', ['middleware' => ['permission:role.create'],'uses'=>'Admin\RoleController@create']); Route::post('/role/store', ['middleware' => ['permission:role.create'],'uses'=>'Admin\RoleController@store']); Route::get('/role/edit/{id}', ['middleware' => ['permission:role.edit'],'uses'=>'admin\RoleController@edit', 'as'=>'role-edit']); Route::put('/role/edit/{id}', ['middleware' => ['permission:role.edit'],'uses'=>'admin\RoleController@update', 'as'=>'role-update']); });
controller code
class RoleController extends Controller { public function __construct() { $this->middleware('auth'); }
} getting this error whar is the issue Please suggest me![Untitled](https://user-images.githubusercontent.com/48437111/72894304-012b3980-3d41-11ea-8d53-992856c39d64.png)