Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Jayanthkumar's avatar

How to pass date to DB

this is code in the form

                              <label>Fallow Up</label>
                                  <input name="fallow_up_date" class="form-control" id="fallowupdate" placeholder="MM/DD/YYYY" type="date"/>
                            </div> ```

this is the code in the controller

```$enquiry = new Enquiry;
        $enquiry->customertype = $request->costumer_type;
        $enquiry->enquiry_for = $request->seldevice;
        $enquiry->language = $request->language;
        $enquiry->enquired_through = $request->enquired_through;
        $enquiry->enquiry_for = $request->seldevice;
        $enquiry->result = '1'; 
    //below is the code for updating date in DB
     $enquiry->fallow_up_date = $request->fallow_up_date;
        $enquiry->quantity = $request->quantity;
        $enquiry->comments = $request->comments;```
0 likes
3 replies
Jayanthkumar's avatar

$enquiry->save(); is present

i did not mentioned above,,,its taking all value except Date

christopher's avatar

Whats your DB Type for the fallow_up_date column? Did you put it to your fillable array in your Model? If you dd() your request, do yo get the value?

Please or to participate in this conversation.