PHP code example of vdrnoyan / per_domain_models_filter

1. Go to this page and download the library: Download vdrnoyan/per_domain_models_filter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vdrnoyan / per_domain_models_filter example snippets


Item::withDomain()->paginate(2);

currentDomain()->filterOwn(Item::class)->get();
 php
php artisan vendor:publish --provider="Vdrnoyan\TenantModelFilter\TenantModelFilterServiceProvider"
 php
php artisan migrate
 php
valet link mydomain
 php
use Vdrnoyan\TenantModelFilter\Domain;

Domain::create(['domain'=>'mydomain.test', 'data'=>NULL]);
 php
$items = App\Item::all()->onlyForThisDomain();