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