app/Http/Controllers/Pegawai/PegawaiController.php
/**
     * Show the application dashboard.
     *
     * @return \Illuminate\Contracts\Support\Renderable
     */
Show the application dashboard.
@return \Illuminate\Contracts\Support\Renderable
Show the application dashboard . @return \ Illuminate \ Contracts \ Support \ Renderable
public function index(Request $req)
    {
        $data['pegawai'] = User::where('role', 'pegawai')->get();
        if ($req->is_api) {
            return response()->json($data, 200);
        } else {
            $data['page_title'] = 'Pegawai';
            return view('dashboard')->with($data);
        }
    }
public function index ( Request $ req ) { $ data [ 'pegawai' ] = User :: where ( 'role' , 'pegawai' ) -> get ( ) ; if ( $ req -> is_api ) { return response ( ) -> json ( $ data , 200 ) ; } else { $ data [ 'page_title' ] = 'Pegawai' ; return view ( 'dashboard' ) -> with ( $ data ) ; } }
Show the application dashboard.
Show the application dashboard .