StocksNew/Modules/Admin/app/Models/Event.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

58 lines
1.1 KiB
PHP

<?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;
}
}