Changeset View
Changeset View
Standalone View
Standalone View
src/app/UserSetting.php
Show All 9 Lines | |||||
* @property int $id | * @property int $id | ||||
* @property int $user_id | * @property int $user_id | ||||
* @property string $key | * @property string $key | ||||
* @property string $value | * @property string $value | ||||
*/ | */ | ||||
class UserSetting extends Model | class UserSetting extends Model | ||||
{ | { | ||||
protected $fillable = [ | protected $fillable = [ | ||||
'key', 'value' | 'user_id', 'key', 'value' | ||||
]; | ]; | ||||
/** | /** | ||||
* The user to which this setting belongs. | * The user to which this setting belongs. | ||||
* | * | ||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo | ||||
*/ | */ | ||||
public function user() | public function user() | ||||
{ | { | ||||
return $this->belongsTo( | return $this->belongsTo( | ||||
'\App\User', | '\App\User', | ||||
'user_id', /* local */ | 'user_id', /* local */ | ||||
'id' /* remote */ | 'id' /* remote */ | ||||
); | ); | ||||
} | } | ||||
} | } |