I'm trying to set up a login system, but I can not seem to get the result I need.
There are three types of users:
- Admin
- User (students)
- Teachers
I've adapted the make:auth
with roles to create teacher and student, it's working. But admin will register both users, so only he can have access to a few pages.
I want to know how I can differentiate access to pages, such as the registration page being accessed only by admin . I saw something from Laravel gates permissions etc. But I did not quite understand.
I even created a field in the is_admin table, but I do not 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();
});
}