Files
freeu-project/app/Models/LeadTasksMeeting.php
Ritikesh yadav c661166e1d first commit
2024-03-28 14:52:40 +05:30

35 lines
906 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class LeadTasksMeeting extends Model
{
use HasFactory, SoftDeletes;
protected $casts = [
'due_date' => 'datetime:Y-m-d',
'from' => 'datetime:Y-m-d H:i:s',
'to' => 'datetime:Y-m-d H:i:s',
];
protected $fillable = ['leads_id' , 'type' ,'subject' ,'due_date' ,'priority' ,'owner' ,'reminder' ,'location' ,'all_day' ,'from' ,'to' ,'host' ,'participants' ,'related_to' ,'created_by', 'status'];
public function admin(){
return $this->belongsTo(User::class, 'created_by');
}
public function scopeTasks($query)
{
return $query->where('type', 'Task');
}
public function scopeMeetings($query)
{
return $query->where('type', 'Meeting');
}
}