-1
I’m trying to set up a login system but I can’t get the result I need.
There are three types of users:
- Admin
- User ()
- Teachers ()
I adapted the make:auth
with roles to create teacher and student, is working. However the admin will register both users, so only he can access a few pages.
I want to know how I can differentiate the access to the pages, for example, the registration page be accessed only by admin. I saw something of Laravel Gates Permissions etc. But I didn’t understand it very well.
I even created a field in the users table is_admin, but I don’t know what to do and how to check the pages.
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->string('is_admin');
$table->rememberToken();
$table->timestamps();
});
}