app/Http/Controllers/UsersController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\View\View
     */
Show the form for creating a new resource.
@return \Illuminate\View\View
Show the form for creating a new resource . @return \ Illuminate \ View \ View
public function create()
    {
        if(Auth::user()->hasRole('admin')){
            $roles = Role::get();
            return view('users.create', ['roles' => $roles]);
        } else {
            return redirect()->route('login');
        }
    }
public function create ( ) { if ( Auth :: user ( ) -> hasRole ( 'admin' ) ) { $ roles = Role :: get ( ) ; return view ( 'users.create' , [ 'roles' => $ roles ] ) ; } else { return redirect ( ) -> route ( 'login' ) ; } }
Show the form for creating a new resource.
Show the form for creating a new resource .