feat: add theme
This commit is contained in:
@@ -3,16 +3,22 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Scene extends Model
|
||||
{
|
||||
protected $fillable = ['name', 'image_path', 'video_path', 'sound_path', 'order', 'is_active'];
|
||||
protected $fillable = ['theme_id', 'name', 'image_path', 'video_path', 'sound_path', 'order', 'is_active'];
|
||||
|
||||
protected $casts = [
|
||||
'is_active' => 'boolean',
|
||||
'order' => 'integer',
|
||||
];
|
||||
|
||||
public function theme(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Theme::class);
|
||||
}
|
||||
|
||||
protected $appends = ['image_url', 'video_url', 'sound_url', 'has_video'];
|
||||
|
||||
public function getImageUrlAttribute(): ?string
|
||||
|
||||
Reference in New Issue
Block a user