middleware(function ($request, $next) { $this->user = Auth::guard('web')->user(); return $next($request); }); } /** * Display a listing of the LoanTypes. * * @param \Modules\Writeoff\DataTables\LoanTypeDataTable $dataTable * * @return mixed */ public function index(LoanTypeDataTable $dataTable, Request $request) { if (is_null($this->user) || !$this->user->can('master.read')) { abort(403, 'Sorry !! You are Unauthorized to view any master data !'); } return $dataTable->render('writeoff::parameter.loan_types.index'); } }