skip to Main Content

Date validation with another fields in controller in Laravel

Here is my validation code in the controller $eldate = Carbon::now()->addDay(4)->format('Y-m-d'); $validatedData = $this->validate($request, [ 'ldate' => 'required|date|unique:leaves,ldate,NULL,employee,employee,'.auth()->id(), 'ldate2' => 'nullable|date|after_or_equal:ldate', 'type' => 'required' ]); In this validation code I have to add one more condition for date1 If type…

VIEW QUESTION

Can’t Laravel 10 update data?

i can't update table data in laravel 10 with controller resource my code: // controller public function update(Request $request, string $id):RedirectResponse { // $input = $request->validate([ 'id'=>'required', 'name'=>'required', 'description'=>'required', ]); $accounting_group = AccountingGroup::findOrFail($id); $accounting_group->update($input); return redirect()->route('accounting_group.index')->with(['success' => 'Data telah disimpan']);…

VIEW QUESTION
Back To Top
Search