mardi 3 septembre 2019

training & appointment in advance

I have a table named "Training" with 4 fields (date_seance, hour_start, hour_end, fk_bike).

My first problem is that I can not plan dates in advance.

For example, if I reserve a date on 01/09/2019 for the bike 000001. It works but if, I must to book another booking on 02/09/2019 with the same bike. So, 000001 I don't see the bike 000001 in my dropdownlist.

Do you have an idea ? Please...

public function index()
{
    $trainings = Training::oldest()->paginate(5);
    return view('admin.trainings.index', compact('trainings'))
      ->with('i', (request()->input('page',1) -1)*5);
}



public function store(Request $request)
    {   

        $request->validate([
                 'date_seance' => 'required',
         'hour_start' => 'required',
             'hour_end' => 'required',
                 'fk_bike' => 'required'
        ]);

        Training::create($request->all());

        return redirect()->route('trainings.index')
                ->with('success', 'new data created successfully');
    }

I thank you for your help and your time.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire