In web.php I the following routes: web.php Route :: prefix ( 'app' )-> group ( function (){ Route :: post ( '/create_tag' , 'AdminController@addTag' ); })-> middleware ( AdminCheck :: class ); Here, middleware is AdminCheck. and in my AdminCheck middleware I wrote the following to test the middleware: AdminCheck.php public function handle ( $request , Closure $next ) { if (! Auth :: check ()) { return 'not loggedIn' ; } return $next ( $request ); } Now when I reload the '/' url of the website it shows 'Call to a member function middleware() on null' error. To solve this: In web...