I have this route which is in an authorised group:
Route::get('clan/leave',[
'as' => 'clan-leave',
'uses' => 'ClanController@getLeave'
]);
This leads to my ClanController with the function getLeave() which this is:
public function getLeave(){
return "Test";
}
I then have a basic link which takes the user to /clan/leave which should kick in the controllers function and display "Test". This is not happening, I am getting this error:
Trying to get property of non-object: Laravel\app\views\clan\display.blade.php
I do not see why this display file is even getting involved. I do have another route /clan which routes to this.
What am I not seeing? Many thanks.
I have found my problem.
I have this route:
Route::get('clan/{id}',[
'as' => 'clan',
'uses' => 'ClanController@getOther'
]);
And this route was being fired rather than the intended one. I can only assume this is fired off because it was picking up clan/leave (leave as a variable, rather than a route). I have fixed this by moving this route to the bottom of my routes