first commit
This commit is contained in:
57
Modules/Admin/app/Models/Event.php
Normal file
57
Modules/Admin/app/Models/Event.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user