PHP code example of ifds-oss / tenant-guard
1. Go to this page and download the library: Download ifds-oss/tenant-guard 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/ */
ifds-oss / tenant-guard example snippets
use Ifds\TenantGuard\Concerns\BelongsToTenant;
class Post extends Model
{
use BelongsToTenant;
}
Route::middleware('tenant')->group(function () {
Route::get('/posts', [PostController::class, 'index']);
});
bash
composer tenant-guard:install
php artisan migrate