'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'); } }