Skip to content
This repository has been archived by the owner on Sep 28, 2019. It is now read-only.

Commit

Permalink
Merge pull request #12 from avored/dev
Browse files Browse the repository at this point in the history
order history feature added
  • Loading branch information
indpurvesh committed Jun 27, 2018
2 parents 821067d + 4102225 commit 4d28e1a
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"barryvdh/laravel-dompdf": "0.8.*",
"laravel/passport": "5.0.*",
"stripe/stripe-php": "^6.3",
"avored/framework": "~1.5"
"avored/framework": "~1.8"
},
"autoload": {
"classmap": [
Expand Down
6 changes: 6 additions & 0 deletions resources/assets/sass/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ aside {

font-size: 20px;
color: $white;
.logo {
a {
text-decoration: none;
color: $white;
}
}

.nav-icon {
padding-left: 20px;
Expand Down
6 changes: 5 additions & 1 deletion resources/views/layouts/left-nav.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

<i class="fas fa-bars nav-icon"></i>

<span class="logo">AvoRed Admin</span>
<span class="logo">
<a href="{{ route('admin.dashboard') }}">
AvoRed Admin
</a>
</span>


</div>
Expand Down
22 changes: 19 additions & 3 deletions resources/views/order/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div class="clearfix"></div>
<br/>

<div class="card card-default">
<div class="card mt-3">
<h3 class="card-header">Order Basic Info</h3>

<div class="card-body">
Expand Down Expand Up @@ -76,7 +76,23 @@
</div>

</div>
<div class="card-default card ">
<div class="mt-3 card ">
<h3 class="card-header">Order History</h3>

<div class="card-body">


@foreach($order->history as $orderHistory)
<p>
This Order status was {{ $orderHistory->orderStatus->name }}
</p>

@endforeach

</div>

</div>
<div class="mt-3 card ">
<h3 class="card-header">Order Item Info</h3>

<div class="card-body">
Expand Down Expand Up @@ -119,7 +135,7 @@
</div>

</div>
<div class="card-default card">
<div class="mt-3 card">
<h3 class="card-header">Order Address Info</h3>

<div class="card-body">
Expand Down
6 changes: 6 additions & 0 deletions src/Http/Controllers/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use AvoRed\Ecommerce\DataGrid\Order as OrderGrid;
use AvoRed\Ecommerce\Http\Requests\UpdateOrderStatusRequest;
use AvoRed\Framework\Models\Contracts\OrderInterface;
use AvoRed\Framework\Models\Contracts\OrderHistoryInterface;

class OrderController extends Controller
{
Expand Down Expand Up @@ -83,6 +84,8 @@ public function editStatus(Model $order)
{
$orderStatus = OrderStatus::all()->pluck('name', 'id');

//INSERT a RECORD INTO ORDER_HISTORY TABLE

$view = view('avored-ecommerce::order.view')
->with('order', $order)
->with('orderStatus', $orderStatus)
Expand All @@ -105,6 +108,9 @@ public function updateStatus(Model $order, UpdateOrderStatusRequest $request)
$userEmail = $order->user->email;
$orderStatusTitle = $order->orderStatus->name;

$orderHistoryRepository = app(OrderHistoryInterface::class);
$orderHistoryRepository->create(['order_id' => $order->id, 'order_status_id' => $request->get('order_status_id')]);

Mail::to($userEmail)->send(new UpdateOrderStatusMail($orderStatusTitle));

return redirect()->route('admin.order.index');
Expand Down
2 changes: 1 addition & 1 deletion src/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected function registerAdminMenu()
AdminMenuFacade::add('shop', function(AdminMenu $shopMenu) {
$shopMenu->label('Shop')
->route('#')
->icon('fas fas-cart-plus');
->icon('fas fa-cart-plus');
});

$shopMenu = AdminMenuFacade::get('shop');
Expand Down

0 comments on commit 4d28e1a

Please sign in to comment.