app/Http/Controllers/AnggotaController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function create()
    {
        if(Auth::user()->level == 'user') {
            Alert::info('Oopss..', 'Anda dilarang masuk ke area ini.');
            return redirect()->to('/');
        }
        $users = User::WhereNotExists(function($query) {
                        $query->select(DB::raw(1))
                        ->from('anggota')
                        ->whereRaw('anggota.user_id = users.id');
                     })->get();
        return view('Admin.Anggota.create', compact('users'));
    }
public function create ( ) { if ( Auth :: user ( ) -> level == 'user' ) { Alert :: info ( 'Oopss..' , 'Anda dilarang masuk ke area ini.' ) ; return redirect ( ) -> to ( '/' ) ; } $ users = User :: WhereNotExists ( function ( $ query ) { $ query -> select ( DB :: raw ( 1 ) ) -> from ( 'anggota' ) -> whereRaw ( 'anggota.user_id = users.id' ) ; } ) -> get ( ) ; return view ( 'Admin.Anggota.create' , compact ( 'users' ) ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .