jeudi 1 décembre 2016

Controller didn't get more arguments laravel

I'm trying to send two arguments and one request to controller with post request. This is the code where I send the arguments:

<form class="form-horizontal" name="form1"  method="post" action="" role="form" enctype="multipart/form-data">

And this is the controller where I'm sending the arguments:

    public function storeShipment(Request $request, $number, $category_name){

           $category = Category::where('category_name', $category_name)->first();
           $user = Auth::user();

           $item = new Item([

           'id' => $user->id,
           'category_id' => $category->id,
           'unq' => $number,
           'fullname' => $request->input('name'),
           ]);

           $item->save();
   }

But when I open the view it gives me error

ErrorException in NewShipmentController.php line 53:
Missing argument 3 for App\Http\Controllers\NewShipmentController::storeShipment()

Any ideas?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire