1 year ago

Type error: Too few arguments to function App\Http\Controllers\AdminController::send(), 0 passed and exactly 1 expected

Posted 1 year ago by icelander

I get the above errors when I hit the submit button. the idea is to get the id of the user when the submit button is clicked and use it to load up a view where I can see the user details. this is the view page where I used a form and sent the id through a route

 @foreach ($fixed as $fix)
                    <td>{{ $fix->paymentID }}</td>
                   <td> {{ $fix->created_at }}</td>
                   <td>  <button type="button" class="btn btn-success btn-sm">{{ $fix->status->description }}</button></td>
                   <td> {{ $fix->amount }}</td>
                   <form action="{{ route('admin.send',['id'=>$fix->user->id])}}" method="POST">
                    {{ csrf_field() }}
                   <td> <button type="submit" class="btn btn-outline-success">  More</button></td>

the controller

 public function send($id){
        $driverdetails = VehicleInformation::find($id);

        return redirect(route('admin.profile',['driver'=>$driverdetails]));

Please sign in or create an account to participate in this conversation.