In my database, I have a table for roles
there are three roles, Admin, Regional Admin, and User
From my controller, I'm trying to select roles where the role name does not equal to "Admin".
Following is my eloquent
$roles = Role::pluck('name','name')->where('name','<>','Admin')->get();
But this gives me an error saying
Too few arguments to function Illuminate\Support\Collection::get(), 0 passed..
When I changed my eloquent
to
$roles = Role::pluck('name','name')->where('name','<>','Admin')->all();
it works but it'll give me all the records including the 'Admin'
Where do I need to fix in order to perform the following query,
SELECT * FROM `roles` WHERE name <> 'Admin'
I'm using those values in my blade as a dropdown options
{{ Form::select('roles',array_merge(['' => 'Veuillez sélectionner un rôle'], $roles ), Request::old('Roles'),array('class' => 'form-control txt_txt')) }}