php - Registration Form Type
I'm trying to modify my registration form to include a type (Restaurant or Consumer). I need a checkbox that once checked will indicate the account should be a Restaurant. (Not checked = Consumer).
I've researched Gates but it's not exactly what i'm looking for. My thought process was to make a boolean attribute in the user migration.
seeder
public function run() {
DB::table('users')->insert([
'name' => "admin",
'email' => '[email protected]',
'password' => bcrypt('admin'),
// 'type' => true
]);
}
migration
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
// $table->boolean('type');
$table->rememberToken();
$table->timestamps();
});
Upon the user checking the box, i want the restaurant users to be able to edit certain properties. With the consumer having no permissions, only viewing rights.
Answer
Solution:
you can do it like this Schema
Then you can run the migration: