You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.1 KiB

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Venue extends Model
{
use HasFactory;
protected $fillable = [
'name',
'venue_type',
'unit_name',
'district',
'ticket_type',
'open_time',
'reservation_notice',
'study_courses',
'address',
'lat',
'lng',
'cover_image',
'gallery_media',
'detail_html',
'live_people_count',
'sort',
'is_active',
];
protected $casts = [
'is_active' => 'boolean',
'gallery_media' => 'array',
'lat' => 'float',
'lng' => 'float',
'sort' => 'integer',
'live_people_count' => 'integer',
];
public function admins(): BelongsToMany
{
return $this->belongsToMany(User::class, 'user_venue')->withTimestamps();
}
public function reservations(): HasMany
{
return $this->hasMany(Reservation::class);
}
}