Showing Completed Orders To Admin

This commit is contained in:
Mouhamed Lamine
2018-07-10 15:32:22 +08:00
parent 41012cf4b9
commit a35e4fd3c8
6 changed files with 70 additions and 561 deletions
@@ -754,4 +754,23 @@ class BookingController extends Controller
}
}
public function adminShowCompletedOrders()
{
$user = Auth::user();
$bookings = Booking::select('id', 'company_name','created_at', 'amount', 'admin_status')
->where('admin_status', 1)
->orderBy('id', 'desc')
->take(10)
->get();
foreach ($bookings as $booking) {
$booking->id = $id;
$booking->company_name = $company_name;
$booking->created_at = $created_at;
$booking->amount = $amount;
$booking->admin_status = $admin_status;
}
return $bookings;
}
}