41 lines
787 B
PHP
41 lines
787 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\{Builder, Factories\HasFactory, Model, Relations\HasMany};
|
|
|
|
class Venue extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* Indicates if the model should be timestamped.
|
|
*
|
|
* @var bool
|
|
*/
|
|
public $timestamps = false;
|
|
|
|
|
|
/**
|
|
* @return HasMany
|
|
*/
|
|
public function events(): HasMany
|
|
{
|
|
return $this->hasMany(Event::class);
|
|
}
|
|
|
|
/**
|
|
* @param Builder $query
|
|
* @param string $column
|
|
* @param string $direction
|
|
*
|
|
* @return void
|
|
*/
|
|
public function scopeSortBy(Builder $query, string $column = 'id', string $direction = 'asc'): void
|
|
{
|
|
$query->orderBy($column, validateOrderDirection($direction));
|
|
}
|
|
}
|