middleware('auth'); } public function index() { $project = Mashe::get(); return view('mashes')->with('mashes', $project); } public function store(Request $request){ // validation $this->validate($request,[ 'beer_id' => 'required', 'temperature' => 'required', 'duration' => 'required', 'stage' => 'required', 'boil' => 'required', ]); // create project $mashes = new Mashe; $lastID = Mashe::orderBy('id','desc')->value('id'); $mashes->id = number_format($lastID) + 1; $mashes->beer_id = $request->input('beer_id'); $mashes->temperature = $request->input('temperature'); $mashes->duration = $request->input('duration'); $mashes->stage = $request->input('stage'); $mashes->boil = $request->input('boil'); $mashes->save(); return redirect('/mashes')->with('success', 'Mash Step Added'); } // }