34 lines
708 B
PHP
34 lines
708 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class UserSceneSetting extends Model
|
|
{
|
|
protected $fillable = [
|
|
'user_id',
|
|
'active_scene_id',
|
|
'scene_volume',
|
|
'background_play_seconds',
|
|
'video_enabled',
|
|
];
|
|
|
|
protected $casts = [
|
|
'scene_volume' => 'integer',
|
|
'background_play_seconds' => 'integer',
|
|
'video_enabled' => 'boolean',
|
|
];
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function activeScene(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Scene::class, 'active_scene_id');
|
|
}
|
|
}
|