Laravel 5.1 multiple authentication

前端 未结 5 1192
隐瞒了意图╮
隐瞒了意图╮ 2020-12-06 14:09

How can you authenticate multiple types of users in Laravel 5.1 e.g. Jobseeker, Recruiter, Admin etc.

Some of you have suggested using a single users table to store

5条回答
  •  借酒劲吻你
    2020-12-06 14:21

    Short Answer: Add user types to your users table with specific number.

    TL;DR answer.

    Long Answer:

    1. If you have migrated your table, just run php artisan migrate:rollback.
    2. Add following line to your migration table for users: $table->integer("user_type")->default(0);

    Here I am considering that user type zero is just a simple JobSeeker.

    1. And in your form, you can add option with value zero and one such that people will be selecting what they want to be like recruiter. There is no need of other

提交回复
热议问题