StocksNew/Modules/Admin/app/Models/Event.php

58 lines
1.1 KiB
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?php
namespace Modules\Admin\Models;
use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Admin\Database\factories\EventFactory;
class Event extends Model
{
use HasFactory, StatusTrait;
protected $table = 'tbl_events';
protected $primaryKey = "event_id";
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'title',
'type',
'start_date',
'end_date',
'start_time',
'end_time',
'location',
'status',
'description',
'remarks',
'createdBy',
'updatedBy',
];
protected $casts = [
'start_date' => 'datetime',
'end_date' => 'datetime',
];
public const MEETING_TYPE = [
1 => 'Meeting',
2 => 'Training Sessions',
3 => 'Seminars',
4 => 'Celebrations',
5 => 'Product Launches',
6 => 'Wellness Events',
];
public $appends = ['status_name'];
public function getMeetingType()
{
return self::MEETING_TYPE[$this->type] ?? null;
}
}