attributes['time_absolut'] = empty($date) ? null : \Illuminate\Support\Carbon::createFromFormat('Y-m-d H:i:s', $date); } public function setTimeMinAttribute($date) { $this->attributes['time_min'] = empty($date) ? null : \Illuminate\Support\Carbon::createFromFormat('Y-m-d H:i:s', $date); } public function setTimeMaxAttribute($date) { $this->attributes['time_max'] = empty($date) ? null : \Illuminate\Support\Carbon::createFromFormat('Y-m-d H:i:s', $date); } /** * relationship to dataset * * */ public function dataset() { return $this->belongsTo(Dataset::class, 'dataset_id', 'id'); } }