Episode 11: Updating My Profile
- Changes in between episode 10 and 11
- Cleaned up code in routes file.
- Go through code and replaced Role::userHasRole() with User::hasRoles().
- Removed __construct() from ProductController.
- Update database diagram to match current database schema.
- Create route for /my-profile.
- Create new route group for auth middleware.
- Create methods in UserController.
- Make sure to show that the password field is optional.
- Create view users/my_profile.blade.php.
- Create link in navbar for my profile interface.
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() like the example from Laravel’s website.
- Explain how to apply multiple middlewares for each route but for my example, it isn’t working as expected.
- Restful routing may not be used with implementation that is chosen.
- Possibly have to recode forms from CRUD to match new routes.
- Show Route Groups https://laravel.com/docs/5.1/routing#route-groups.
Episode 9: Middleware Roles
- Create a migration file for staff role and default staff account.
- Code the new migration file.
- Create new middleware for roles
- Edit the middleware file /app/Http/Middleware/RoleMiddleware.php.
- Add the new middleware to the /app/Http/Kernel.php.
- Apply it in a controller.
- You can redirect to a custom view if you wish.
- You can have specific methods apply middleware.
Episode 6: Password Reset and Email
- Move Login/Logout link to the navbar
- Add password help link to login page
- Configure .env to work with mailtrap.io
- Add value to from so that there is a sent from value. Good idea to use
- Modify route file with the following
- Review /Http/Controllers/Auth/PasswordController.php and add the following
- postReset() is already configured and does not need modification for this demo
- Create view files
- Review /config/auth.php file. Look at the emails.password setting
Episode 5: MySQL and Auth Design
- Show how to configure MySQL
- Create a database
- Create a user specific to the database
- Design the Users and Roles table
- Move roles migration file so it is created before users – rename it
- Edit user migration file so it uses role_id as foreign key
- Create log in form
- Create log in/out controller method
- Create authenticate controller method
- Create if/else to show login link or logout link
Episode 4: Models, Migration, and Database
- Look at the /config/database.php file
- Use sqlite for demo database
- Look at migration files
- Explain naming convention
- Explain migration, rollback, and refresh
- Explain up() and down()
- Explain what timestamps() is
- Create a default record for user
- Create a migration for roles table