34 lines
698 B
PHP
34 lines
698 B
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\PMS\Models;
|
||
|
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
use Modules\Employee\Models\Employee;
|
||
|
|
||
|
class Ticket extends Model
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* The attributes that are mass assignable.
|
||
|
*/
|
||
|
protected $table = 'tbl_tickets';
|
||
|
protected $fillable = ['subject', 'employee_id', 'assign_group_id', 'project_id', 'desc', 'file', 'ticket_type', 'status'];
|
||
|
|
||
|
const STATUS = [
|
||
|
1 => 'Pending',
|
||
|
2 => 'Approved',
|
||
|
3 => 'Rejected',
|
||
|
];
|
||
|
|
||
|
public function project()
|
||
|
{
|
||
|
return $this->belongsTo(Project::class, 'project_id');
|
||
|
}
|
||
|
|
||
|
public function employee()
|
||
|
{
|
||
|
return $this->belongsTo(Employee::class, 'employee_id');
|
||
|
}
|
||
|
|
||
|
}
|