jeudi 29 août 2019

Planning on Laravel?

I have a table named "Motorbike" with as fields (matriculation', 'number_motorbike', 'status').

I have another table named "Revision" with as fields ('date_revision_start', 'date_revision_end', 'garage', 'fk_motorbike').

The goal is that if the motorbike is under revision, it must be unavailable (automatically)...

it works almost ! So, the modificaiton of the status for the motorbike changes automatically only for the date "today"

enter image description here

enter image description here

But, for the date from 02/08/2019 to 06/08/2019 I have a problem. When, we will be, on 02/08/2019 or 06/08/2019 the status of the motorbike is always available... Normally, it must be unavailable.

Can you help me solve this problem?

$motorbikes = Motorbike::oldest()->paginate(5);
$revisionId = Revision::where('date_revision_start', "<=" , Carbon::now())->where('date_revision_end', ">=", Carbon::now())->pluck('fk_motorbike')->toArray();

Thank you for your help.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire