'bool', 'phone' => 'bool', ]; public function getFromAttribute() { return isset($this->attributes['from']) ? Carbon::parse($this->attributes['from'])->format('d.m.Y') : ''; } public function setFromAttribute($value) { if (!$value) { $this->attributes['from'] = null; } else { $this->attributes['from'] = Carbon::parse($value)->format('Y-m-d'); //(new Carbon($value))->format('Y-m-d'); } } public function getToAttribute() { return isset($this->attributes['to']) ? Carbon::parse($this->attributes['to'])->format('d.m.Y') : ''; } public function setToAttribute($value) { if (!$value) { $this->attributes['to'] = null; } else { $this->attributes['to'] = Carbon::parse($value)->format('Y-m-d'); //(new Carbon($value))->format('Y-m-d'); } } /* //local / phone //local / phone $table->boolean('local')->default(true); $table->boolean('phone')->default(true); $table->date('from'); $table->date('to'); */ }