Adding User Role to Form – WordPress-Like Blog Laravel 5.7 and AdminLTE 3 (18)

WordPress-Like Blog Laravel 5.7 and AdminLTE 3 (18) – Adding User Role to Form

In the previous part, we have created a role for the users. In this eighteenth part of creating WordPress-Like Blog using Laravel 5.7 and AdminLTE 3, we will :

  1. Adding Role Dropdown to Create User Form

Modify resources/views/backend/user.blade.php and add the following line to add the user role column:

Adding-User-Role-to-Form---Wordpress-Like-Blog-Laravel-5.7-and-AdminLTE-3-(18-1)

You can also add the following lines to layouts/sidebar.blade.php :

Next thing we do is to add the role option to the create user form. Add this to user/form.blade.php

Modify UserStoreRequest and UserUpdateRequest to add role as required.

Next, modify UsersController.php to add the attachRole to store() and update() method :

Github commit.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.