Level 5
I would check on the controller side before passing the $roles variable to your views, so something like this:
if(auth()->user()->isAdmin())
$roles = ['Admin', 'Standard'];
return view('myview', compact('roles'));
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello Guys,
is there any option to disable select options if user is not a developer
here is my code snippet:
<div class="col-md-2">
<div class="form-group">
<label for="confirm-password">Berechtigung</label>
{!! Form::select('roles[]', $roles,[], array('class' => 'form-control user-role')) !!}
</div>
</div>
my output:
So but i want that an admin can only select
So how can i do that?
Please or to participate in this conversation.