jeudi 10 octobre 2019

Object class couldn't be converted to string Laravel 5

When I return the request of my controller, I get:

{"employees":"3","reason":"common reason","request":"5000","ded_per_pay":"500","months_to_pay":"2","date_issued":"2018-01-31"}

And in my create function, I get this error:

Object of class Symfony\Component\HttpFoundation\ParameterBag could not be converted to string

Here's my code:

     CashAdvance::create([
        'emp_id' => $request->employees,
        'reason' => $request->reason,
        'request' => $request->request,
        'ded_per_pay' => $request->ded_per_pay,
        'date_issued' => $request->date_issued,
        'months_to_pay' => $request->months_to_pay
    ]);

What seems to be causing the problem??



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire