Have you searched authentication,security I have seen at least several topics on the issue. Do you have a role field??
See docs, email is example other fields are ok............
I 've seen them too, but I can't say I understood much...
I haven't changed anything, I have it as is by default, I don't know if it has a role field.
My 'users' table has no field named 'role', I' ve created a field 'is_admin'.
Learn about roles then accessing a logged in user, and that will get you there. I strongly suggest a seperate admin area.
I started with a separate admin authentication, copying (or more exactly trying to copy) the existing of laravel 5, but I failed totally :), so I thought I should modify the existing.
No need to modify anything, just add whatever fields you need in your user table, and do something like this:
$yourvar = $request->user()->is_admin;
And then do whatever if admin or whatever else if not an admin. You could use a redirect. A million possibilities here.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community