Sitemap

Member-only story

Automatic status on 2 models

2 min readJun 17, 2024

--

I am stuck since 2 days on a problem that I haven’t think before.

To be simple, I manage 3 models (Motorbike, Revision, Training).

If a motorbike is in revision or in training, I have to see on my form Motorbike that the moto is unavailable.

Example:

There are a training on 10/08/2019 with the motorbike 00004.

enter image description here

In my form Motorbike, the status has changed in unavailable for the motorbike 000004.

enter image description here

Well !

Now, my problem is in my form Revision, if I add a revision for the motorbike 000002

enter image description here

the status has to change in my form Motorbike also. Here the status has not changed...

enter image description here

In my Controller Motorbike I have this:

public function index()
{
$motorbikes =…

--

--

Ted James
Ted James

Written by Ted James

The world is my office, and every destination is my inspiration