middleware('auth'); } public function index() { $project = Adjunctaddition::get(); return view('adjunctadditions')->with('adjunctadditions', $project); } public function store(Request $request){ // validation $this->validate($request,[ 'beer_id' => 'required', 'adjunct_id' => 'required', 'amount' => 'required', 'timing' => 'required', ]); // create project $adjunct = new Adjunctaddition; $lastID = Adjunctaddition::orderBy('id','desc')->value('id'); $adjunct->id = number_format($lastID) + 1; $adjunct->beer_id = $request->input('beer_id'); $adjunct->adjunct_id = $request->input('adjunct_id'); $adjunct->amount = $request->input('amount'); $adjunct->timing = $request->input('timing'); $adjunct->alternative = $request->input('alternative'); $adjunct->notes = $request->input('notes'); $adjunct->save(); return redirect('/adjunctadditions')->with('success', 'Adjunct Addition Added'); } }