Does anyone know why the middleware in the following example is not working?
class PageController extends Controller {
public function __construct() {
$this->middleware('auth');
}
public function home() {
return view('home');
}
}
// this line is executed from within another middleware:
\App::make('PageController');
I've also tried:
\App::call('PageController@home');
but it doesn't work either.
However If I call the controller from my route it works like expected:
Route::get('test', 'PageController@home');
But I need to call the controller from another middleware and not directly from a route.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community