コード例 #1
0
ファイル: TypeController.php プロジェクト: w1lliams/sh
 /**
  * Удаление типа
  *
  * @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');
 }
コード例 #2
0
ファイル: TypesController.php プロジェクト: kakapa/erpbox
 /**
  * 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');
 }