Changeset View
Changeset View
Standalone View
Standalone View
src/app/TenantSetting.php
<?php | <?php | ||||
namespace App; | namespace App; | ||||
use Illuminate\Database\Eloquent\Model; | use Illuminate\Database\Eloquent\Model; | ||||
/** | /** | ||||
* A collection of settings for a Tenant. | * A collection of settings for a Tenant. | ||||
* | * | ||||
* @property int $id | * @property int $id | ||||
* @property string $key | * @property string $key | ||||
* @property int $tenant_id | * @property int $tenant_id | ||||
* @property string $value | * @property string $value | ||||
*/ | */ | ||||
class TenantSetting extends Model | class TenantSetting extends Model | ||||
{ | { | ||||
protected $fillable = [ | /** @var array<int, string> The attributes that are mass assignable */ | ||||
'tenant_id', 'key', 'value' | protected $fillable = ['tenant_id', 'key', 'value']; | ||||
]; | |||||
/** | /** | ||||
* The tenant to which this setting belongs. | * The tenant to which this setting belongs. | ||||
* | * | ||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo | ||||
*/ | */ | ||||
public function tenant() | public function tenant() | ||||
{ | { | ||||
return $this->belongsTo('\App\Tenant', 'tenant_id', 'id'); | return $this->belongsTo(Tenant::class, 'tenant_id', 'id'); | ||||
} | } | ||||
} | } |