example-app/app/Http/Controllers/Backsite/SpecialistController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        abort_if(Gate::denies('specialist_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');
        $specialist = Specialist::orderBy('created_at', 'desc')->get();
        return view('pages.backsite.master-data.specialist.index', compact('specialist'));
    }
public function index ( ) { abort_if ( Gate :: denies ( 'specialist_access' ) , Response :: HTTP_FORBIDDEN , '403 Forbidden' ) ; $ specialist = Specialist :: orderBy ( 'created_at' , 'desc' ) -> get ( ) ; return view ( 'pages.backsite.master-data.specialist.index' , compact ( 'specialist' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .
// Pasang gate untuk menolak akses ketika tidak punya permissions