Laravel Episode 10: More Middleware and Routes

Episode 10: More Middleware and Routes   Laravel Debugbar by barryvdh Works with Laravel 4 and 5. Great tool for sql profiler among other things. Review the previous episode regarding multiple roles middleware. Middleware implementation is not the same as how I implemented filters from previous version of Laravel. Use Debugbar how the SQL looks with current implementation of RoleMiddleware(). Possibly rewrite Role::userHasRole() to User::hasRoles() … Continue reading Laravel Episode 10: More Middleware and Routes

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’ => ‘staff@test.com’, ‘password’ => Hash::make(‘password’), ‘role_id’ => 2, ‘created_at’ => … Continue reading Laravel Episode 9: Middleware Roles