app/Http/Controllers/ProjectController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(ProjectRequest $request)
    {
        if (auth()->user()->isAdmin()){
            project::create($request->all());
            return redirect('project')->with(['success'=>'Done Create Project']);
        }
        return redirect('project');
    }
public function store ( ProjectRequest $ request ) { if ( auth ( ) -> user ( ) -> isAdmin ( ) ) { project :: create ( $ request -> all ( ) ) ; return redirect ( 'project' ) -> with ( [ 'success' => 'Done Create Project' ] ) ; } return redirect ( 'project' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .