I am writing a sql query to fetch all the data for current year but condition is i want to get status - Pending data first and Approved and Rejected data. I am new to laravel. According to 'status' = Pending/Approve and Reject?
Can anyone help me out yr. Thanks in advanced.
$leaves = Leave::whereRaw('YEAR(start_date) = YEAR(CURDATE()) AND YEAR(end_date)=YEAR(CURDATE())')
->where('created_by', '=', \Auth::user()->creatorId())->get();
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire