withTrashed() ->find($key); if ($record === null) { throw (new ModelNotFoundException)->setModel(BackupScheduleResource::getModel(), [$key]); } return $record; } protected function mutateFormDataBeforeSave(array $data): array { $data = BackupScheduleResource::ensurePolicyTypes($data); return BackupScheduleResource::hydrateNextRun($data); } }