samedi 31 août 2019

impossible to add, a recording

I'm trying to add a recording in my form Revision, but it misses a few things? I can add a recording via phpmyadmin but not on my form.

create.revision

enter image description here

index.revision

enter image description here

Here is, below my function store():

public function store(revisionRequest $request)
    {

        $date_revision_start = $request->get('date_revision_start');
        $date_revision_end = $request->get('date_revision_end');
        $garage = $request->get('garage');
        $fk_motorbike = $request->get('fk_motorbike');



        $conflict = Revision::whereDate('fk_motorbike', $request->get('fk_motorbike'))->whereDate('date_revision_start', "<=" , $date_revision_start);

        $conflict2 = Revision::whereDate('fk_motorbike', $request->get('fk_motorbike'))->whereDate('date_revision_start', "<=" , $date_revision_end)->whereDate('date_revision_end', ">=", $date_revision_end)->first();
        dd($conflict);

        if(isset($conflict2) || isset($conflict)){
            return redirect()->route('revisions.index')
             ->with('error', 'duplicate');
        }


       else{
        Revision::create($request->all());
            return redirect()->route('revisions.index')
                ->with('success', 'new data created successfully');
        }

    }

I don't understand the error ???

enter image description here

I thank you in advance for your help.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire