middleware('auth'); } public function index() { $project = Leann::where('user_id', auth()->user()->id)->get(); return view('home')->with('projects', $project); } public function store(Request $request){ // validation $this->validate($request,[ 'project_name' => 'required', 'description' => 'required' ]); // create project $project = new Leann; $project->name = $request->input('project_name'); $project->description = $request->input('description'); $project->user_id = auth()->user()->id; $project->save(); return redirect('/home')->with('success', 'Project Added'); } }