protected function mutateFormDataBeforeSave(array $data): array
{
$post = $this->getRecord();
if ($post->status != $data['status'] && $data['status'] == PostConstants::PUBLISHED) {
$data['published_at'] = Carbon::now();
}
}
protected function mutateFormDataBeforeSave(array $data): array
{
$post = $this->getRecord();
if ($post->status != $data['status'] && $data['status'] == PostConstants::PUBLISHED) {
$data['published_at'] = Carbon::now();
}
}
the error :
Undefined array key "status"
Undefined array key "status"
the status is not disabled or hydrated, the problem happened after i used the translate plugin, and the when i add 'status' to the model translatable array the error was solved