Tag: roles

  • User Roles One to Many

    There are many ways to handle user roles in an application. One way is to create a role(s) that have many user(s) or a one to many relationship.

  • Laravel Episode 9: Middleware Roles

    Episode 9: Middleware Roles Create a migration file for staff role and default staff account. php artisan make:migration create_staff_role_and_default_new_user Code the new migration file. public function up() { // create new staff role DB::table(‘roles’)->insert( [ ‘id’ => 2, ‘role_name’ => ‘staff’ ] ); // create default user for staff DB::table(‘users’)->insert( [ ‘username’ => ‘staff’, ’email’…