How to show data from table via Model except a custom row

  laravel, laravel-8, php

I’m using Laravel 8 for my project and in this project, I have made a page for creating users by admins.

And basically, each user has a role, so in order to show the roles, I have added this:

<div class="form-group">
   <label class="col-sm-2 control-label">Role</label>
   <select class="form-control" name="role" dir="ltr">
   @foreach(AppModelsRole::all() as $role)
      <option value="{{ $role->id }}">{{ $role->name }}</option>
   @endforeach
   </select>
</div>

And all of roles goes like this:

enter image description here

Now I don’t want to print Super Admin in this form field. So my question is, how can I prevent AppModelsRole::all() from printing Super Admin in select option?

I would really appreciate any idea or suggestion from you guys…

Thanks in advance.

Source: Ask PHP

LEAVE A COMMENT