Laravel we have more and more options Like drop-down selection from database records.
Take a simple example permissions and roles. I have to add a role with some permissions.
So I have to call permissions from the database.
RoleController:
roles.create:
Here I am using multiple dropdown.
Simply we can add roles with permissions.
Take a simple example permissions and roles. I have to add a role with some permissions.
So I have to call permissions from the database.
RoleController:
$permissions = Permission::where('active_flag', 1)->orderBy('name')->pluck('name', 'id');
return view('roles.create',compact('permissions'));
roles.create:
<div class="form-group">
{!! Form::label('permissions', 'Permissions:') !!}
{!! Form::select('permissions',$permissions, null,['id'=>'multiple-checkboxes','multiple'=>'multiple'] ) !!}
</div>
Here I am using multiple dropdown.
Simply we can add roles with permissions.
No comments:
Post a Comment