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’…

Laravel Episode 8: CRUD Part 2

Episode 8: CRUD Part 2   Go over form method spoofing. https://laravel.com/docs/5.1/routing#form-method-spoofing Change the create form to use form method spoofing. Delete unnecessary buttons “more info” and “edit”. Create the edit form page. Code the update process. Add the delete functionality and note that it is a POST method. Show how to create a custom_js…

Laravel Episode 7: CRUD Part 1

Episode 7: CRUD Part 1   Changes since the last episode. Switched out laravelcollective code to standard html code. Moved validation messages to part of the form. Updated elixir to version 5. Create a new migration for products table. id int(11) product_name varchar(255) sku varchar(30) price decimal(5,2) description text timestamps php artisan make:migration create_products_table Create…

Laravel Episode 4: Models, Migration, and Database

Episode 4: Models, Migration, and Database Look at the /config/database.php file Use sqlite for demo database touch storage/database.sqlite Look at migration files Explain naming convention php artisan migrate 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