Beispiel #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param int $id
  *
  * @return mixed
  */
 public function destroy($id)
 {
     $canBeDeleted = empty(Division::find($id)->fixtures->toArray());
     if ($canBeDeleted) {
         Division::destroy($id);
         \Flash::success('Division deleted!');
     } else {
         \Flash::error('Cannot delete because they are existing fixtures in this division.');
     }
     return redirect('admin/data-management/divisions');
 }