30 lines
590 B
PHP
30 lines
590 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class Event extends Model
|
|
{
|
|
protected $table = 'events';
|
|
protected $guarded = [];
|
|
protected $casts = [
|
|
'date' => 'date',
|
|
'settings' => 'array',
|
|
'is_active' => 'boolean',
|
|
];
|
|
|
|
public function tenant(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Tenant::class);
|
|
}
|
|
|
|
public function photos(): HasMany
|
|
{
|
|
return $this->hasMany(Photo::class);
|
|
}
|
|
}
|
|
|