I would like to format "regDate" to ‘dd/mm/YYYY’ from ‘YYYY/mm/dd’. Appreciate any help. Thanks.
if ($request->keyword != "") {
$students = Student::where
("name","LIKE","%" . $request->keyword . "%")
->orWhere("nric","LIKE","%" . $request->keyword . "%")
->orWhere("address","LIKE","%" . $request->keyword . "%")
->orWhere("telNo","LIKE","%" . $request->keyword . "%")
->orWhere("email","LIKE","%" . $request->keyword . "%")
->orWhere("regDate","LIKE","%" . $request->keyword . "%")
->get();
}
2
Answers
Please set your date format like below and check again.
date(‘d/m/Y’, strtotime($request->keyword));
Check value if date you can convert to your format and then you can send query