{"repo":"maize-tech/laravel-excludable","free":true,"listed":false,"github":"https://github.com/maize-tech/laravel-excludable","clone":"git clone https://github.com/maize-tech/laravel-excludable.git","description":"Easily exclude model entities from eloquent queries","language":"PHP","stars":62,"topics":["api","php","laravel","exclude","query","eloquent"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Laravel Excludable Easily exclude model entities from eloquent queries. This package allows you to define a subset of model entities that should be excluded from eloquent queries. You will be able to override the default Exclusion model and its associated migration, so you can eventually restrict the exclusion context by defining the entity that should effectively exclude the subset. An example usage could be an application with a multi tenant scenario and a set of global entities. While those entities should be accessible by all tenants, some of them might want to hide a subset of those entities for their users. You can find an example in the Usage section. Installation You can install the package via composer: You can publish and run the migrations with: You can publish the config file with: This is the content of the published config file: Usage Basic To use the package, add the Maize\\Excludable\\Excludable trait to all models you want to make excludable. Here's an example model including the Excludable trait: Now you can just query for a specific article entity and mark it as excluded. That's all! The package will add the given entity to the exclusions table, so all article related queries will exclude it. Exclude all model entities To exclude all entities of a specific model you can use the excludeAllModels method: The given method will create an Exclusion entity with a wildcard, which means all newly created entities will be excluded too. You can also provide a subset of","default_branch":null,"files":null,"tree":[],"storefront":"/r/maize-tech","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/maize-tech/laravel-excludable/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}