Fixed url deletion
This commit is contained in:
parent
1c34b2aba0
commit
d097ef0ef5
1 changed files with 6 additions and 0 deletions
|
|
@ -91,6 +91,12 @@ class UrlController extends Controller
|
|||
*/
|
||||
public function destroy(Url $url)
|
||||
{
|
||||
foreach ($url->history as $history) {
|
||||
$history->deleteOrFail();
|
||||
}
|
||||
foreach ($url->stats as $stats) {
|
||||
$stats->deleteOrFail();
|
||||
}
|
||||
$url->deleteOrFail();
|
||||
return redirect()->route('bo.urls.index')
|
||||
->with(['warning' => 'L\'url pour la clé ' . $url->key . ' a bien été supprimée.']);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue