PHP code example of mk-devs / multi-tenant

1. Go to this page and download the library: Download mk-devs/multi-tenant 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/ */

    

mk-devs / multi-tenant example snippets


// Simple examples
MultiTenant::migrate('database_name');

MultiTenant::create('database_name')->migrate();

MultiTenant::seed([
    'database' => 'database_name',
    'connection' => 'mysql',
    'class' => 'CustomersTableSeed'
]);

MultiTenant::set([
    'database' => 'database_name',
    'connection' => 'mysql',
]);

// Advanced example
MultiTenant::migrate([
    'database' => 'database_name',
    'connection' => 'mysql',
    'path' => '/database/migrations/tenant'
])->seed(['class' => 'CustomersTableSeed'])->set();