Support the ongoing development of Laravel.io →
Authentication
Last updated 2 years ago.
0

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............

0

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'.

Last updated 9 years ago.
0

Learn about roles then accessing a logged in user, and that will get you there. I strongly suggest a seperate admin area.

Last updated 9 years ago.
0

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.

Last updated 9 years ago.
0

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.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

panosss panosss Joined 18 Jan 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.