Skip to content

Commit

Permalink
FIXED: If order deleted, delete menus as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric H committed Jul 10, 2019
1 parent 0d74e13 commit 448f405
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/Http/Controllers/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use App\Events\Orders\UpdateOrderEvent;
use App\Http\Requests\Orders\OrderRequest;
use App\Events\Orders\NewOrderCreationEvent;
use App\Models\Menu;

class OrderController extends Controller
{
Expand Down Expand Up @@ -135,6 +136,8 @@ public function destroy(Order $order)

$order->delete();

Menu::where('order_id', $id)->delete();

Log::info("Order #$id has been successfully deleted.");

event(new SendFlashMessageEvent('success', trans('session.management.order.destroyed')));
Expand Down

0 comments on commit 448f405

Please sign in to comment.