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