Crud: Error: ReflectionException (-1) Class App\Http\Middleware\CheckIfAdmin does not exist

Created on 23 Dec 2018  路  8Comments  路  Source: Laravel-Backpack/CRUD

Bug report

After installation of backpack on laravel 5.6, admin page doesnt show up but displays the following error -
Class App\Http\Middleware\CheckIfAdmin does not exist.
Any help will be appreciated

Backpack, Laravel, PHP, DB version:

triage

Most helpful comment

It states that the CheckIfAdmin Middleware is missing. So simply creating the missing Middleware will solve the problem.
Here is the Command:
php artisan make:middleware CheckIfAdmin

All 8 comments

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps _a lot_ in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication mediums:

  • Bug Reports, Feature Requests - Github Issues (here);
  • Quick help (_How do I do X_) - Gitter Chatroom;
  • Long questions (_I have done X and Y and it won't do Z wtf_) - Stackoverflow, using the backpack-for-laravel tag;

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome _awesome_ community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

--
Justin Case
The Backpack Robot

Hi @ifyboy60 ,

I'm pretty sure you missed a step upon installation. Make sure you've run BOTH these commands. The first one should publish the file you're missing - you must have not run it.

php artisan backpack:base:install
php artisan backpack:crud:install

Cheers!

sip

It states that the CheckIfAdmin Middleware is missing. So simply creating the missing Middleware will solve the problem.
Here is the Command:
php artisan make:middleware CheckIfAdmin

@deepkh3 thanks it was of great help

@deepkh3 Wow I tried everything possible from my side but i couldnt find the solution but thank god
You saved my ass

Note: If you do what @deepaksp , please make sure the middleware actually checks the user is an admin :-) An empty middleware won't do anything. Cheers!

Note: If you do what @deepaksp , please make sure the middleware actually checks the user is an admin :-) An empty middleware won't do anything. Cheers!

haha lol .. yes please do the needful 馃檹

Was this page helpful?
0 / 5 - 0 ratings