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

Laravel Select where status equals

I have 2 models Patient model with id, name, address Appointment model with id, patient_id, appointment_date, status Patient model has many Appointments. I want to list Patients where patient's previous Appointment status='closed' only. Beacause I dont want to add new…

VIEW QUESTION

Can’t get Laravel pagination working?

I am trying to access product data from api controller and display in blade page. I am getting the data but my pagination not directing to proper page and not working properly. my ProductApiController <?php namespace AppHttpControllersApi; use AppHttpControllersController; use…

VIEW QUESTION

Why doesn’t session flash work in Laravel 8?

I'm using Laravel 8 for my project and for updating a form and there fore in the Controller, I added this for showing success message: Session::flash('success','asdasd'); But this does not show any data in the blade: @if(Session::has('success')) <div class="alert alert-success"…

VIEW QUESTION
Back To Top
Search