prodV1 #2

Open
RomanGolienko wants to merge 309 commits from prodV1 into main
1 changed files with 3 additions and 15 deletions
Showing only changes of commit f1ffe64ef3 - Show all commits

View File

@ -234,19 +234,9 @@ class DirectionController extends Controller
public function destroy(Direction $direction): RedirectResponse public function destroy(Direction $direction): RedirectResponse
{ {
if ($direction->entranceExaminations()->exists()) { $direction->entranceExaminations()->each(fn ($entranceExamination) => $entranceExamination->delete());
Log::channel('app') $direction->directionProfiles()->detach();
->error( $direction->delete();
'NOT DELETE напр. подготовки {direction} - user {user}',
[
'user' => Auth::user()->name,
'direction' => $direction->name,
'data' => $direction->toArray(),
]
);
return back();
}
Log::channel('app') Log::channel('app')
->critical( ->critical(
'DELETE напр. подготовки {direction} - user {user}', 'DELETE напр. подготовки {direction} - user {user}',
@ -256,8 +246,6 @@ class DirectionController extends Controller
'data' => $direction->toArray(), 'data' => $direction->toArray(),
] ]
); );
$direction->directionProfiles()->detach();
$direction->delete();
return redirect()->route('directions.index'); return redirect()->route('directions.index');
} }