Support the ongoing development of Laravel.io →
Authentication Security Database

I have developed my first Laravel CRUD application and i am looking to setup a system of authentication. I have two groups of users:

  1. Employees who will have different permissions or privileges on specific tables. Create orders, add products...etc...

  2. Customers who will login and view invoices.

I am still learning Laravel and I am somewhat confused about the differences between using the mysql native user table vs using the built in Laravel Users table.

Can Laraval or a Laravel package do what I can do within Mysql with the user table.. ie grant privileges on tables, Only allow connections from a certain IP ? What would be the best strategy to handle the above groups ? i am using Laravel 5.2

Thanks...

Last updated 3 years ago.
0

users you are authenticating does not need to reside in the user table, meaning you can name the user table anything. On Laravel 5.2 and up it even supports multiple tables.

To set a different model to be authenticated, see the config/auth.php you need to set the model class there, if you're using the eloquent driver. Your model must extend Illuminate\Foundation\Auth\User

see this on how to do a multi model auth http://stackoverflow.com/questions/34490600/how-to-use-multi-auth-in-laravel-5-2

0

Sign in to participate in this thread!

Eventy

Your banner here too?

canadain1 canadain1 Joined 13 Jul 2016

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.

© 2025 Laravel.io - All rights reserved.