'datetime', 'schedule_to' => 'datetime', ]; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'title', 'type', 'location', 'comment', 'additional', 'schedule_from', 'schedule_to', 'is_done', 'user_id', ]; /** * Get the user that owns the activity. */ public function user() { return $this->belongsTo(UserProxy::modelClass()); } /** * The participants that belong to the activity. */ public function participants() { return $this->hasMany(ParticipantProxy::modelClass()); } /** * Get the file associated with the activity. */ public function files() { return $this->hasMany(FileProxy::modelClass(), 'activity_id'); } /** * The leads that belong to the activity. */ public function leads() { return $this->belongsToMany(LeadProxy::modelClass(), 'lead_activities'); } /** * The Person that belong to the activity. */ public function persons() { return $this->belongsToMany(PersonProxy::modelClass(), 'person_activities'); } /** * The leads that belong to the activity. */ public function products() { return $this->belongsToMany(ProductProxy::modelClass(), 'product_activities'); } /** * The Warehouse that belong to the activity. */ public function warehouses() { return $this->belongsToMany(WarehouseProxy::modelClass(), 'warehouse_activities'); } }