Download the PHP package vdrnoyan/per_domain_models_filter without Composer
On this page you can find all versions of the php package vdrnoyan/per_domain_models_filter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vdrnoyan/per_domain_models_filter
More information about vdrnoyan/per_domain_models_filter
Files in vdrnoyan/per_domain_models_filter
Package per_domain_models_filter
Short Description Simple per domain model filtering package.
License MIT
Homepage https://github.com/vdrnoyan/per-domain-models-filter
Informations about the package per_domain_models_filter
Per domian filterable models package
This is lightweight implemntation of multidomain setup for Laravel. With this package you can create domains, and have automatically per domain filtered models with very easy implementation.
Installation
You can install the package via composer:
Publish migrations
Run migration
Usage
You have to set up domain which opens you laravel installation. For this you may run following for your local valet setup;
You have to create domain entry in your database.
Add PerDomainFilterable trait to you filtrable model.
Now you can create any item of your model by sending request to the domain you just set up, and the relation between this model and domain will be established. Use following code to retrive domain specific items from database.
Beside the Collection filter you have also Eloquent query scope filter to use with methods like paginate. 'withDomain' method will ensure you have loaded only domain relevant items in your page, instead of filtering it after load, like it does Collection's 'onlyForThisDomain' method.
Domain specific items can be also retrieved from current, or any domain models.
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Vahan
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.