/** * Remove the specified resource from storage. * @param int $id * @return Response */ public function destroy(Contact $contact) { if ($contact->domains->count() > 0) { return Redirect::route('admin.contacts.index')->with('message', "Contact could not be deleted because " . $contact->domains->count() . " domain(s) is stil pointing to this contact."); } if ($contact->netblocks->count() > 0) { return Redirect::route('admin.contacts.index')->with('message', "Contact could not be deleted because " . $contact->netblocks->count() . " netblock(s) is stil pointing to this contact."); } $contact->delete(); return Redirect::route('admin.contacts.index')->with('message', 'Contact has been deleted.'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy(Contact $contact) { $contact->delete(); return Redirect::route('admin.contacts.index')->with('message', 'Contact has been deleted.'); }