Research of null value in relation (belongs to many)
Hi✋
I have a list of users(personnes) who have a location.
personnel table : id ,id_corp,....
lieu_affectation_histories: id , personnel_id,lieu_affectation_id,...
lieu_affectaion : id , name_fr,name_ar,....
Model Personnel :
Personnel Ressource :
**What I'm looking for, is a search of all personnel who don't have a location.
Thanks.
4 Replies
See the Laravel docs:
https://laravel.com/docs/master/eloquent-relationships#querying-relationship-existence
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Yes the "querying-relationship-existence" was the key word
This request gives me everyone who doesn't have a location.
-------
It is possible to add in a selective filter an option with 'person without having a location' that call the previus query ?
location_1 location_2 location_3 personne_without_locattion
location_1 location_2 location_3 personne_without_locattion
Use a filter form with a checkbox/toggle or similar
All right, thanks for that suggestion.. 😎