Reputation: 105
I am calling the EventController with the action() from my navbar:
<a href="{{ action('EventController@list_events',['host_id' => Auth::user()->host_id]) }}">
In the EventController:
public function list_events($host_id)
{
$events = 'Hallo';
return view('list_events',['$events' => $events]);
}
And when I open it in the browser the following error occurse:
ErrorException in EventController.php line 60: Missing argument 1 for App\Http\Controllers\EventController::list_events()
Upvotes: 1
Views: 167
Reputation: 163768
Change your route to:
Route::get('list_events/{host_id}', 'EventController@list_events')->middleware('auth');
Upvotes: 1