Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I would like to exclude some rows by Eloquent

I have a user table that contains a colum "role"
i would like to exclude the ones that contains a certain role by Eloquent
Does any one knows a solution for this ?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

To answer your original comment

User::query()->whereNotIn('role', 'blabla')->get();

To answer the second edit of the comment:

User::query()->whereNotIn('role', [
    'Admin', 'responsable', 'magasinier', 'demandeur' 
])->get();

To answer the third edit of the comment:

User::query()->whereNotIn('role', 'demandeur')->get();
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading