/** * Удаление типа * * @param Type $type * @return \Illuminate\Http\RedirectResponse * @throws \Exception */ public function delete(Type $type) { if (Organization::where('type_id', $type->id)->exists()) { dd('Есть организации с таким типом'); } $type->delete(); return redirect()->route('admin::type'); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy(Type $type) { // Delete the $type $type->delete(); flash()->success('Type has beed deleted'); return redirect('types'); }