mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-31 05:16:49 -04:00
33 lines
779 B
PHP
33 lines
779 B
PHP
<?php
|
|
|
|
namespace Modules\Subscription\Traits;
|
|
|
|
use Modules\Subscription\Scopes\LmsScope;
|
|
use App\Models\LmsInstitute;
|
|
use Illuminate\Support\Facades\Log;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
trait Tenantable
|
|
{
|
|
|
|
protected static function bootTenantable()
|
|
{
|
|
//static::addGlobalScope(new LmsScope);
|
|
|
|
if (isset(Auth::user()->lms_id)) {
|
|
static::creating(function ($model) {
|
|
if (Schema::hasColumn($model->getTable(), 'lms_id')) {
|
|
$model->lms_id = Auth::user()->lms_id;
|
|
}
|
|
});
|
|
|
|
}
|
|
}
|
|
|
|
/*public function institute()
|
|
{
|
|
return $this->belongsTo(LmsInstitute::class, 'lms_id', 'id');
|
|
}*/
|
|
}
|