This commit is contained in:
Firdachs08 2024-06-13 14:26:40 +07:00
parent 9672a893ec
commit 0010e11abb
101 changed files with 2149 additions and 2791 deletions

View File

@ -0,0 +1,32 @@
<?php
namespace App\Exports;
use App\Models\Booking;
use Carbon\Carbon;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
class BookingsExport implements FromCollection, WithHeadings
{
protected $startDate;
protected $endDate;
public function __construct($startDate, $endDate)
{
$this->startDate = $startDate;
$this->endDate = $endDate;
}
public function collection()
{
return Booking::whereBetween('created_at', [$this->startDate, $this->endDate])
->select('created_at', 'name', 'category', 'service_name', 'total')
->get();
}
public function headings(): array
{
return ['Date', 'User', 'Category', 'Service', 'Price'];
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace App\Exports;
use App\Models\Booking;
use App\Models\Order;
use Maatwebsite\Excel\Concerns\FromCollection;
class RevenueExport implements FromCollection
{
public function collection()
{
// Retrieve data from Booking and Order models
$bookings = Booking::all();
$orders = Order::all();
// Merge data from bookings and orders into one collection
$data = $bookings->merge($orders);
return $data;
}
}

View File

@ -3,20 +3,96 @@
namespace App\Exports;
use App\Models\Booking;
use App\Models\Order;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithEvents;
use Maatwebsite\Excel\Events\AfterSheet;
class RevenueExport implements FromCollection
class RevenueExport implements FromCollection, WithHeadings, WithMapping, WithEvents
{
protected $startDate;
protected $endDate;
protected $totalRevenuePerService;
public function __construct($startDate, $endDate)
{
$this->startDate = $startDate;
$this->endDate = $endDate;
$this->calculateTotalRevenuePerService();
}
public function collection()
{
// Retrieve data from Booking and Order models
$bookings = Booking::all();
$orders = Order::all();
return Booking::whereBetween('created_at', [$this->startDate, $this->endDate])
->select('created_at', 'name', 'category', 'service_name', 'total')
->get();
}
// Merge data from bookings and orders into one collection
$data = $bookings->merge($orders);
public function headings(): array
{
return ['Date', 'User', 'Category', 'Service', 'Price'];
}
return $data;
public function map($row): array
{
return [
$row->created_at,
$row->name,
$row->category,
$row->service_name,
$row->total
];
}
public function registerEvents(): array
{
return [
AfterSheet::class => function (AfterSheet $event) {
$sheet = $event->sheet;
$highestRow = $sheet->getHighestRow();
$row = $highestRow + 2;
// Append total revenue per service headers
$sheet->insertNewRowBefore($row, 2);
$sheet->setCellValue("A{$row}", 'Total Revenue per Service');
$sheet->setCellValue("A" . ($row + 1), 'Service');
$sheet->setCellValue("B" . ($row + 1), 'Total Revenue');
// Append total revenue per service data
$currentRow = $row + 2;
foreach ($this->totalRevenuePerService as $service => $total) {
$sheet->insertNewRowBefore($currentRow, 1);
$sheet->setCellValue("A{$currentRow}", $service);
$sheet->setCellValue("B{$currentRow}", $total);
$currentRow++;
}
// Mengatur format kolom angka
$sheet->getStyle("E2:E{$highestRow}")
->getNumberFormat()
->setFormatCode('#,##0'); // Format angka dengan ribuan pemisah dan tanpa desimal
// Mengatur format untuk kolom Total Revenue
$sheet->getStyle("B{$row}:B{$currentRow}")
->getNumberFormat()
->setFormatCode('#,##0'); // Format angka dengan ribuan pemisah dan tanpa desimal
}
];
}
private function calculateTotalRevenuePerService()
{
$bookings = Booking::whereBetween('created_at', [$this->startDate, $this->endDate])->get();
$this->totalRevenuePerService = [];
foreach ($bookings as $record) {
if (isset($record->service_name)) {
if (!isset($this->totalRevenuePerService[$record->service_name])) {
$this->totalRevenuePerService[$record->service_name] = 0;
}
$this->totalRevenuePerService[$record->service_name] += $record->total;
}
}
}
}

View File

@ -8,7 +8,7 @@ use Illuminate\Support\Facades\Validator;
use App\Http\Controllers\API\BaseController;
use App\Http\Resources\Item as ItemResource;
use App\Models\Review;
//use App\Models\Review;
use GuzzleHttp\Exception\GuzzleException;
use PhpParser\Node\Stmt\TryCatch;

View File

@ -38,8 +38,8 @@ class ProductController extends BaseController
public function show(Request $request){
$product = Product::with('media', 'category', 'tags')
->where('slug', $request->slug)
->withCount('media','approvedReviews')
->withAvg('approvedReviews', 'rating')
//->withCount('media','approvedReviews')
//->withAvg('approvedReviews', 'rating')
->active()
->hasQuantity()
->firstOrFail();

View File

@ -4,13 +4,47 @@ namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\Booking;
use App\Models\Schedule;
use Illuminate\Http\Request;
class BookingController extends Controller
{
public function index()
public function index(Request $request)
{
$bookings = Booking::orderBy('id', 'DESC')->get();
$search = $request->input('search');
$bookings = Booking::query()
->where('name', 'LIKE', "%{$search}%")
->orWhere('handphone', 'LIKE', "%{$search}%")
->orWhere('service_name', 'LIKE', "%{$search}%")
->orWhere('category', 'LIKE', "%{$search}%")
->orWhere('status', 'LIKE', "%{$search}%")
->orWhereHas('schedule', function ($query) use ($search) {
$query->withTrashed()->where('date', 'LIKE', "%{$search}%")
->orWhere('start_time', 'LIKE', "%{$search}%")
->orWhere('end_time', 'LIKE', "%{$search}%");
})
->paginate(10);
return view('admin.booking.index', compact('bookings'));
}
public function view($id)
{
$booking = Booking::with(['schedule' => function($query) {
$query->withTrashed();
}])->findOrFail($id);
return view('admin.booking.view', compact('booking'));
}
public function destroy($id)
{
$booking = Booking::findOrFail($id);
$booking->delete();
return redirect()->route('admin.booking.index')->with('message', 'Booking deleted successfully.');
}
}

View File

@ -1,7 +1,7 @@
<?php
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\Models\Category;
use App\Traits\ImageUploadTrait;
use App\Http\Controllers\Controller;
@ -18,12 +18,17 @@ class CategoryController extends Controller
*
* @return \Illuminate\Http\Response
*/
public function index()
public function index(Request $request)
{
//abort_if(Gate::denies('category_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');
$categories = Category::with('parent')->withCount('products')->latest()->paginate(5);
$search = $request->input('search');
$categories = Category::with('parent')
->withCount('products')
->when($search, function ($query) use ($search) {
$query->where('name', 'like', '%' . $search . '%');
})
->latest()
->paginate(5);
return view('admin.categories.index', compact('categories'));
}

View File

@ -17,11 +17,15 @@ class ObtainedController extends Controller
*
* @return \Illuminate\Http\Response
*/
public function index()
public function index(Request $request)
{
//abort_if(Gate::denies('obtained_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');
$search = $request->input('search');
$obtaineds = Obtained::paginate(5);
$obtaineds = Obtained::query()
->when($search, function ($query) use ($search) {
$query->where('name', 'like', '%' . $search . '%');
})
->paginate(5);
return view('admin.obtaineds.index', compact('obtaineds'));
}

View File

@ -60,6 +60,60 @@ class OrderController extends Controller
{
return view('admin.orders.show', compact('order'));
}
public function savePayment(Request $request, $orderId)
{
$order = Order::find($orderId);
if (!$order) {
return redirect()->back()->with([
'message' => 'Order not found!',
'alert-type' => 'error'
]);
}
$order->update(['payment_status' => 'paid', 'total_paid' => $request->total_paid]);
$changeAmount = $request->total_paid - $order->base_total_price;
$order->change_amount = $changeAmount;
$order->save();
// Simpan total dibayarkan dalam session
session(['total_paid' => $request->total_paid]);
return redirect()->route('admin.orders.show', $order)->with([
'message' => 'Payment status updated to paid!',
'alert-type' => 'success',
'total_paid' => $request->total_paid,
]);
}
public function markAsPaid(Request $request, $orderId)
{
$order = Order::find($orderId);
if (!$order) {
return redirect()->back()->with([
'message' => 'Order not found!',
'alert-type' => 'error'
]);
}
$order->update(['payment_status' => 'paid', 'total_paid' => $request->total_paid]);
$changeAmount = $request->total_paid - $order->base_total_price;
$order->change_amount = $changeAmount;
$order->save();
// Simpan total dibayarkan dalam session
session(['total_paid' => $request->total_paid]);
return redirect()->route('admin.orders.show', $order)->with([
'message' => 'Payment status updated to paid!',
'alert-type' => 'success',
'total_paid' => $request->total_paid,
]);
}
// ...
/**
* Remove the specified resource from storage.
@ -70,15 +124,6 @@ class OrderController extends Controller
public function destroy(Order $order)
{
// \DB::transaction(
// function () use ($order) {
// OrderItem::where('order_id', $order->id)->delete();
// $order->shipment->delete();
// $order->forceDelete();
// return true;
// }
// );
OrderItem::where('order_id', $order->id)->delete();
$order->delete();

View File

@ -19,11 +19,15 @@ class ProductController extends Controller
*
* @return \Illuminate\Http\Response
*/
public function index()
public function index(Request $request)
{
//abort_if(Gate::denies('product_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');
$search = $request->input('search');
$products = Product::with('category', 'tags', 'firstMedia')->latest()->paginate(5);
$products = Product::query()
->where('name', 'LIKE', "%{$search}%")
->paginate(10);
//$products = Product::with('category', 'tags', 'firstMedia')->latest()->paginate(5);
return view('admin.products.index', compact('products'));
}

View File

@ -2,29 +2,63 @@
namespace App\Http\Controllers\Admin;
use App\Models\Booking;
use Maatwebsite\Excel\Facades\Excel;
use App\Models\Order;
use App\Models\Booking;
use App\Exports\RevenueExport;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Maatwebsite\Excel\Facades\Excel;
use PDF;
use Carbon\Carbon;
class ReportController extends Controller
{
public function export(Request $request)
public function print(Request $request)
{
$exportType = $request->input('export');
$startDate = Carbon::parse($request->input('start'))->startOfDay();
$endDate = Carbon::parse($request->input('end'))->endOfDay();
if ($exportType == 'pdf') {
$data = Booking::all()->merge(Order::all());
$startDate = $data->min('created_at')->format('Y-m-d'); // Tanggal pertama
$endDate = $data->max('created_at')->format('Y-m-d');
$bookings = Booking::whereBetween('created_at', [$startDate, $endDate])->get();
$pdf = PDF::loadView('admin.reports.exports.revenue_pdf', compact('data', 'startDate', 'endDate'));
return $pdf->download('revenue_report.pdf');
} elseif ($exportType == 'xlsx') {
return Excel::download(new RevenueExport(), 'revenue_report.xlsx');
$totalRevenuePerService = [];
foreach ($bookings as $record) {
if (isset($record->service_name)) {
if (!isset($totalRevenuePerService[$record->service_name])) {
$totalRevenuePerService[$record->service_name] = 0;
}
$totalRevenuePerService[$record->service_name] += $record->total;
}
}
return view('admin.reports.print', compact('bookings', 'startDate', 'endDate', 'totalRevenuePerService'));
}
public function download(Request $request)
{
$startDate = Carbon::parse($request->input('start'))->startOfDay();
$endDate = Carbon::parse($request->input('end'))->endOfDay();
return Excel::download(new RevenueExport($startDate, $endDate), 'revenue_report.xlsx');
}
public function revenue()
{
$bookings = Booking::all();
return view('admin.reports.revenue', compact('bookings'));
}
public function totalRevenue(Request $request)
{
$bookings = Booking::all(); // Ganti sesuai logika bisnis Anda untuk mendapatkan bookings
return view('admin.reports.total-revenue', compact('bookings'));
}
public function orderReport(Request $request)
{
$startDate = Carbon::parse($request->input('start'))->startOfDay();
$endDate = Carbon::parse($request->input('end'))->endOfDay();
$orders = Order::whereBetween('created_at', [$startDate, $endDate])->get();
return view('admin.reports.orders', compact('orders', 'startDate', 'endDate'));
}
}

View File

@ -1,77 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Models\Review;
use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\ReviewRequest;
class ReviewController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$reviews = Review::with('product', 'user')->latest()->paginate(5);
return view('admin.reviews.index', compact('reviews'));
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show(Review $review)
{
return view('admin.reviews.show', compact('review'));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit(Review $review)
{
return view('admin.reviews.edit', compact('review'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(ReviewRequest $request,Review $review)
{
$review->update($request->validated());
return redirect()->route('admin.reviews.index')->with([
'message' => 'success updated !',
'alert-type' => 'info'
]);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy(Review $review)
{
$review->delete();
return redirect()->route('admin.reviews.index')->with([
'message' => 'success deleted !',
'alert-type' => 'danger'
]);
}
}

View File

@ -16,10 +16,15 @@ class ServiceCategoryController extends Controller
*
* @return \Illuminate\Http\Response
*/
public function index()
public function index(Request $request)
{
//abort_if(Gate::denies('category_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');
$serviceCategories = ServiceCategory::get();
$search = $request->input('search');
$serviceCategories = ServiceCategory::query()
->when($search, function ($query) use ($search) {
$query->where('name', 'like', '%' . $search . '%');
})
->paginate(10);
return view('admin.servicecategory.index', compact('serviceCategories'));
}

View File

@ -19,9 +19,18 @@ class ServiceController extends Controller
*
* @return \Illuminate\Http\Response
*/
public function index()
public function index(Request $request)
{
$services = Service::paginate(5);
$search = $request->input('search');
$services = Service::query()
->when($search, function ($query) use ($search) {
$query->where('name', 'like', '%' . $search . '%')
->orWhereHas('obtaineds', function ($query) use ($search) {
$query->where('name', 'like', '%' . $search . '%');
});
})
->paginate(5);
return view('admin.services.index', compact('services'));
}

View File

@ -1,74 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Models\Order;
use App\Models\Shipment;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class ShipmentController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$shipments = Shipment::latest()->paginate(10);
return view('admin.shipments.index', compact('shipments'));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit(Shipment $shipment)
{
$provinces = $this->getProvinces();
$cities = isset($shipment->province_id) ? $this->getCities($shipment->province_id) : [];
return view('admin.shipments.edit', compact('shipment', 'provinces', 'cities'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Shipment $shipment)
{
$request->validate(
[
'track_number' => 'required|max:255',
]
);
$order = \DB::transaction(
function () use ($shipment, $request) {
$shipment->track_number = $request->input('track_number');
$shipment->status = Shipment::SHIPPED;
$shipment->shipped_at = now();
$shipment->shipped_by = auth()->id();
if ($shipment->save()) {
$shipment->order->status = Order::DELIVERED;
$shipment->order->save();
}
return $shipment->order;
}
);
return redirect()->route('admin.orders.show', $order->id)->with([
'message' => 'success updated shipment !',
'alert-type' => 'info'
]);
}
}

View File

@ -1,185 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Models\Slide;
use Illuminate\Http\Request;
use App\Traits\ImageUploadTrait;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\File;
use App\Http\Requests\Admin\SlideRequest;
class SlideController extends Controller
{
use ImageUploadTrait;
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$slides = Slide::latest()->paginate(5);
return view('admin.slides.index', compact('slides'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('admin.slides.create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(SlideRequest $request)
{
$image = NULL;
if ($request->hasFile('cover')) {
$image = $this->uploadImage($request->title, $request->cover, 'slides', 500, 500);
}
Slide::create([
'title' => $request->title,
'url' => $request->url,
'body' => $request->body,
'cover' => $image,
'position' => Slide::max('position') + 1
]);
return redirect()->route('admin.slides.index')->with([
'message' => 'success created !',
'alert-type' => 'success'
]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show(Slide $slide)
{
return view('admin.slides.show', compact('slide'));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit(Slide $slide)
{
return view('admin.slides.edit', compact('slide'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request,Slide $slide)
{
$image = $slide->cover;
if ($request->has('cover')) {
if ($slide->cover != null && File::exists('storage/images/slides/'. $slide->cover)) {
unlink('storage/images/slides/'. $slide->cover);
}
$image = $this->uploadImage($request->title, $request->cover, 'slides', 450, 450);
}
$slide->update([
'title' => $request->title,
'url' => $request->url,
'body' => $request->body,
'cover' => $image,
]);
return redirect()->route('admin.slides.index')->with([
'message' => 'success updated !',
'alert-type' => 'info'
]);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy(Slide $slide)
{
if ($slide->cover) {
if (File::exists('storage/images/slides/'. $slide->cover)) {
unlink('storage/images/slides/'. $slide->cover);
}
}
$slide->delete();
return redirect()->route('admin.slides.index')->with([
'message' => 'success deleted !',
'alert-type' => 'danger'
]);
}
public function moveUp($slideId){
$slide = Slide::findOrFail($slideId);
if (!$slide->prevSlide()) {
return redirect()->route('admin.slides.index');
}
\DB::transaction(
function () use ($slide) {
$currentPosition = $slide->position;
$prevPosition = $slide->prevSlide()->position;
$prevSlide = Slide::find($slide->prevSlide()->id);
$prevSlide->position = $currentPosition;
$prevSlide->save();
$slide->position = $prevPosition;
$slide->save();
}
);
return redirect()->route('admin.slides.index');
}
public function moveDown($slideId){
$slide = Slide::findOrFail($slideId);
if (!$slide->nextSlide()) {
return redirect()->route('admin.slides.index');
}
\DB::transaction(
function () use ($slide) {
$currentPosition = $slide->position;
$prevPosition = $slide->nextSlide()->position;
$prevSlide = Slide::find($slide->nextSlide()->id);
$prevSlide->position = $currentPosition;
$prevSlide->save();
$slide->position = $prevPosition;
$slide->save();
}
);
return redirect()->route('admin.slides.index');
}
}

View File

@ -7,6 +7,7 @@ use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Gate;
use App\Http\Requests\Admin\TagRequest;
use Symfony\Component\HttpFoundation\Response;
use Illuminate\Http\Request;
class TagController extends Controller
{
@ -15,11 +16,16 @@ class TagController extends Controller
*
* @return \Illuminate\Http\Response
*/
public function index()
public function index(Request $request)
{
//abort_if(Gate::denies('tag_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');
$search = $request->input('search');
$tags = Tag::withCount('products')->latest()->paginate(5);
$tags = Tag::query()
->when($search, function ($query) use ($search) {
$query->where('name', 'like', "%{$search}%");
})
->withCount('products') // Menambahkan count relasi products
->paginate(10);
return view('admin.tags.index', compact('tags'));
}

View File

@ -1,77 +1,69 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Models\Role;
use App\Models\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\StoreUserRequest;
use App\Http\Requests\Admin\UpdateUserRequest;
class UserController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
public function index(Request $request)
{
$users = User::paginate(5);
$search = $request->input('search');
$users = User::query()
->where('username', 'LIKE', "%{$search}%")
->orWhere('email', 'LIKE', "%{$search}%")
->orWhere('phone', 'LIKE', "%{$search}%")
->paginate(10);
return view('admin.users.index', compact('users'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('admin.users.create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(StoreUserRequest $request)
{
$user = User::create($request->validated() + ['password' => bcrypt($request->password)]);
{
$data = $request->validated();
$data['password'] = bcrypt($data['password']);
User::create($data);
return redirect()->route('admin.users.index')->with('message', "Successfully Created!");
}
return redirect()->route('admin.users.index')->with('message', "Successfully Created !");
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$user = User::findOrFail($id);
//$roles = Role::all(); // Ganti Role dengan model yang sesuai dengan role Anda
return view('admin.users.edit', compact('user'));
return view('admin.users.edit', compact('user'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(UpdateUserRequest $request, $id)
{
$user = User::findOrFail($id);
$data = $request->validated();
if ($request->filled('password')) {
$data['password'] = bcrypt($data['password']);
} else {
unset($data['password']);
}
$user->update($data);
return redirect()->route('admin.users.index')->with('message', "Successfully Updated!");
}
public function destroy($id)
{
$user = User::findOrFail($id);
$user->update($request->validated() + ['password' => bcrypt($request->password)]);
$user->delete();
return redirect()->route('admin.users.index')->with('message', "Successfully Updated !");
return redirect()->route('admin.users.index')->with('message', 'User successfully deleted.');
}
// Methods for deleting users...
}

View File

@ -53,7 +53,7 @@ class RegisterController extends Controller
'username' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
//'phone' => ['required', 'string'],
'phone' => ['required', 'string'],
]);
}
@ -69,7 +69,7 @@ class RegisterController extends Controller
'username' => $data['username'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
//'phone' => $data['phone'],
'phone' => $data['phone'],
//'role' => 2, // Menetapkan peran secara langsung
]);

View File

@ -1,7 +1,7 @@
<?php
namespace App\Http\Controllers;
use Midtrans\Config;
use App\Models\Booking;
use App\Models\Schedule;
use App\Models\Service;
@ -37,24 +37,33 @@ class BookingController extends Controller
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$request->validate([
'name' => 'required',
'handphone' => 'required|numeric',
'category' => 'required',
'schedule_id' => 'required|exists:schedules,id',
]);
{
$request->validate([
'name' => 'required',
'handphone' => 'required|numeric',
'category' => 'required',
'schedule_id' => 'required|exists:schedules,id',
]);
$schedule = Schedule::find($request->schedule_id);
$scheduleId = $schedule->id;
$currentBookings = Booking::where('schedule_id', $request->schedule_id)->count();
$schedule = Schedule::find($request->schedule_id);
$scheduleId = $schedule->id;
$currentBookings = Booking::where('schedule_id', $request->schedule_id)->count();
if ($currentBookings >= $schedule->max_slot) {
return redirect()->back()->with('error', 'Schedule is fully booked');
}
if ($currentBookings >= $schedule->max_slot) {
return redirect()->back()->with('error', 'Schedule is fully booked');
}
$date = $schedule->date;
$time = $schedule->time;
// Periksa apakah hanya satu metode pembayaran yang dipilih
if ($request->cash && $request->cashless) {
return redirect()->back()->with('error', 'Hanya pilih satu metode pembayaran');
}
// Set status berdasarkan metode pembayaran yang dipilih
$status = $request->cash ? 'Cash' : 'Cashless';
$date = $schedule->date;
$time = $schedule->time;
$booking = Booking::create([
'service_name' => $request->service_name,
'name' => $request->name,
@ -63,48 +72,56 @@ $booking = Booking::create([
'date' => $date,
'time' => $time,
'total' => $request->price,
'status' => 'Unpaid',
'schedule_id' => $request->schedule_id, // Assign schedule_id here
'status' => $status === 'Cashless' ? 'Unpaid' : 'Paid', // Ubah status sesuai dengan metode pembayaran yang dipilih
'schedule_id' => $request->schedule_id,
'order_id' => Str::uuid(),
]);
if ($request['cash'] === "on" && $request['cashless'] === "on") {
return '<script>alert("Choose one payment only!!!");window.location.href="/orders/checkout"</script>';
}
if ($currentBookings + 1 >= $schedule->max_slot) {
$schedule->status = 'not available';
$schedule->save();
}
if ($currentBookings + 1 >= $schedule->max_slot) {
$schedule->status = 'not available';
$schedule->save();
}
if ($request['cash'] === "on") {
$booking->update(['status' => 'Cash']);
// $scheduleData->update(['status' => 'booked']);
return view('frontend.booking.paycash', compact('booking'));
}
// Jika pembayaran dilakukan menggunakan cash, langsung tampilkan halaman pembayaran
if ($status === 'Cash') {
$booking->update(['status' => 'Cash']);
return view('frontend.booking.paycash', compact('booking'));
}
// Set your Merchant Server Key
\Midtrans\Config::$serverKey = config('midtrans.serverKey');
// Set to Development/Sandbox Environment (default). Set to true for Production Environment (accept real transaction).
\Midtrans\Config::$isProduction = false;
// Set sanitization on (default)
\Midtrans\Config::$isSanitized = true;
// Set 3DS transaction for credit card to true
\Midtrans\Config::$is3ds = true;
// Jika pembayaran dilakukan menggunakan cashless, langsung ubah status menjadi Paid
if ($status === 'Cashless') {
$booking->update(['status' => 'Paid']);
// Lanjutkan dengan logika untuk pembayaran cashless
}
$params = array(
'transaction_details' => array(
'order_id' => Str::random(15),
'gross_amount' => $request->price,
),
'customer_details' => array(
'name' => $request->name,
'handphone' => $request->handphone,
),
);
$snapToken = \Midtrans\Snap::getSnapToken($params);
return view('frontend.booking.detail', compact('snapToken', 'booking', 'scheduleId'));
}
// Set your Merchant Server Key
\Midtrans\Config::$serverKey = config('midtrans.serverKey');
// Set to Development/Sandbox Environment (default). Set to true for Production Environment (accept real transaction).
\Midtrans\Config::$isProduction = false;
// Set sanitization on (default)
\Midtrans\Config::$isSanitized = true;
// Set 3DS transaction for credit card to true
\Midtrans\Config::$is3ds = true;
$params = array(
'transaction_details' => array(
'order_id' => Str::random(15),
'gross_amount' => $request->price,
),
'customer_details' => array(
'name' => $request->name,
'handphone' => $request->handphone,
),
);
$snapToken = \Midtrans\Snap::getSnapToken($params);
return view('frontend.booking.detail', compact('snapToken', 'booking', 'scheduleId'));
}
/**
* Display the specified resource.
@ -169,11 +186,23 @@ $booking = Booking::create([
public function payment_success($bookingId, $scheduleId)
{
$booking = Booking::findOrFail($bookingId);
$booking->update(['status' => 'Paid']);
$booking->update(['status' => 'Paid']); // Update status pembayaran menjadi "Paid"
$schedule = Schedule::findOrFail($scheduleId);
//$schedule->update(['status' => 'booked']);
return redirect()->route('service.index');
return redirect()->route('booking.print', ['bookingId' => $booking->id]); // Redirect ke halaman struk pembayaran
}
public function showBooking($bookingId)
{
$booking = Booking::findOrFail($bookingId);
return view('frontend.booking.show', compact('booking'));
}
public function printBill($bookingId)
{
$booking = Booking::findOrFail($bookingId);
return view('frontend.booking.show', compact('booking'));
}
}

View File

@ -4,7 +4,7 @@ namespace App\Http\Controllers;
use App\Models\Category;
use App\Models\Product;
use App\Models\Slide;
//use App\Models\Slide;
use Illuminate\Http\Request;
use phpDocumentor\Reflection\Types\Null_;
@ -20,8 +20,8 @@ class HomeController extends Controller
{
$products = Product::latest()->get();
$categories = Category::whereNull('category_id')->take(4)->get();
$slides = Slide::latest()->get();
//$slides = Slide::latest()->get();
return view('frontend.homepage', compact('products', 'categories','slides'));
return view('frontend.homepage', compact('products', 'categories'));
}
}

View File

@ -21,18 +21,8 @@ class OrderController extends Controller
return redirect()->route('cart.index');
}
// \Cart::removeConditionsByType('shipping');
$items = \Cart::getContent();
// $totalWeight = 0;
// foreach ($items as $item) {
// $totalWeight += ($item->quantity * $item->associatedModel->weight);
// }
// $provinces = $this->getProvinces();
// $cities = isset(auth()->user()->city_id) ? $this->getCities(auth()->user()->province_id) : [];
return view('frontend.orders.checkout', compact('items'));
}
@ -190,40 +180,12 @@ class OrderController extends Controller
$token = $request->except('_token');
$order = \DB::transaction(function () use ($token) {
// $destination = isset($params['ship_to']) ? $params['shipping_city_id'] : $params['city_id'];
// $items = \Cart::getContent();
// $totalWeight = 0;
// foreach ($items as $item) {
// $totalWeight += ($item->quantity * $item->associatedModel->weight);
// }
// $selectedShipping = $this->getSelectedShipping($destination, $totalWeight, $params['shipping_service']);
$baseTotalPrice = \Cart::getSubTotal();
// $shippingCost = $selectedShipping['cost'];
// $discountAmount = 0;
// $discountPercent = 0;
// $grandTotal = ($baseTotalPrice + $shippingCost) - $discountAmount;
$orderDate = date('Y-m-d H:i:s');
$paymentDue = (new \DateTime($orderDate))->modify('+3 day')->format('Y-m-d H:i:s');
// $user_profile = [
// 'username' => $params['username'],
// 'first_name' => $params['first_name'],
// 'last_name' => $params['last_name'],
// 'address1' => $params['address1'],
// 'address2' => $params['address2'],
// 'province_id' => $params['province_id'],
// 'city_id' => $params['city_id'],
// 'postcode' => $params['postcode'],
// 'phone' => $params['phone'],
// 'email' => $params['email'],
// ];
// auth()->user()->update($user_profile);
$orderParams = [
'user_id' => auth()->id(),
'code' => Order::generateCode(),
@ -232,23 +194,15 @@ class OrderController extends Controller
'payment_due' => $paymentDue,
'payment_status' => Order::UNPAID,
'base_total_price' => $baseTotalPrice,
// 'discount_amount' => $discountAmount,
// 'discount_percent' => $discountPercent,
// 'shipping_cost' => $shippingCost,
// 'grand_total' => $grandTotal,
'customer_first_name' => $token['username'],
// 'customer_last_name' => $params['last_name'],
// 'customer_address1' => $params['address1'],
// 'customer_address2' => $params['address2'],
'customer_phone' => $token['phone'],
// 'customer_email' => $params['email'],
// 'customer_city_id' => $params['city_id'],
// 'customer_province_id' => $params['province_id'],
// 'customer_postcode' => $params['postcode'],
'note' => $token['note'],
// 'shipping_courier' => $selectedShipping['courier'],
// 'shipping_service_name' => $selectedShipping['service'],
];
if (!empty($token['reseller']) && $token['reseller'] === 'on') {
$orderParams['customer_first_name'] = $token['customer_first_name']; // Simpan reseller name jika checkbox reseller dicentang
$orderParams['customer_phone'] = $token['customer_phone']; // Simpan reseller phone jika checkbox reseller dicentang
}
$order = Order::create($orderParams);
@ -285,46 +239,14 @@ class OrderController extends Controller
}
}
}
// $shippingFirstName = isset($params['ship_to']) ? $params['shipping_first_name'] : $params['first_name'];
// $shippingLastName = isset($params['ship_to']) ? $params['shipping_last_name'] : $params['last_name'];
// $shippingAddress1 = isset($params['ship_to']) ? $params['shipping_address1'] : $params['address1'];
// $shippingAddress2 = isset($params['ship_to']) ? $params['shipping_address2'] : $params['address2'];
// $shippingPhone = isset($params['ship_to']) ? $params['shipping_phone'] : $params['phone'];
// $shippingEmail = isset($params['ship_to']) ? $params['shipping_email'] : $params['email'];
// $shippingCityId = isset($params['ship_to']) ? $params['shipping_city_id'] : $params['city_id'];
// $shippingProvinceId = isset($params['ship_to']) ? $params['shipping_province_id'] : $params['province_id'];
// $shippingPostcode = isset($params['ship_to']) ? $params['shipping_postcode'] : $params['postcode'];
// $shipmentParams = [
// 'user_id' => auth()->id(),
// 'order_id' => $order->id,
// 'status' => Shipment::PENDING,
// 'total_qty' => \Cart::getTotalQuantity(),
// 'total_weight' => $totalWeight,
// 'first_name' => $shippingFirstName,
// 'last_name' => $shippingLastName,
// 'address1' => $shippingAddress1,
// 'address2' => $shippingAddress2,
// 'phone' => $shippingPhone,
// 'email' => $shippingEmail,
// 'city_id' => $shippingCityId,
// 'province_id' => $shippingProvinceId,
// 'postcode' => $shippingPostcode,
// ];
// Shipment::create($shipmentParams);
return $order;
});
if (!isset($order)) {
return redirect()->back()->with([
'message' => 'something went wrong !',
'message' => 'something went wrong!',
'alert-type' => 'danger'
]);
// return redirect()->route('checkout.received', $order->id);
}
if ($request['cash'] === "on" && $request['cashless'] === "on") {
@ -333,7 +255,7 @@ class OrderController extends Controller
if ($request['cash'] === "on") {
\Cart::clear();
$order->update(['payment_status' => 'cash']);
$order->update(['payment_status' => 'unpaid']);
return view('frontend.orders.cash', compact('order'));
}
@ -346,58 +268,23 @@ class OrderController extends Controller
// Set 3DS transaction for credit card to true
\Midtrans\Config::$is3ds = true;
$params = array(
'transaction_details' => array(
$params = [
'transaction_details' => [
'order_id' => Str::random(15),
'gross_amount' => $order->base_total_price,
),
'customer_details' => array(
],
'customer_details' => [
'name' => $request->username,
'handphone' => $request->phone,
),
);
],
];
$snapToken = \Midtrans\Snap::getSnapToken($params);
return view('frontend.orders.confirmation', compact('snapToken', 'order'));
// $this->initPaymentGateway();
// $customerDetails = [
// 'first_name' => $order->customer_first_name,
// 'last_name' => $order->customer_last_name,
// 'email' => $order->customer_email,
// 'phone' => $order->customer_phone,
// ];
// $transaction_details = [
// 'enable_payments' => Payment::PAYMENT_CHANNELS,
// 'transaction_details' => [
// 'order_id' => $order->code,
// 'gross_amount' => $order->grand_total,
// ],
// 'customer_details' => $customerDetails,
// 'expiry' => [
// 'start_time' => date('Y-m-d H:i:s T'),
// 'unit' => Payment::EXPIRY_UNIT,
// 'duration' => Payment::EXPIRY_DURATION,
// ]
// ];
// try {
// $snap = Snap::createTransaction($transaction_details);
// $order->payment_token = $snap->token;
// $order->payment_url = $snap->redirect_url;
// $order->save();
// header('Location: ' . $order->payment_url);
// exit;
// } catch (Exception $e) {
// echo $e->getMessage();
// }
}
public function order_success($orderId)
{
$order = Order::find($orderId);

View File

@ -11,8 +11,8 @@ class ProductController extends Controller
{
$product = Product::with('media', 'category', 'tags')
->where('slug', $slug)
->withCount('media','approvedReviews')
->withAvg('approvedReviews', 'rating')
->withCount('media')
->active()
->hasQuantity()
->firstOrFail();

View File

@ -21,6 +21,7 @@ class ServiceController extends Controller
return view('frontend.service.index', compact('serviceCategories'));
}
/**
* Show the form for creating a new resource.
*

View File

@ -1,110 +0,0 @@
<?php
namespace App\Http\Livewire\Shop;
use App\Models\Order;
use App\Models\Review;
use Illuminate\Http\Request;
use Livewire\Component;
class SingleProductReviewComponent extends Component
{
public $showForm = true;
public $canRate = false;
public $product;
public $content;
public $rating;
public $checkProduct;
public $currentRatingId;
protected $listeners = [
'update_rating' => 'mount',
];
public function mount()
{
$this->checkProduct = Order::whereHas('orderItems', function ($query) {
$query->where('product_id', $this->product->id);
})->where('user_id', auth()->id())->where('status', Order::COMPLETED)->first();
if ($this->checkProduct) {
$this->canRate = true;
}
if(auth()->user()){
$rating = Review::where('user_id', auth()->id())->where('product_id', $this->product->id)->first();
if (!empty($rating)) {
$this->rating = $rating->rating;
$this->content = $rating->content;
$this->currentRatingId = $rating->id;
}
}
}
public function rules()
{
return [
'rating' => ['required'],
'content' => ['required', 'string']
];
}
public function rate(Request $request)
{
if (!$this->checkProduct){
$this->alert('error', 'You must buy this item first');
return false;
}
$rating = Review::where('user_id', auth()->id())->where('product_id', $this->product->id)->first();
$this->validate();
if (empty($rating)) {
$rating = new Review();
$rating->user_id = auth()->id();
$rating->product_id = $this->product->id;
$rating->rating = $this->rating;
$rating->content = $this->content;
$rating->status = 1;
$rating->save();
} else {
if ($rating->status == 'Inactive'){
$this->alert('error', 'already rating this item');
return false;
}
$rating->user_id = auth()->id();
$rating->product_id = $this->product->id;
$rating->rating = $this->rating;
$rating->content = $this->content;
$rating->ip_address = $request->ip();
$rating->status = 1;
$rating->update();
}
$this->showForm = false;
$this->emit('update_rating');
}
public function delete($id)
{
$rating = Review::where('id', $id)->first();
if ($rating && ($rating->user_id == auth()->id())) {
$rating->delete();
}
if ($this->currentRatingId) {
$this->currentRatingId = '';
$this->rating = '';
$this->content = '';
}
$this->emit('update_rating');
$this->showForm = true;
}
public function render()
{
return view('livewire.shop.single-product-review-component');
}
}

View File

@ -35,7 +35,7 @@ class ProductRequest extends FormRequest
'status' => ['required'],
'weight' => ['required', 'numeric'],
'description' => ['required', 'max:1000'],
'details' => ['required', 'max:10000'],
//'details' => ['required', 'max:10000'],
'images' => ['required'],
'images.*' => ['mimes:jpg,jpeg,png,gif', 'max:4000']
];
@ -50,8 +50,8 @@ class ProductRequest extends FormRequest
'quantity' => ['required', 'numeric'],
'category_id' => ['required'],
'tags.*' => ['required'],
'details' => ['required', 'max:10000'],
'review_able' => ['nullable'],
//'details' => ['required', 'max:10000'],
'status' => ['required'],
'images' => ['nullable'],
'images.*' => ['mimes:jpg,jpeg,png,gif', 'max:4000']

View File

@ -1,30 +0,0 @@
<?php
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
class ReviewRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'status' => ['required'],
];
}
}

View File

@ -1,49 +0,0 @@
<?php
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
class SlideRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
switch ($this->method()) {
case 'POST':
{
return [
'title' => ['required', 'max:255'],
'url' => ['required', 'max:255'],
'body' => ['required', 'max:255'],
'cover' => ['required','mimes:jpg,jpeg,png,gif', 'max:3000']
];
}
case 'PUT':
case 'PATCH':
{
return [
'title' => ['required', 'max:255'],
'url' => ['required', 'max:255'],
'body' => ['required', 'max:255'],
'cover' => ['mimes:jpg,jpeg,png,gif', 'max:3000']
];
}
default: break;
}
}
}

View File

@ -24,10 +24,11 @@ class StoreUserRequest extends FormRequest
public function rules()
{
return [
'username' => ['required'],
'email' => ['required', 'unique:users',],
'roles.*' => ['integer',],
'roles' => ['required', 'array',],
'username' => ['required', 'unique:users'],
'email' => ['required', 'unique:users'],
'phone' => ['required', 'unique:users'],
'password' => ['required'],
'role' => ['required', 'in:admin,user'],
];
}
}

View File

@ -1,38 +0,0 @@
<?php
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
class UpdateRoleRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'title' => 'required',
'permissions.*' => [
'integer',
],
'permissions' => [
'required',
'array',
],
];
}
}

View File

@ -3,6 +3,7 @@
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UpdateUserRequest extends FormRequest
{
@ -24,20 +25,11 @@ class UpdateUserRequest extends FormRequest
public function rules()
{
return [
'username' => [
'required',
],
'email' => [
'required',
'unique:users,email,' . request()->route('user')->id,
],
'roles.*' => [
'integer',
],
'roles' => [
'required',
'array',
],
'username' => ['required', Rule::unique('users')->ignore($this->user)],
'email' => ['required', Rule::unique('users')->ignore($this->user)],
'phone' => ['required', Rule::unique('users')->ignore($this->user)],
'password' => ['nullable'],
'role' => ['required', 'in:admin,user'],
];
}
}

View File

@ -21,7 +21,7 @@ class Product extends JsonResource
'price' => $this->price,
'quantity' => $this->quantity,
'description' => $this->description,
'details' => $this->details,
//'details' => $this->details,
'image' => $image,
];
}

View File

@ -12,6 +12,6 @@ class Booking extends Model
protected $guarded = ['id'];
public function schedule()
{
return $this->belongsTo(Schedule::class);
return $this->belongsTo(Schedule::class)->withTrashed();
}
}

View File

@ -63,24 +63,11 @@ class Product extends Model
->orderBy('file_sort', 'asc');
}
public function reviews()
{
return $this->hasMany(Review::class);
}
public function approvedReviews()
{
return $this->hasMany(Review::class)->whereStatus(1);
}
public function ratings()
{
return $this->hasMany(Rating::class);
}
public function rate()
{
return $this->ratings->isNotEmpty() ? $this->ratings()->sum('value') / $this->ratings()->count() : 0;
}
}

View File

@ -1,11 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Rating extends Model
{
use HasFactory;
}

View File

@ -1,27 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Review extends Model
{
use HasFactory;
protected $guarded = ['id','created_at','updated_at'];
public function getStatusAttribute()
{
return $this->attributes['status'] == 0 ? 'Inactive' : 'Active';
}
public function user(){
return $this->belongsTo(User::class);
}
public function product()
{
return $this->belongsTo(Product::class);
}
}

View File

@ -4,10 +4,11 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Schedule extends Model
{
use HasFactory;
use HasFactory, SoftDeletes;
protected $guarded = ['id'];

View File

@ -1,26 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Shipment extends Model
{
use HasFactory;
protected $guarded = ['id', 'created_at', 'updated_at'];
public const PENDING = 'pending';
public const SHIPPED = 'shipped';
/**
* Relationship to the order model
*
* @return void
*/
public function order()
{
return $this->belongsTo(Order::class);
}
}

View File

@ -1,27 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Slide extends Model
{
use HasFactory;
protected $guarded = ['id', 'created_at', 'updated_at'];
public function prevSlide()
{
return self::where('position', '<', $this->position)
->orderBy('position', 'DESC')
->first();
}
public function nextSlide()
{
return self::where('position', '>', $this->position)
->orderBy('position', 'ASC')
->first();
}
}

View File

@ -21,9 +21,14 @@ class User extends Authenticatable
'username',
'email',
'password',
'phone',
'role', // Add the role attribute here
];
public function assignRole($role)
{
$this->role = $role; // Anggaplah kolom peran pada tabel pengguna adalah 'role'
$this->save();
}
/**
* The attributes that should be hidden for serialization.

View File

@ -4,7 +4,7 @@ namespace App\Providers;
use App\Models\Tag;
use App\Models\Category;
use App\Models\Review;
//use App\Models\Review;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
@ -32,7 +32,7 @@ class AppServiceProvider extends ServiceProvider
View::composer('*', function ($view) {
$view->with('categories_menu', Category::with('children')->whereNull('category_id')->get());
$view->with('tags_menu', Tag::withCount('products')->get());
$view->with('recent_reviews', Review::with('product','user')->whereStatus(true)->latest()->limit(5)->get());
//$view->with('recent_reviews', Review::with('product','user')->whereStatus(true)->latest()->limit(5)->get());
});
}
}

View File

@ -20,7 +20,7 @@ class CreateProductsTable extends Migration
$table->string('slug');
$table->integer('price');
$table->text('description');
$table->longText('details');
//$table->longText('details');
$table->integer('weight');
$table->integer('quantity')->default(0);
$table->boolean('status')->default(false);

View File

@ -1,36 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSlidesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('slides', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('url')->nullable();
$table->integer('position')->default(0);
$table->text('body')->nullable();
$table->text('cover');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('slides');
}
}

View File

@ -1,53 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateShipmentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shipments', function (Blueprint $table) {
$table->id();
// $table->foreignId('user_id')->nullable()->constrained();
//$table->foreignId('order_id')->nullable()->constrained();
$table->string('track_number')->nullable();
$table->string('status');
$table->integer('total_qty');
$table->integer('total_weight');
$table->string('first_name');
$table->string('last_name');
$table->string('address1')->nullable();
$table->string('address2')->nullable();
$table->string('phone')->nullable();
$table->string('email')->nullable();
$table->string('city_id')->nullable();
$table->string('province_id')->nullable();
$table->integer('postcode')->nullable();
$table->datetime('shipped_at')->nullable();
$table->unsignedBigInteger('shipped_by')->nullable();
//$table->foreign('shipped_by')->references('id')->on('users');
$table->index('track_number');
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('shipments');
}
}

View File

@ -1,37 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateReviewsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('reviews', function (Blueprint $table) {
$table->id();
//$table->foreignId('user_id')->nullable()->constrained()->cascadeOnDelete();
$table->foreignId('product_id')->constrained()->cascadeOnDelete();
$table->text('content');
$table->boolean('status')->default(false);
$table->unsignedTinyInteger('rating');
$table->string('ip_address')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('reviews');
}
}

View File

@ -15,7 +15,7 @@ class CreateOrdersTable extends Migration
{
Schema::create('orders', function (Blueprint $table) {
$table->id();
//$table->foreignId('user_id')->nullable()->constrained();
$table->foreignId('user_id')->nullable()->constrained();
$table->string('code')->unique();
$table->string('status');
$table->datetime('order_date');

View File

@ -15,10 +15,10 @@ class CreateFavoritesTable extends Migration
{
Schema::create('favorites', function (Blueprint $table) {
$table->id();
//$table->foreignId('user_id')->constrained();
$table->foreignId('user_id')->constrained();
$table->foreignId('product_id')->constrained();
$table->timestamps();
//$table->index(['user_id', 'product_id']);
$table->index(['user_id', 'product_id']);
});
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddDeletedAtToSchedulesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('schedules', function (Blueprint $table) {
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('schedules', function (Blueprint $table) {
$table->dropSoftDeletes();
});
}
}

View File

@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddTotalPaidAndChangeAmountToOrdersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('orders', function (Blueprint $table) {
$table->decimal('total_paid', 15, 2)->nullable();
$table->decimal('change_amount', 15, 2)->nullable();
});
}
public function down()
{
Schema::table('orders', function (Blueprint $table) {
$table->dropColumn('total_paid');
$table->dropColumn('change_amount');
});
}
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddPhoneToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
//$table->string('phone')->after('email');
$table->string('phone')->nullable()->after('email');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('phone');
});
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -19,73 +19,84 @@
</div>
<!-- Content Row -->
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>No</th>
<th>Payment</th>
<th>Date</th>
<th>Time</th>
<th>Service</th>
<th>Customer Name</th>
<th>Contact</th>
{{-- <th>Action</th> --}}
</tr>
</thead>
<tbody>
@forelse($bookings as $booking)
<tr>
<td>{{ $loop->iteration }}</td>
<td>
@if ($booking->status === 'Cash')
{{ $booking->status }}
@else
@if ($booking->status === 'Paid')
<span class="text-success">Cashless - Paid</span>
@elseif ($booking->status === 'Unpaid')
<span class="text-danger">Cashless - Unpaid</span>
@endif
@endif
</td>
<td>{{ $booking->date }}</td>
<td>{{ $booking->schedule->start_time }} - {{ $booking->schedule->end_time }}</td>
<td>{{ $booking->category }} - {{ $booking->service_name }} ({{ number_format($booking->total, 0, '.', '.') }})</td>
<td>{{ $booking->name }}</td>
<td>{{ $booking->handphone }}</td>
{{-- <td>
<a href="{{ route('admin.service.edit', $service->id) }}" class="btn btn-info">
<i class="fa fa-pencil-alt"></i>
<div class="card">
<div class="card-body">
<div class="table-responsive">
<form action="{{ route('admin.booking.index') }}" method="GET" class="form-inline">
<div class="input-group">
<input type="text" name="search" class="form-control" placeholder="Search..." value="{{ request('search') }}">
<div class="input-group-append">
<button class="btn btn-primary" type="submit">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</form>
<table class="table table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>No</th>
<th>Payment</th>
<th>Date</th>
<th>Time</th>
<th>Service</th>
<th>Customer Name</th>
<th>Contact</th>
<th>Actions</th>
{{-- <th>Action</th> --}}
</tr>
</thead>
<tbody>
@forelse($bookings as $booking)
<tr>
<td>{{ $loop->iteration }}</td>
<td>
@if ($booking->status === 'Cash')
{{ $booking->status }}
@else
@if ($booking->status === 'Paid')
<span class="text-success">Cashless - Paid</span>
@elseif ($booking->status === 'Unpaid')
<span class="text-danger">Cashless - Unpaid</span>
@endif
@endif
</td>
<td>{{ $booking->date }}</td>
<td>
@if($booking->schedule)
{{ $booking->schedule->start_time }} - {{ $booking->schedule->end_time }}
@else
<span class="text-danger">Schedule Deleted</span>
@endif
</td>
<td>{{ $booking->category }} - {{ $booking->service_name }} ({{ number_format($booking->total, 0, '.', '.') }})</td>
<td>{{ $booking->name }}</td>
<td>{{ $booking->handphone }}</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.booking.view', $booking->id) }}" class="btn btn-sm btn-primary">
<i class="fa fa-eye"></i>
</a>
<form onclick="return alert('are you sure ? ')" class="d-inline" action="{{ route('admin.service.destroy', $service->id) }}" method="POST">
<form onclick="return confirm('Are you sure you want to delete this booking?');" action="{{ route('admin.booking.destroy', $booking->id) }}" method="POST">
@csrf
@method('delete')
<button class="btn btn-danger">
<i class="fa fa-trash"></i>
</button>
@method('DELETE')
<button class="btn btn-sm btn-danger" type="submit"><i class="fa fa-trash"></i></button>
</form>
</td> --}}
</tr>
@empty
<tr>
<td colspan="8" class="text-center">{{ __('Booking Data Empty') }}</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</td>
</tr>
@empty
<tr>
<td colspan="8" class="text-center">{{ __('Booking Data Empty') }}</td>
</tr>
@endforelse
</tbody>
</table>
<div class="card-footer">
{{ $bookings->links() }}
</div>
</div>
{{-- <div class="card-footer">
{{ $services->links() }}
</div> --}}
</div>
<!-- Content Row -->
</div>
</div>
@endsection

View File

@ -0,0 +1,65 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="content">
<div class="invoice-wrapper rounded border bg-white py-5 px-3 px-md-4 px-lg-5">
<div class="d-flex justify-content-between">
<h2 class="text-dark font-weight-medium">Booking Detail</h2>
<div class="btn-group">
<a href="{{ route('admin.booking.index') }}" class="btn btn-sm btn-warning">
Go Back</a>
</div>
</div>
<div class="row pt-5">
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Date</p>
<address>
{{ $booking->date }}
</address>
</div>
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Time</p>
<address>
{{ $booking->schedule ? $booking->schedule->start_time . ' - ' . $booking->schedule->end_time : 'No Schedule' }}
</address>
</div>
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Service</p>
<address>
{{ $booking->category }} - {{ $booking->service_name }}
</address>
</div>
</div>
<div class="row pt-5">
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Customer Name</p>
<address>
{{ $booking->name }}
</address>
</div>
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Contact</p>
<address>
{{ $booking->handphone }}
</address>
</div>
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Status</p>
<address>
{{ $booking->status }}
</address>
</div>
</div>
<div class="row justify-content-end">
<div class="col-lg-5 col-xl-4 col-xl-3 ml-sm-auto">
<ul class="list-unstyled mt-4">
{{-- You can add additional details here if needed --}}
</ul>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -27,22 +27,7 @@
@error('name')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
<div class="col-3">
<div class="form-group">
<label for="category_id">Parent</label>
<select name="category_id" id="category_id" class="form-control">
<option value="">---</option>
@forelse($parent_categories as $parent_category)
<option value="{{ $parent_category->id }}" {{ old('category_id') == $parent_category->id ? 'selected' : null }}>
{{ $parent_category->name }}
</option>
@empty
<option value="" disabled>No categories found</option>
@endforelse
</select>
@error('parent_id')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row pt-4">

View File

@ -28,22 +28,7 @@
@error('name')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
<div class="col-3">
<div class="form-group">
<label for="category_id">Parent</label>
<select name="category_id" id="category_id" class="form-control">
<option value="">---</option>
@forelse($parent_categories as $parent_category)
<option value="{{ $parent_category->id }}" {{ old('category_id', $category->category_id) == $parent_category->id ? 'selected' : null }}>
{{ $parent_category->name }}
</option>
@empty
<option value="" disabled>No categories found</option>
@endforelse
</select>
@error('parent_id')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row pt-4">

View File

@ -27,6 +27,16 @@
</div>
</div>
<div class="table-responsive">
<form action="{{ route('admin.categories.index') }}" method="GET" class="form-inline p-3">
<div class="input-group">
<input type="text" name="search" class="form-control" placeholder="Search categories..." value="{{ request('search') }}">
<div class="input-group-append">
<button class="btn btn-primary" type="submit">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</form>
<table class="table table-hover table-bordered">
<thead>
<tr>
@ -34,7 +44,7 @@
<th>Image</th>
<th>Name</th>
<th>Product count</th>
<th>Parent</th>
<th class="text-center" style="width: 30px;">Action</th>
</tr>
</thead>
@ -55,7 +65,7 @@
</a>
</td>
<td>{{ $category->products_count }}</td>
<td>{{ $category->parent->name ?? '' }}</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.categories.edit', $category) }}" class="btn btn-sm btn-primary">

View File

@ -18,14 +18,14 @@
<thead>
<tr>
<th>Name</th>
<th>Parent</th>
<th>Created at</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ $category->name }}</td>
<td>{{ $category->parent->name ?? '' }}</td>
<td>{{ $category->created_at }}</td>
</tr>
</tbody>

View File

@ -22,6 +22,14 @@
<div class="card">
<div class="card-body">
<div class="table-responsive">
<form action="{{ route('admin.obtained.index') }}" method="GET" class="mb-3">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search..." name="search" value="{{ request()->input('search') }}">
<div class="input-group-append">
<button class="btn btn-primary" type="submit">Search</button>
</div>
</div>
</form>
<table class="table table-bordered" cellspacing="0" width="100%">
<thead>
<tr>

View File

@ -16,6 +16,19 @@
{{ __('Orders') }}
</h6>
</div>
<div class="col-md-4 mb-3">
<form action="{{ route('admin.orders.index') }}" method="GET">
<div class="input-group">
<input type="text" name="search" class="form-control" placeholder="Search..." value="{{ request('search') }}">
<div class="input-group-append">
<button class="btn btn-primary" type="submit">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</form>
</div>
<div class="table-responsive">
<table class="table table-hover table-bordered">
<thead>
@ -44,8 +57,11 @@
</td>
<td>{{ $order->customer_phone }}</td>
<td>
{{ $order->payment_status === 'cash' ? $order->payment_status : 'cashless(' . $order->payment_status . ')' }}
{{ $order->payment_status === 'unpaid' ? $order->payment_status : '' . $order->payment_status . '' }}
</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.orders.show', $order) }}" class="btn btn-sm btn-primary">

View File

@ -7,44 +7,39 @@
<div class="d-flex justify-content-between">
<h2 class="text-dark font-weight-medium">Order ID #{{ $order->code }}</h2>
<div class="btn-group">
<a href="{{ route('admin.orders.index') }}" class="btn btn-sm btn-warning">
Go Back</a>
<a href="{{ route('admin.orders.index') }}" class="btn btn-sm btn-warning">Go Back</a>
</div>
</div>
<div class="row pt-5">
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Billing Address</p>
<address>
{{ $order->customer_first_name }} {{ $order->customer_last_name }}
Name: {{ $order->customer_first_name }} {{ $order->customer_last_name }}
<br> {{ $order->customer_address1 }}
<br> {{ $order->customer_address2 }}
<br> Email: {{ $order->customer_email }}
<br> {{ $order->customer_email }}
<br> Phone: {{ $order->customer_phone }}
<br> Postcode: {{ $order->customer_postcode }}
</address>
</div>
{{-- <div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Shipment Address</p>
<address>
{{ $order->shipment->first_name }} {{ $order->shipment->last_name }}
<br> {{ $order->shipment->address1 }}
<br> {{ $order->shipment->address2 }}
<br> Email: {{ $order->shipment->email }}
<br> Phone: {{ $order->shipment->phone }}
<br> Postcode: {{ $order->shipment->postcode }}
</address>
</div> --}}
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Details</p>
<address>
ID: <span class="text-dark">#{{ $order->code }}</span>
<br> DATE: <span>{{ $order->order_date }}</span>
<br>
NOTE: <span>{{ $order->note }}</span>
<br> NOTE: <span>{{ $order->note }}</span>
<br> Status: {{ $order->status }} {{ $order->cancelled_at }}
<br> Cancellation Note : {{ $order->cancellation_note}}
<br> Payment Status: {{ $order->payment_status }}
<br> Shipped by: {{ $order->shipping_service_name }}
@if ($order->payment_status === 'unpaid')
<form action="{{ route('admin.orders.markAsPaid', $order) }}" method="POST" class="d-inline-block">
@csrf
<input type="hidden" name="total_paid" id="hidden-total-paid">
<input type="hidden" name="change_amount" id="hidden-change-amount">
</form>
@else
<p>Uang Pembeli: Rp.{{ number_format(session('total_paid'), 0, '.', '.') }}</p>
<p>Kembalian: Rp.{{ number_format($order->change_amount, 0, '.', '.') }}</p>
@endif
</address>
</div>
</div>
@ -77,46 +72,35 @@
<div class="row justify-content-end">
<div class="col-lg-5 col-xl-4 col-xl-3 ml-sm-auto">
<ul class="list-unstyled mt-4">
<li class="mid pb-3 text-dark">Subtotal
<span class="d-inline-block float-right text-default">{{ $order->base_total_price }}</span>
<li class="mid pb-3 text-dark">Total Order
<span class="d-inline-block float-right text-default">{{ number_format($order->base_total_price, 0, '.', '.') }}</span>
</li>
{{-- <li class="mid pb-3 text-dark">Tax(10%)
<span class="d-inline-block float-right text-default">{{ $order->tax_amount }}</span>
@if ($order->payment_status === 'unpaid')
<li class="mid pb-3 text-dark">
<form action="{{ route('admin.orders.savePayment', $order) }}" method="POST" class="d-inline-block">
@csrf
<label for="total-paid">Uang Pembeli :</label>
<input type="number" id="total-paid" name="total_paid" class="form-control" required>
<button class="btn btn-sm btn-success mt-2" type="submit">Simpan Pembayaran</button>
</form>
</li>
<li class="mid pb-3 text-dark">Shipping Cost
<span class="d-inline-block float-right text-default">{{ $order->shipping_cost }}</span>
@endif
<li class="mid pb-3 text-dark">Kembalian
<span class="d-inline-block float-right text-default" id="change-amount">{{ number_format($order->change_amount, 0, '.', '.') }}</span>
</li>
<li class="pb-3 text-dark">Total
<span class="d-inline-block float-right">{{ $order->grand_total }}</span>
</li> --}}
</ul>
{{-- @if ($order->isPaid() && $order->isConfirmed())
<a href="{{ route('admin.shipments.edit', $order->shipment->id) }}" class="btn btn-block mt-2 btn-lg btn-primary btn-pill"> Procced to Shipment</a>
@endif
@if (in_array($order->status, [\App\Models\Order::CREATED, \App\Models\Order::CONFIRMED]))
<a href="{{ route('admin.orders.cancel', $order->id) }}" class="btn btn-block mt-2 btn-lg btn-warning btn-pill"> Cancel</a>
@endif
@if ($order->isDelivered())
<form action="{{ route('admin.orders.complete', $order->id) }}" method="post" >
@csrf
<button class="btn btn-block mt-2 btn-lg btn-success btn-pill"> Mark as Completed</button>
</form>
@endif --}}
{{-- @if (!in_array($order->status, [\App\Models\Order::DELIVERED, \App\Models\Order::COMPLETED]))
<a href="" class="btn btn-block mt-2 btn-lg btn-secondary btn-pill delete" onclick="event.preventDefault();document.getElementById('delete-form-{{$order->id}}').submit();"> Remove</a>
<form action="{{ route('admin.orders.destroy', $order) }} }}" method="post" id="delete-form-{{$order->id}}" class="d-none">
@csrf
@method('delete')
</form>
@endif --}}
</div>
</div>
</div>
</div>
</div>
<script>
document.getElementById('total-paid').addEventListener('input', function() {
var totalPaid = parseFloat(this.value) || 0;
var totalOrder = {{ $order->base_total_price }};
var change = totalPaid - totalOrder;
document.getElementById('change-amount').textContent = 'Rp.' + new Intl.NumberFormat('id-ID').format(change);
});
</script>
@endsection

View File

@ -100,15 +100,7 @@
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group">
<label for="details" class="text-small text-uppercase">{{ __('details') }}</label>
<textarea name="details" rows="3" class="form-control summernote">{!! old('details') !!}</textarea>
@error('details')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<label for="images">{{ __('images') }}</label>

View File

@ -98,15 +98,7 @@
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group">
<label for="details" class="text-small text-uppercase">{{ __('details') }}</label>
<textarea name="details" rows="3" class="form-control summernote">{!! old('details', $product->details) !!}</textarea>
@error('details')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<label for="images">{{ __('images') }}</label>

View File

@ -11,89 +11,99 @@
</div>
@endif
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex">
<h6 class="m-0 font-weight-bold text-primary">
{{ __('Products') }}
</h6>
<div class="ml-auto">
@can('product_create')
<a href="{{ route('admin.products.create') }}" class="btn btn-primary">
<span class="icon text-white-50">
<i class="fa fa-plus"></i>
</span>
<span class="text">{{ __('New product') }}</span>
</a>
@endcan
</div>
</div>
<div class="table-responsive">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>No</th>
<th>Image</th>
<th>Name</th>
<th>Quantity</th>
<th>Price</th>
<th>Weight</th>
<th>Tags</th>
<th>Category</th>
<th>Status</th>
<th class="text-center" style="width: 30px;">Action</th>
</tr>
</thead>
<tbody>
@forelse($products as $product)
<tr>
<td>{{ $loop->iteration }}</td>
<td>
@if($product->firstMedia)
<img src="{{ asset('storage/images/products/' . $product->firstMedia->file_name) }}"
width="60" height="60" alt="{{ $product->name }}">
@else
<span class="badge badge-danger">no image</span>
@endif
</td>
<td><a href="{{ route('admin.products.show', $product->id) }}">{{ $product->name }}</a></td>
<td>{{ $product->quantity }}</td>
<td>Rp.{{ number_format($product->price) }}</td>
<td>{{ $product->weight }} (gram)</td>
<td>
<span class="badge badge-info">{{ $product->tags->pluck('name')->join(', ') }}</span>
</td>
<td>{{ $product->category ? $product->category->name : NULL }}</td>
<td>{{ $product->status }}</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.products.edit', $product) }}" class="btn btn-sm btn-primary">
<i class="fa fa-edit"></i>
</a>
<form onclick="return confirm('are you sure !')" action="{{ route('admin.products.destroy', $product) }}"
method="POST">
@csrf
@method('DELETE')
<button class="btn btn-sm btn-danger" type="submit"><i class="fa fa-trash"></i></button>
</form>
</div>
</td>
</tr>
@empty
<tr>
<td class="text-center" colspan="12">No products found.</td>
</tr>
@endforelse
</tbody>
<tfoot>
<tr>
<td colspan="12">
<div class="float-right">
{!! $products->appends(request()->all())->links() !!}
</div>
</td>
</tr>
</tfoot>
</table>
<div class="card-header py-3 d-flex align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">
{{ __('Data Produk') }} <!-- Judul Data Produk -->
</h6>
<div class="d-flex">
<form action="{{ route('admin.products.index') }}" method="GET" class="form-inline mr-2">
<div class="input-group">
<input type="text" name="search" class="form-control" placeholder="Search products..." value="{{ request('search') }}">
<div class="input-group-append">
<button class="btn btn-primary" type="submit">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</form>
@can('product_create')
<a href="{{ route('admin.products.create') }}" class="btn btn-primary">
<span class="icon text-white-50">
<i class="fa fa-plus"></i>
</span>
<span class="text">{{ __('New product') }}</span>
</a>
@endcan
</div>
</div>
<div class="table-responsive">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>No</th>
<th>Image</th>
<th>Name</th>
<th>Quantity</th>
<th>Price</th>
<th>Weight</th>
<th>Tags</th>
<th>Category</th>
<th>Status</th>
<th class="text-center" style="width: 30px;">Action</th>
</tr>
</thead>
<tbody>
@forelse($products as $product)
<tr>
<td>{{ $loop->iteration }}</td>
<td>
@if($product->firstMedia)
<img src="{{ asset('storage/images/products/' . $product->firstMedia->file_name) }}"
width="60" height="60" alt="{{ $product->name }}">
@else
<span class="badge badge-danger">no image</span>
@endif
</td>
<td><a href="{{ route('admin.products.show', $product->id) }}">{{ $product->name }}</a></td>
<td>{{ $product->quantity }}</td>
<td>Rp.{{ number_format($product->price) }}</td>
<td>{{ $product->weight }} (gram)</td>
<td>
<span class="badge badge-info">{{ $product->tags->pluck('name')->join(', ') }}</span>
</td>
<td>{{ $product->category ? $product->category->name : NULL }}</td>
<td>{{ $product->status }}</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.products.edit', $product) }}" class="btn btn-sm btn-primary">
<i class="fa fa-edit"></i>
</a>
<form onclick="return confirm('are you sure !')" action="{{ route('admin.products.destroy', $product) }}"
method="POST">
@csrf
@method('DELETE')
<button class="btn btn-sm btn-danger" type="submit"><i class="fa fa-trash"></i></button>
</form>
</div>
</td>
</tr>
@empty
<tr>
<td class="text-center" colspan="12">No products found.</td>
</tr>
@endforelse
</tbody>
<tfoot>
<tr>
<td colspan="12">
<div class="float-right">
{!! $products->appends(request()->all())->links() !!}
</div>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,113 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="content">
<div class="row">
<div class="col-lg-12">
<div class="card card-default">
<div class="card-header card-header-border-bottom">
<h2>Revenue Report</h2>
</div>
<div class="card-body">
<form id="printForm" action="{{ route('admin.reports.download') }}" method="POST" class="mb-5">
@csrf
<div class="row">
<div class="col-lg-3">
<div class="form-group mb-2">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('start') }}" name="start" placeholder="from">
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('end') }}" name="end" placeholder="to">
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<input type="hidden" name="export" value="xlsx">
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<button type="submit" class="btn btn-primary btn-default"><i class="fas fa-download"></i> Download</button>
</div>
</div>
</div>
</form>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Date</th>
<th>User</th>
<th>Service</th>
<th>Price</th>
</tr>
</thead>
<tbody>
@foreach($bookings as $record)
@if(isset($record->service_name))
<tr>
<td>{{ $record->created_at }}</td>
<td>{{ $record->name }}</td>
<td>{{ $record->category }} - {{ $record->service_name }}</td>
<td>{{ number_format($record->total, 0, '.', '.') }}</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
<!-- Summary of total revenue per service -->
<div class="mt-5">
<h4>Total Revenue per Service</h4>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Service</th>
<th>Total Revenue</th>
</tr>
</thead>
<tbody>
@php
$totalRevenuePerService = [];
foreach($bookings as $record) {
if(isset($record->service_name)) {
if(!isset($totalRevenuePerService[$record->service_name])) {
$totalRevenuePerService[$record->service_name] = 0;
}
$totalRevenuePerService[$record->service_name] += $record->total;
}
}
@endphp
@foreach($totalRevenuePerService as $service => $total)
<tr>
<td>{{ $service }}</td>
<td>{{ number_format($total, 0, '.', '.') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('script-alt')
<script src="{{ asset('backend/plugins/bootstrap-datepicker.min.js') }}"></script>
<script>
$('.datepicker').datepicker({
format: 'yyyy-mm-dd'
});
</script>
@endpush

View File

@ -1,44 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Revenue Report Excel</title>
</head>
<body>
<h2>Revenue Report</h2>
<hr>
<p>Period: {{ $startDate }} - {{ $endDate }}</p>
<table>
<thead>
<tr>
<th>Date</th>
<th>User</th>
<th>Activity</th>
<th>Price</th>
</tr>
</thead>
<tbody>
@foreach($data as $record)
<tr>
<td>{{ $record->created_at }}</td>
<td>{{ $record->name }}</td>
<td>
@if(isset($record->service_name))
Booking: {{ $record->service_name }}
@elseif(isset($record->code))
Order: {{ $record->code }}
@endif
</td>
<td>
@if(isset($record->service_name))
{{ $record->total }}
@elseif(isset($record->code))
{{ $record->grand_total }}
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</html>

View File

@ -1,48 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Revenue Report PDF</title>
<style>
/* CSS styling for PDF */
/* Add your styling here */
</style>
</head>
<body>
<h2>Revenue Report</h2>
<hr>
<p>Period: {{ $startDate }} - {{ $endDate }}</p>
<table>
<thead>
<tr>
<th>Date</th>
<th>User</th>
<th>Activity</th>
<th>Price</th>
</tr>
</thead>
<tbody>
@foreach($data as $record)
<tr>
<td>{{ $record->created_at }}</td>
<td>{{ $record->name }}</td>
<td>
@if(isset($record->service_name))
Booking: {{ $record->service_name }}
@elseif(isset($record->code))
Order: {{ $record->code }}
@endif
</td>
<td>
@if(isset($record->service_name))
{{ $record->total }}
@elseif(isset($record->code))
{{ $record->grand_total }}
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</html>

View File

@ -0,0 +1,131 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="content">
<div class="row">
<div class="col-lg-12">
<div class="card card-default">
<div class="card-header card-header-border-bottom">
<h2>Revenue Report</h2>
</div>
<div class="card-body">
<form action="{{ route('admin.reports.print') }}" method="POST" class="mb-5">
@csrf
<div class="row">
<div class="col-lg-3">
<div class="form-group mb-2">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('start') }}" name="start" placeholder="From">
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('end') }}" name="end" placeholder="To">
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<input type="hidden" name="export" value="xlsx"> <!-- Only export to Excel -->
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<button type="submit" class="btn btn-primary btn-default"><i class="fas fa-print"></i> Print</button>
</div>
</div>
</div>
</form>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>User</th>
<th>Order Code</th>
<th>Quantity</th>
<th>Price</th>
</tr>
</thead>
<tbody>
@php
$totalQuantity = 0;
$totalPrice = 0;
@endphp
@foreach($orders as $order)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $order->created_at }}</td>
<td>{{ $order->customer_first_name }}<br/>{{ $order->customer_email }}</td>
<td>{{ $order->code }}</td>
<td>{{ $order->qty }}</td>
<td>Rp. {{ number_format($order->base_total_price, 0, '.', '.') }}</td>
</tr>
@php
$totalQuantity += $order->qty;
$totalPrice += $order->base_total_price;
@endphp
@endforeach
</tbody>
<tfoot>
<tr>
<th colspan="4">Total Quantity</th>
<th>{{ $totalQuantity }}</th>
<th>Rp. {{ number_format($totalPrice, 0, '.', '.') }}</th>
</tr>
</tfoot>
</table>
</div>
<!-- Summary of total revenue per service -->
<div class="mt-5">
<h4>Total Revenue per Service</h4>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Service</th>
<th>Total Revenue</th>
</tr>
</thead>
<tbody>
@php
$totalRevenuePerService = [];
foreach($orders as $order) {
if(isset($order->service_name)) {
if(!isset($totalRevenuePerService[$order->service_name])) {
$totalRevenuePerService[$order->service_name] = 0;
}
$totalRevenuePerService[$order->service_name] += $order->grand_total;
}
}
@endphp
@foreach($totalRevenuePerService as $service => $total)
<tr>
<td>{{ $service }}</td>
<td>Rp.{{ number_format($total, 0, '.', '.') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('script-alt')
<script src="{{ asset('backend/plugins/bootstrap-datepicker.min.js') }}"></script>
<script>
$('.datepicker').datepicker({
format: 'yyyy-mm-dd'
});
</script>
@endpush

View File

@ -0,0 +1,73 @@
<!-- print.blade.php -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Print Revenue Report</title>
<style>
/* Define your print styles here */
body {
font-family: Arial, sans-serif;
}
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<h2>Revenue Report</h2>
<table>
<thead>
<tr>
<th>Date</th>
<th>User</th>
<th>Service</th>
<th>Price</th>
</tr>
</thead>
<tbody>
@foreach($bookings as $record)
@if(isset($record->service_name))
<tr>
<td>{{ $record->created_at }}</td>
<td>{{ $record->name }}</td>
<td>{{ $record->category }} - {{ $record->service_name }}</td>
<td>{{ number_format($record->total, 0, '.', '.') }}</td>
</tr>
@endif
@endforeach
</tbody>
</table>
<h4>Total Revenue per Service</h4>
<table>
<thead>
<tr>
<th>Service</th>
<th>Total Revenue</th>
</tr>
</thead>
<tbody>
@foreach($totalRevenuePerService as $service => $total)
<tr>
<td>{{ $service }}</td>
<td>{{ number_format($total, 0, '.', '.') }}</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</html>

View File

@ -7,33 +7,38 @@
<div class="col-lg-12">
<div class="card card-default">
<div class="card-header card-header-border-bottom">
<h2>Revenue Report</h2>
<h2>Data Laporan</h2>
</div>
<div class="card-body">
<form action="{{ route('admin.reports.export') }}" method="POST" class="mb-5">
<form id="printForm" action="{{ route('admin.reports.download') }}" method="POST" class="mb-5">
@csrf
<div class="row">
<div class="col-lg-3">
<div class="form-group mb-2">
<input type="text" class="form-control datepicker" readonly="" value="{{ !empty(request()->input('start')) ? request()->input('start') : '' }}" name="start" placeholder="from">
<div class="input-group">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('start') }}" name="start" placeholder="From">
<div class="input-group-append">
<span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<input type="text" class="form-control datepicker" readonly="" value="{{ !empty(request()->input('end')) ? request()->input('end') : '' }}" name="end" placeholder="to">
<div class="input-group">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('end') }}" name="end" placeholder="To">
<div class="input-group-append">
<span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="col-lg-6 d-flex align-items-end">
<div class="form-group mx-sm-3 mb-2">
<select name="export" class="form-control">
<option value="xlsx">excel</option>
<option value="pdf">pdf</option>
</select>
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<button type="submit" class="btn btn-primary btn-default">Go</button>
<input type="hidden" name="export" value="xlsx">
<button type="submit" class="btn btn-primary btn-default">
<i class="fas fa-print"></i> Cetak
</button>
</div>
</div>
</div>
@ -45,34 +50,25 @@
<tr>
<th>Date</th>
<th>User</th>
<th>Activity</th>
<th>Price</th>
<th>Service</th>
<th class="text-right">Price</th>
</tr>
</thead>
<tbody>
@foreach($data as $record)
@foreach($bookings as $record)
@if(isset($record->service_name))
<tr>
<td>{{ $record->created_at }}</td>
<td>{{ $record->name }}</td>
<td>
@if(isset($record->service_name))
Booking: {{ $record->service_name }}
@elseif(isset($record->code))
Order: {{ $record->code }}
@endif
</td>
<td>
@if(isset($record->service_name))
{{ $record->total }} <!-- Menampilkan harga booking -->
@elseif(isset($record->code))
{{ $record->grand_total }} <!-- Menampilkan harga order -->
@endif
</td>
<td>{{ $record->category }} - {{ $record->service_name }}</td>
<td class="text-right">{{ number_format($record->total, 0, '.', '.') }}</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,53 @@
<!-- resources/views/admin/reports/total-revenue.blade.php -->
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="content">
<div class="row">
<div class="col-lg-12">
<div class="card card-default">
<div class="card-header card-header-border-bottom">
<h2>Data Rekap</h2>
</div>
<div class="card-body">
<!-- Summary of total revenue per service -->
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Service</th>
<th>Total Revenue</th>
</tr>
</thead>
<tbody>
@php
$totalRevenuePerService = [];
foreach($bookings as $record) {
if(isset($record->service_name)) {
if(!isset($totalRevenuePerService[$record->service_name])) {
$totalRevenuePerService[$record->service_name] = 0;
}
$totalRevenuePerService[$record->service_name] += $record->total;
}
}
@endphp
@foreach($totalRevenuePerService as $service => $total)
<tr>
<td>{{ $service }}</td>
<td>{{ number_format($total, 0, '.', '.') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,88 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="content">
<div class="row">
<div class="col-lg-12">
<div class="card card-default">
<div class="card-header card-header-border-bottom">
<h2>Revenue Report</h2>
</div>
<div class="card-body">
<form id="printForm" action="{{ route('admin.reports.view') }}" method="POST" class="mb-5">
@csrf
<div class="row">
<div class="col-lg-3">
<div class="form-group mb-2">
<div class="input-group">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('start') }}" name="start" placeholder="From">
<div class="input-group-append">
<span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<div class="input-group">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('end') }}" name="end" placeholder="To">
<div class="input-group-append">
<span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<div class="input-group">
<button type="submit" class="btn btn-primary btn-default ml-2">
<i class="fas fa-print"></i> Lihat
</button>
</div>
</div>
</div>
</div>
</form>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Date</th>
<th>User</th>
<th>Service</th>
<th>Price</th>
</tr>
</thead>
<tbody>
@foreach($bookings as $record)
@if(isset($record->service_name))
<tr>
<td>{{ $record->created_at }}</td>
<td>{{ $record->name }}</td>
<td>{{ $record->category }} - {{ $record->service_name }}</td>
<td>{{ number_format($record->total, 0, '.', '.') }}</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('script-alt')
<script src="{{ asset('backend/plugins/bootstrap-datepicker.min.js') }}"></script>
<script>
$('.datepicker').datepicker({
format: 'yyyy-mm-dd'
});
</script>
@endpush

View File

@ -21,6 +21,14 @@
<!-- Content Row -->
<div class="card">
<div class="card-body">
<form action="{{ route('admin.category.index') }}" method="GET" class="mb-3">
<div class="input-group">
<input type="text" class="form-control" name="search" placeholder="Search by category name..." value="{{ request('search') }}">
<div class="input-group-append">
<button class="btn btn-primary" type="submit"><i class="fas fa-search"></i></button>
</div>
</div>
</form>
<div class="table-responsive">
<table class="table table-bordered" cellspacing="0" width="100%">
<thead>

View File

@ -22,6 +22,14 @@
<div class="card">
<div class="card-body">
<div class="table-responsive">
<form action="{{ route('admin.service.index') }}" method="GET" class="mb-3">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search..." name="search" value="{{ request()->input('search') }}">
<div class="input-group-append">
<button class="btn btn-primary" type="submit">Search</button>
</div>
</div>
</form>
<table class="table table-bordered" cellspacing="0" width="100%">
<thead>
<tr>

View File

@ -1,164 +0,0 @@
@extends('layouts.admin')
@section('content')
<div class="content">
<div class="row">
<div class="col-lg-6">
<div class="card card-default">
<div class="card-header card-header-border-bottom">
<h2>Order Shipment #{{ $shipment->order->code }}</h2>
</div>
<div class="card-body">
<form action="{{ url('admin/shipments', $shipment->id) }}" method="post">
@csrf
@method('put')
<div class="form-group row">
<div class="col-md-6">
<label for="first_name">First Name</label>
<input type="text" name="first_name" value="{{ $shipment->first_name }}" class="form-control" readonly>
</div>
<div class="col-md-6">
<label for="last_name">Last Name</label>
<input type="text" name="last_name" value="{{ $shipment->last_name }}" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label for="address1">Address 1</label>
<input type="text" name="address1" value="{{ $shipment->address1 }}" class="form-control" readonly>
</div>
<div class="form-group">
<label for="address2">Address 2</label>
<input type="text" name="address2" value="{{ $shipment->address2 }}" class="form-control" readonly>
</div>
<div class="form-group">
<label>Province<span class="required">*</span></label>
<select name="province_id" class="form-control" disabled>
<option value="">- Please Select -</option>
@foreach($provinces as $province => $pro)
<option {{ $shipment->province_id == $province ? 'selected' : null }} value="{{ $province }}">{{ $pro }}</option>
@endforeach
</select>
</div>
<div class="form-group row">
<div class="col-md-6">
<label>City<span class="required">*</span></label>
<select name="city_id" class="form-control" disabled>
@foreach($cities as $city => $ty)
<option {{ $shipment->city_id == $city ? 'selected' : null }} value="{{ $city }}">{{ $ty }}</option>
@endforeach
</select>
</div>
<div class="col-md-6">
<label for="postcode">Postcode</label>
<input type="text" name="postcode" value="{{ $shipment->postcode }}" class="form-control" readonly>
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<label for="phone">Phone</label>
<input type="text" name="phone" value="{{ $shipment->phone }}" class="form-control" readonly>
</div>
<div class="col-md-6">
<label for="email">Email</label>
<input type="email" name="email" value="{{ $shipment->email }}" class="form-control" readonly>
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<label for="qty">Total Qty</label>
<input type="number" name="qty" value="{{ $shipment->total_qty }}" class="form-control" readonly>
</div>
<div class="col-md-6">
<label for="total_weight">Total Weight</label>
<input type="text" name="total_weight" value="{{ $shipment->total_weight }}" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label for="track_number">Track Number</label>
<input type="text" name="track_number" value="{{ $shipment->track_number }}" class="form-control" >
</div>
<div class="form-footer pt-5 border-top">
<button type="submit" class="btn btn-primary btn-default">Save</button>
<a href="{{ url('admin/orders/'. $shipment->order->id) }}" class="btn btn-secondary btn-default">Back</a>
</div>
</form>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="card card-default">
<div class="card-header card-header-border-bottom">
<h2>Detail Order</h2>
</div>
<div class="card-body">
<div class="row">
<div class="col-xl-6 col-lg-6">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Billing Address</p>
<address>
{{ $shipment->order->customer_company }} {{ $shipment->order->customer_last_name }}
<br> {{ $shipment->order->customer_address1 }}
<br> {{ $shipment->order->customer_address2 }}
<br> Email: {{ $shipment->order->customer_email }}
<br> Phone: {{ $shipment->order->customer_phone }}
<br> Postcode: {{ $shipment->order->customer_postcode }}
</address>
</div>
<div class="col-xl-6 col-lg-6">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Details</p>
<address>
ID: <span class="text-dark">#{{ $shipment->order->code }}</span>
<br> {{ $shipment->order->order_date }}
<br> Status: {{ $shipment->order->status }}
<br> Payment Status: {{ $shipment->order->payment_status }}
<br> Shipped by: {{ $shipment->order->shipping_service_name }}
</address>
</div>
</div>
<table class="table mt-3 table-striped table-responsive table-responsive-large" style="width:100%">
<thead>
<tr>
<th>#</th>
<th>Item</th>
<th>Qty</th>
<th>Total</th>
</tr>
</thead>
<tbody>
@forelse ($shipment->order->orderItems as $item)
<tr>
<td>{{ $item->sku }}</td>
<td>{{ $item->name }}</td>
<td>{{ $item->qty }}</td>
<td>{{ $item->sub_total }}</td>
</tr>
@empty
<tr>
<td colspan="6">Order item not found!</td>
</tr>
@endforelse
</tbody>
</table>
<div class="row justify-content-center">
<div class="col-lg-8 col-xl-8 col-xl-8">
<ul class="list-unstyled mt-4">
<li class="mid pb-3 text-dark">Subtotal
<span class="d-inline-block float-right text-default">{{ $shipment->order->base_total_price }}</span>
</li>
<li class="mid pb-3 text-dark">Tax(10%)
<span class="d-inline-block float-right text-default">{{ $shipment->order->tax_amount }}</span>
</li>
<li class="mid pb-3 text-dark">Shipping Cost
<span class="d-inline-block float-right text-default">{{ $shipment->order->shipping_cost }}</span>
</li>
<li class="pb-3 text-dark">Total
<span class="d-inline-block float-right">{{ $shipment->order->grand_total }}</span>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -1,68 +0,0 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex">
<h6 class="m-0 font-weight-bold text-primary">
{{ __('Shipments') }}
</h6>
</div>
<div class="table-responsive">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>No</th>
<th>Order ID</th>
<th>Name</th>
<th>Status</th>
<th>Total Qty</th>
<th>Total Weight (gram)</th>
<th class="text-center" style="width: 30px;">Action</th>
</tr>
</thead>
<tbody>
@forelse($shipments as $shipment)
<tr>
<td>{{ $loop->iteration }}</td>
<td>
{{ $shipment->order->code }}<br>
<span class="badge badge-info" style="font-size: 12px; font-weight: normal"> {{ $shipment->order->order_date }}</span>
</td>
<td>{{ $shipment->order->customer_full_name }}</td>
<td>
{{ $shipment->status }}
<br>
<span class="badge badge-info" style="font-size: 12px; font-weight: normal"> {{ $shipment->shipped_at }}</span>
</td>
<td>{{ $shipment->total_qty }}</td>
<td>{{ $shipment->total_weight }}</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.orders.show', $shipment->order->id) }}" class="btn btn-sm btn-primary">
<i class="fa fa-eye"></i>
</a>
</div>
</td>
</tr>
@empty
<tr>
<td class="text-center" colspan="12">No products found.</td>
</tr>
@endforelse
</tbody>
<tfoot>
<tr>
<td colspan="12">
<div class="float-right">
{!! $shipments->appends(request()->all())->links() !!}
</div>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
@endsection

View File

@ -1,98 +0,0 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex">
<h6 class="m-0 font-weight-bold text-primary">
{{ __('Create slide') }}
</h6>
<div class="ml-auto">
<a href="{{ route('admin.slides.index') }}" class="btn btn-primary">
<span class="icon text-white-50">
<i class="fa fa-home"></i>
</span>
<span class="text">{{ __('Back to slides') }}</span>
</a>
</div>
</div>
<div class="card-body">
<form action="{{ route('admin.slides.store') }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="row">
<div class="col-6">
<div class="form-group">
<label for="title">title</label>
<input class="form-control" id="title" type="text" name="title" value="{{ old('title') }}">
@error('title')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
<div class="col-6">
<div class="form-group">
<label for="url">url</label>
<input class="form-control" id="url" type="text" name="url" value="{{ old('url') }}">
@error('url')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group">
<label for="body" class="text-small text-uppercase">{{ __('body') }}</label>
<textarea name="body" rows="3" class="form-control summernote">{!! old('body') !!}</textarea>
@error('body')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row pt-4">
<div class="col-12">
<label for="cover">Cover image</label>
<br>
<div class="file-loading">
<input type="file" name="cover" id="slide-img" class="file-input-overview">
<span class="form-text text-muted">Image width should be 500px x 500px</span>
</div>
@error('cover')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
<div class="form-group pt-4">
<button class="btn btn-primary" type="submit" name="submit">{{ __('Save') }}</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@push('script-alt')
<script>
$(function () {
// summernote
$('.summernote').summernote({
tabSize: 2,
height: 200,
toolbar: [
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['table', ['table']],
['insert', ['link', 'picture', 'video']],
['view', ['fullscreen', 'codeview', 'help']]
]
})
// file input
$("#slide-img").fileinput({
theme: "fas",
maxFileCount: 1,
allowedFileTypes: ['image'],
showCancel: true,
showRemove: false,
showUpload: false,
overwriteInitial: false
});
});
</script>
@endpush

View File

@ -1,107 +0,0 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex">
<h6 class="m-0 font-weight-bold text-primary">
{{ __('Edit slide')}}
</h6>
<div class="ml-auto">
<a href="{{ route('admin.tags.index') }}" class="btn btn-primary">
<span class="icon text-white-50">
<i class="fa fa-home"></i>
</span>
<span class="text">{{ __('Back to slides') }}</span>
</a>
</div>
</div>
<div class="card-body">
<form action="{{ route('admin.slides.update', $slide) }}" method="POST" enctype="multipart/form-data">
@csrf
@method('put')
<div class="row">
<div class="col-6">
<div class="form-group">
<label for="title">title</label>
<input class="form-control" id="title" type="text" name="title" value="{{ old('title', $slide->title) }}">
@error('title')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
<div class="col-6">
<div class="form-group">
<label for="url">url</label>
<input class="form-control" id="url" type="text" name="url" value="{{ old('url', $slide->url) }}">
@error('url')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group">
<label for="body" class="text-small text-uppercase">{{ __('body') }}</label>
<textarea name="body" rows="3" class="form-control summernote">{!! old('body', $slide->body) !!}</textarea>
@error('body')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row pt-4">
<div class="col-12">
<label for="cover">Cover image</label><br>
@if($slide->cover)
<img
class="mb-2"
src="{{ Storage::url('images/slides/' . $slide->cover) }}"
alt="{{ $slide->name }}" width="100" height="100">
@else
<span class="badge badge-info">No image</span>
@endif
<br>
<div class="file-loading">
<input type="file" name="cover" id="slide-img" class="file-input-overview">
<span class="form-text text-muted">Image width should be 500px x 500px</span>
</div>
@error('cover')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
<div class="form-group pt-4">
<button class="btn btn-primary" type="submit" name="submit">{{ __('Save') }}</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@push('script-alt')
<script>
$(function () {
// summernote
$('.summernote').summernote({
tabSize: 2,
height: 200,
toolbar: [
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['table', ['table']],
['insert', ['link', 'picture', 'video']],
['view', ['fullscreen', 'codeview', 'help']]
]
})
// file input
$("#slide-img").fileinput({
theme: "fas",
maxFileCount: 1,
allowedFileTypes: ['image'],
showCancel: true,
showRemove: false,
showUpload: false,
overwriteInitial: false
});
});
</script>
@endpush

View File

@ -1,92 +0,0 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex">
<h6 class="m-0 font-weight-bold text-primary">
{{ __('Slides') }}
</h6>
<div class="ml-auto">
@can('slide_create')
<a href="{{ route('admin.slides.create') }}" class="btn btn-primary">
<span class="icon text-white-50">
<i class="fa fa-plus"></i>
</span>
<span class="text">{{ __('New slide') }}</span>
</a>
@endcan
</div>
</div>
<div class="table-responsive">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>No</th>
<th>Title</th>
<th>Image</th>
<th>Position</th>
<th>Set Position</th>
<th class="text-center" style="width: 30px;">Action</th>
</tr>
</thead>
<tbody>
@forelse($slides as $slide)
<tr>
<td>{{ $loop->iteration }}</td>
<td>
<a href="{{ route('admin.slides.show', $slide) }}">
{{ $slide->title }}
</a>
</td>
<td>
<img width="60" src="{{ Storage::url('images/slides/'. $slide->cover) }}" alt="">
</td>
<td>{{ $slide->position }}</td>
<td>
@if ($slide->prevSlide())
<a href="{{ url('admin/slides/'. $slide->id .'/up') }}">up</a>
@else
up
@endif
|
@if ($slide->nextSlide())
<a href="{{ url('admin/slides/'. $slide->id .'/down') }}">down</a>
@else
down
@endif
</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.slides.edit', $slide) }}" class="btn btn-sm btn-primary">
<i class="fa fa-edit"></i>
</a>
<form onclick="return confirm('are you sure !')" action="{{ route('admin.slides.destroy', $slide) }}"
method="POST">
@csrf
@method('DELETE')
<button class="btn btn-sm btn-danger" type="submit"><i class="fa fa-trash"></i></button>
</form>
</div>
</td>
</tr>
@empty
<tr>
<td class="text-center" colspan="6">No tags found.</td>
</tr>
@endforelse
</tbody>
<tfoot>
<tr>
<td colspan="6">
<div class="float-right">
{!! $slides->appends(request()->all())->links() !!}
</div>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
@endsection

View File

@ -1,38 +0,0 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex">
<h6 class="m-0 font-weight-bold text-primary">
{{ $slide->title }}
</h6>
<div class="ml-auto">
<a href="{{ route('admin.slides.index') }}" class="btn btn-primary">
<span class="text">Back to slides</span>
</a>
</div>
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Title</th>
<th>Url</th>
<th>Body</th>
<th>Created at</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ $slide->title }}</td>
<td>{{ $slide->url }}</td>
<td>{{ $slide->body }}</td>
<td>{{ $slide->created_at }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@endsection

View File

@ -11,11 +11,12 @@
</div>
@endif
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex">
<h6 class="m-0 font-weight-bold text-primary">
{{ __('Tags') }}
</h6>
<div class="ml-auto">
<div class="card-header py-3 d-flex justify-content-between align-items-center">
<h6 class="m-0 font-weight-bold text-primary">
{{ __('Tags') }}
</h6>
<div class="d-flex">
<div class="mr-2">
@can('tag_create')
<a href="{{ route('admin.tags.create') }}" class="btn btn-primary">
<span class="icon text-white-50">
@ -25,57 +26,62 @@
</a>
@endcan
</div>
<form action="{{ route('admin.tags.index') }}" method="GET" class="form-inline">
<input type="text" name="search" class="form-control mr-2" placeholder="Search tags">
<button type="submit" class="btn btn-primary">Search</button>
</form>
</div>
<div class="table-responsive">
<table class="table table-bordered" cellspacing="0" width="100%">
<thead>
</div>
<div class="table-responsive">
<table class="table table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>No</th>
<th>Name</th>
<th>Product count</th>
<th class="text-center" style="width: 30px;">Action</th>
</tr>
</thead>
<tbody>
@forelse($tags as $tag)
<tr>
<th>No</th>
<th>Name</th>
<th>Product count</th>
<th class="text-center" style="width: 30px;">Action</th>
</tr>
</thead>
<tbody>
@forelse($tags as $tag)
<tr>
<td>{{ $loop->iteration }}</td>
<td><a href="{{ route('admin.tags.show', $tag->id) }}">
{{ $tag->name }}
<td>{{ $loop->iteration }}</td>
<td><a href="{{ route('admin.tags.show', $tag->id) }}">
{{ $tag->name }}
</a>
</td>
<td>{{ $tag->products_count }}</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.tags.edit', $tag) }}" class="btn btn-sm btn-primary">
<i class="fa fa-edit"></i>
</a>
</td>
<td>{{ $tag->products_count }}</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.tags.edit', $tag) }}" class="btn btn-sm btn-primary">
<i class="fa fa-edit"></i>
</a>
<form onclick="return confirm('are you sure !')" action="{{ route('admin.tags.destroy', $tag) }}"
method="POST">
<form onclick="return confirm('are you sure !')" action="{{ route('admin.tags.destroy', $tag) }}"
method="POST">
@csrf
@method('DELETE')
<button class="btn btn-sm btn-danger" type="submit"><i class="fa fa-trash"></i></button>
</form>
</div>
</td>
</tr>
@empty
<tr>
<td class="text-center" colspan="6">No tags found.</td>
</tr>
@endforelse
</tbody>
<tfoot>
<tr>
<td colspan="6">
<div class="float-right">
{!! $tags->appends(request()->all())->links() !!}
</div>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</td>
</tr>
@empty
<tr>
<td class="text-center" colspan="6">No tags found.</td>
</tr>
@endforelse
</tbody>
<tfoot>
<tr>
<td colspan="6">
<div class="float-right">
{!! $tags->appends(request()->all())->links() !!}
</div>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
@endsection

View File

@ -5,7 +5,7 @@
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">{{ __('create user') }}</h1>
<h1 class="h3 mb-0 text-gray-800">{{ __('Create User') }}</h1>
<a href="{{ route('admin.users.index') }}" class="btn btn-primary btn-sm shadow-sm">{{ __('Go Back') }}</a>
</div>
@ -19,34 +19,38 @@
</div>
@endif
<!-- Content Row -->
<div class="card shadow">
<div class="card-body">
<form action="{{ route('admin.users.store') }}" method="POST">
@csrf
<div class="form-group">
<label for="name">{{ __('Name') }}</label>
<input type="text" class="form-control" id="name" placeholder="{{ __('Name') }}" name="username" value="{{ old('username') }}" />
</div>
<div class="form-group">
<label for="email">{{ __('Email') }}</label>
<input type="email" class="form-control" id="email" placeholder="{{ __('Email') }}" name="email" value="{{ old('email') }}" />
</div>
<div class="form-group">
<label for="password">{{ __('Password') }}</label>
<input type="text" class="form-control" id="password" placeholder="{{ __('Password') }}" name="password" value="{{ old('password') }}" required />
</div>
<div class="form-group">
<label for="roles">{{ __('Role') }}</label>
<select name="roles[]" id="roles" class="form-control select2" multiple="multiple" required>
</select>
</div>
<button type="submit" class="btn btn-primary btn-block">{{ __('Save') }}</button>
</form>
</div>
<!-- Content Row -->
<div class="card shadow">
<div class="card-body">
<form action="{{ route('admin.users.store') }}" method="POST">
@csrf
<div class="form-group">
<label for="name">{{ __('Name') }}</label>
<input type="text" class="form-control" id="name" placeholder="{{ __('Name') }}" name="username" value="{{ old('username') }}" required />
</div>
<div class="form-group">
<label for="email">{{ __('Email') }}</label>
<input type="email" class="form-control" id="email" placeholder="{{ __('Email') }}" name="email" value="{{ old('email') }}" required />
</div>
<div class="form-group">
<label for="phone">{{ __('Phone') }}</label>
<input type="text" class="form-control" id="phone" placeholder="{{ __('Phone') }}" name="phone" value="{{ old('phone') }}" required />
</div>
<div class="form-group">
<label for="password">{{ __('Password') }}</label>
<input type="password" class="form-control" id="password" placeholder="{{ __('Password') }}" name="password" value="{{ old('password') }}" required />
</div>
<div class="form-group">
<label for="role">{{ __('Role') }}</label>
<select name="role" id="role" class="form-control" required>
<option value="admin">{{ __('Admin') }}</option>
<option value="user">{{ __('User') }}</option>
</select>
</div>
<button type="submit" class="btn btn-primary btn-block">{{ __('Save') }}</button>
</form>
</div>
</div>
<!-- Content Row -->

View File

@ -22,6 +22,11 @@
<input type="email" class="form-control" id="email" name="email" value="{{ $user->email }}" required>
</div>
<div class="form-group">
<label for="phone">{{ __('Phone') }}</label>
<input type="text" class="form-control" id="phone" placeholder="{{ __('Phone') }}" name="phone" value="{{ $user->phone }}" required />
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control" id="password" name="password">
</div>

View File

@ -15,56 +15,68 @@
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">{{ __('Users') }}</h1>
<a href="{{ route('admin.users.create') }}" class="btn btn-primary btn-sm shadow-sm">{{ __('create new')}} <i class="fa fa-plus"> </i></a>
<a href="{{ route('admin.users.create') }}" class="btn btn-primary btn-sm shadow-sm">{{ __('create new')}} <i class="fa fa-plus"> </i></a>
</div>
<!-- Search Bar -->
<div class="mb-4">
<form action="{{ route('admin.users.index') }}" method="GET" class="form-inline">
<div class="form-group mr-2">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search by name or email') }}" value="{{ request('search') }}">
</div>
<button type="submit" class="btn btn-primary">{{ __('Search') }}</button>
</form>
</div>
<!-- Content Row -->
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>No</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Email') }}</th>
<th>{{ __('Roles') }}</th>
<th>{{ __('Action') }}</th>
</tr>
</thead>
<tbody>
@forelse($users as $user)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $user->username }}</td>
<td>{{ $user->email }}</td>
<td>{{ $user->role }}</td>
<td>
<a href="{{ route('admin.users.edit', $user->id) }}" class="btn btn-info">
<i class="fa fa-pencil-alt"></i>
</a>
<form onclick="return alert('are you sure ? ')" class="d-inline" action="{{ route('admin.users.destroy', $user->id) }}" method="POST">
@csrf
@method('delete')
<button class="btn btn-danger">
<i class="fa fa-trash"></i>
</button>
</form>
</td>
</tr>
@empty
<tr>
<td colspan="7" class="text-center">{{ __('Data Empty') }}</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
<div class="card-footer">
{{ $users->links() }}
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>No</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Email') }}</th>
<th>{{ __('Phone') }}</th>
<th>{{ __('Roles') }}</th>
<th>{{ __('Action') }}</th>
</tr>
</thead>
<tbody>
@forelse($users as $user)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $user->username }}</td>
<td>{{ $user->email }}</td>
<td>{{ $user->phone }}</td>
<td>{{ $user->role }}</td>
<td>
<a href="{{ route('admin.users.edit', $user->id) }}" class="btn btn-info">
<i class="fa fa-pencil-alt"></i>
</a>
<form onclick="return confirm('Are you sure?')" class="d-inline" action="{{ route('admin.users.destroy', $user->id) }}" method="POST">
@csrf
@method('delete')
<button class="btn btn-danger">
<i class="fa fa-trash"></i>
</button>
</form>
</td>
</tr>
@empty
<tr>
<td colspan="5" class="text-center">{{ __('Data Empty') }}</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
<div class="card-footer">
{{ $users->links() }}
</div>
</div>
<!-- Content Row -->
</div>

View File

@ -5,7 +5,9 @@
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Login') }}</div>
<div class="card-header text-center">
<img src="{{ asset('frontend/assets/img/logo/logo.jpg') }}" alt="Salon Logo" style="width: 150px;">
</div>
<div class="card-body">
<form method="POST" action="{{ route('login') }}">
@ -39,29 +41,15 @@
</div>
</div>
<div class="row mb-3">
<div class="col-md-6 offset-md-4">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
<label class="form-check-label" for="remember">
{{ __('Remember Me') }}
</label>
</div>
</div>
</div>
<div class="row mb-0">
<div class="col-md-8 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Login') }}
</button>
@if (Route::has('password.request'))
<a class="btn btn-link" href="{{ route('password.request') }}">
{{ __('Forgot Your Password?') }}
</a>
@endif
<a class="btn btn-link" href="{{ route('register') }}">
Belum punya akun? <span style="text-decoration: underline;">Register</span>
</a>
</div>
</div>
</form>

View File

@ -5,6 +5,9 @@
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header text-center">
<img src="{{ asset('frontend/assets/img/logo/logo.jpg') }}" alt="Salon Logo" style="width: 150px;">
</div>
<div class="card-header">{{ __('Register') }}</div>
<div class="card-body">
@ -12,10 +15,10 @@
@csrf
<div class="row mb-3">
<label for="name" class="col-md-4 col-form-label text-md-end">{{ __('Username') }}</label>
<label for="username" class="col-md-4 col-form-label text-md-end">{{ __('Username') }}</label>
<div class="col-md-6">
<input id="name" type="text" class="form-control @error('username') is-invalid @enderror" name="username" value="{{ old('username') }}" required autocomplete="Username" autofocus>
<input id="username" type="text" class="form-control @error('username') is-invalid @enderror" name="username" value="{{ old('username') }}" required autocomplete="username" autofocus>
@error('username')
<span class="invalid-feedback" role="alert">
@ -38,7 +41,19 @@
@enderror
</div>
</div>
<div class="row mb-3">
<label for="phone" class="col-md-4 col-form-label text-md-end">{{ __('Phone Number') }}</label>
<div class="col-md-6">
<input id="phone" type="text" class="form-control @error('phone') is-invalid @enderror" name="phone" value="{{ old('phone') }}" required autocomplete="phone">
@error('phone')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row mb-3">
<label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>
@ -69,6 +84,13 @@
</div>
</div>
</form>
<div class="row mt-3">
<div class="col-md-6 offset-md-4">
<a href="{{ route('login') }}">
{{ __('Sudah punya akun?') }} <span style="text-decoration: underline;">{{ __('Login') }}</span>
</a>
</div>
</div>
</div>
</div>
</div>

View File

@ -32,7 +32,7 @@
<td>{{ $booking->handphone }}</td>
<td>{{ $booking->total }}</td>
<td>{{ $booking->date }}</td>
<td>{{ $booking->time }}</td>
<td>{{ $booking->schedule->start_time }} - {{ $booking->schedule->end_time }}</td>
</tr>
</tbody>
</table>
@ -44,31 +44,26 @@
</div>
@endsection
@push('script')
<script type="text/javascript">
// For example trigger on button clicked, or any time you need
var payButton = document.getElementById('pay-button');
payButton.addEventListener('click', function () {
// Trigger snap popup. @TODO: Replace TRANSACTION_TOKEN_HERE with your transaction token
window.snap.pay('{{ $snapToken }}', {
onSuccess: function(result){
/* You may add your own implementation here */
alert("payment success!"); console.log(result);
window.location.replace("{{ route('payment.success', ['bookingId' => $booking->id, 'scheduleId' => $scheduleId]) }}");
},
onPending: function(result){
/* You may add your own implementation here */
alert("wating your payment!"); console.log(result);
},
onError: function(result){
/* You may add your own implementation here */
alert("payment failed!"); console.log(result);
},
onClose: function(){
/* You may add your own implementation here */
alert('you closed the popup without finishing the payment');
}
})
});
</script>
<script type="text/javascript">
var payButton = document.getElementById('pay-button');
payButton.addEventListener('click', function () {
window.snap.pay('{{ $snapToken }}', {
onSuccess: function(result){
alert("Payment success!");
window.location.replace("{{ route('booking.print', ['bookingId' => $booking->id]) }}");
},
onPending: function(result){
alert("Waiting for your payment!");
},
onError: function(result){
alert("Payment failed!");
},
onClose: function(){
alert('You closed the popup without finishing the payment');
}
});
});
</script>
@endpush

View File

@ -18,6 +18,16 @@
<div class="col-lg-6">
<form action="{{ route('booking.store') }}" method="POST">
@csrf
<!-- Tambahkan kode untuk menampilkan pesan kesalahan -->
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="row">
<div class="col">
<div class="form-group">
@ -81,5 +91,20 @@
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
document.querySelector('form').addEventListener('submit', function (e) {
// Ambil nilai dari checkbox cash dan cashless
var cashChecked = document.getElementById('cash').checked;
var cashlessChecked = document.getElementById('cashless').checked;
// Periksa apakah keduanya dicentang
if (cashChecked && cashlessChecked) {
e.preventDefault(); // Hentikan pengiriman formulir
document.getElementById('paymentAlert').style.display = 'block'; // Tampilkan pesan peringatan
}
});
});
</script>
@endsection

View File

@ -8,12 +8,14 @@
<div class="container-fluid">
<div class="row">
<div class="col">
<h3 class="text-center">Please come to the salon on the <span class="font-weight-bold">{{ $booking->date }}</span> at <span class="font-weight-bold">{{ $booking->time }}.</span></h1>
<h3 class="text-center">Silahkan datang ke <span class="font-weight-bold">Aleea Salon</span> pada tanggal <span class="font-weight-bold">{{ $booking->date }}</span> pukul <span class="font-weight-bold">{{ $booking->schedule->start_time }} - {{ $booking->schedule->end_time }}.</span></h1>
<div class="text-center">
<a class="btn btn-dark mt-2" href="{{ route('homepage') }}">Back</a>
<div class="text-center">
<a class="btn btn-dark mt-2" href="{{ route('bookings.show', $booking->id) }}">Lihat</a>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,156 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Print Bill Summary</title>
<style>
/* General styles */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
line-height: 1.4;
}
.container {
max-width: 300px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
background: #fff;
}
.card {
margin-bottom: 20px;
}
.card-header {
background-color: #f2f2f2;
padding: 5px 10px;
border-bottom: 1px solid #ddd;
text-align: center;
}
.card-body {
padding: 10px;
}
.card-title {
margin: 0;
font-size: 18px;
}
.details {
margin-bottom: 10px;
}
.details table {
width: 100%;
font-size: 14px;
line-height: 1.3;
}
.details th,
.details td {
padding: 2px 0;
vertical-align: top;
text-align: left;
}
.details th {
width: 40%;
padding-right: 10px;
}
.btn-print {
display: block;
width: 100%;
margin-top: 10px;
padding: 8px;
background-color: #ffc107;
color: #fff;
border: none;
border-radius: 5px;
font-size: 14px;
cursor: pointer;
}
.btn-print:hover {
background-color: #ff9800;
}
.logo-2 {
text-align: center;
margin-bottom: 20px;
}
.logo-2 img {
height: 60px;
transform: scale(2);
object-fit: cover;
}
</style>
</head>
<body onload="printBill()">
<div class="container">
<div class="logo-2 furniture-logo ptb-30">
<a href="/">
<img src="{{ asset('frontend/assets/img/logo/logo.jpg') }}" alt="">
</a>
</div>
<div class="card">
<div class="card-header">
<h3 class="card-title">Bill Summary</h3>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
<h2 class="text-dark font-weight-medium">Booking ID #{{ $booking->id }}</h2>
</div>
<div class="details">
<p><strong>Customer Details:</strong></p>
<table>
<tr>
<th>Name:</th>
<td>{{ $booking->name }}</td>
</tr>
<tr>
<th>WhatsApp:</th>
<td>{{ $booking->handphone }}</td>
</tr>
</table>
</div>
<div class="details">
<p><strong>Service Details:</strong></p>
<table>
<tr>
<th>Service:</th>
<td>{{ $booking->service_name }}</td>
</tr>
<tr>
<th>Category:</th>
<td>{{ $booking->category }}</td>
</tr>
<tr>
<th>Schedule:</th>
<td>{{ $booking->date }}</td>
</tr>
<tr>
<th>Time:</th>
<td>{{ $booking->schedule->start_time }} - {{ $booking->schedule->end_time }}</td>
</tr>
<tr>
<th>Price:</th>
<td>IDR. {{ number_format($booking->total, 0, '.', '.') }}</td>
</tr>
<tr>
<th>Payment Status:</th>
<td>{{ $booking->status }}</td>
</tr>
</table>
</div>
</div>
<div class="card-footer text-center">
<button class="btn-print" onclick="printBill()">Print Bill</button>
</div>
</div>
</div>
</body>
</html>
<!-- Print Bill Script -->
<script>
function printBill() {
window.print();
window.close();
}
</script>

View File

@ -31,41 +31,39 @@
<!-- services -->
<div class="services-area wrapper-padding-4 gray-bg pt-120 pb-80">
<div class="container-fluid">
<div class="section-title-furits text-center">
<h2>Why Choose Us</h2>
<div class="container-fluid">
<div class="section-title-furits text-center">
<h2>Why Choose Us</h2>
</div>
<br>
<div class="services-wrapper mt-40">
<div class="single-services mb-40">
<div class="services-img">
<img src="{{ asset('frontend/assets/img/icon-img/26.png') }}" alt="">
</div>
<div class="services-content">
<h4>Professional Services</h4>
</div>
</div>
<br>
<div class="services-wrapper mt-40">
<div class="single-services mb-40">
<div class="services-img">
<img src="{{ asset('frontend/assets/img/icon-img/26.png') }}" alt="">
</div>
<div class="services-content">
<h4>Good Service</h4>
<p>Contrary to popular belief, Lorem Ipsum is random text. </p>
</div>
<div class="single-services mb-40">
<div class="services-img">
<img src="{{ asset('frontend/assets/img/icon-img/27.png') }}" alt="">
</div>
<div class="single-services mb-40">
<div class="services-img">
<img src="{{ asset('frontend/assets/img/icon-img/27.png') }}" alt="">
</div>
<div class="services-content">
<h4>24/7 Support</h4>
<p>Contrary to popular belief, Lorem Ipsum is random text. </p>
</div>
<div class="services-content">
<h4>24/7 Availability</h4>
</div>
<div class="single-services mb-40">
<div class="services-img">
<img src="{{ asset('frontend/assets/img/icon-img/28.png') }}" alt="">
</div>
<div class="services-content">
<h4>Secure Payments</h4>
<p>Contrary to popular belief, Lorem Ipsum is random text. </p>
</div>
</div>
<div class="single-services mb-40">
<div class="services-img">
<img src="{{ asset('frontend/assets/img/icon-img/28.png') }}" alt="">
</div>
<div class="services-content">
<h4>Secure Payments</h4>
</div>
</div>
</div>
</div>
</div>
<!-- end services -->
@endsection

View File

@ -2,13 +2,13 @@
@section('title', 'Services')
@section('content')
<div class="section-title-furits text-center">
<h2>Order with <span class="font-weight-bold">Cash</span> payment <span class="text-success">Successful</span></h2>
<h2>Order with <span class="font-weight-bold"></span> payment <span class="text-success">Cash</span></h2>
</div>
<div class="shop-page-wrapper shop-page-padding ptb-100">
<div class="container-fluid">
<div class="row">
<div class="col">
<h3 class="text-center">Please take the product you ordered and pay with a nominal amount of <span class="font-weight-bold">IDR. {{ number_format( $order->base_total_price, 0, '.', '.') }}.</span></h1>
<h3 class="text-center">Silakan ambil produk yang Anda pesan dan bayar dengan nominal <span class="font-weight-bold">IDR. {{ number_format( $order->base_total_price, 0, '.', '.') }}.</span></h1>
<div class="text-center">
<a class="btn btn-dark mt-2" href="{{ route('homepage') }}">Back</a>
</div>

View File

@ -3,158 +3,129 @@
@section('title', 'Checkout Page')
@section('content')
<!-- header end -->
<div class="breadcrumb-area pt-205 breadcrumb-padding pb-210" style="background-image: url({{ asset('frontend/assets/img/bg/breadcrumb.jpg') }})">
<div class="container">
<div class="breadcrumb-content text-center">
<h2>Checkout Page</h2>
<ul>
<li><a href="{{ url('/') }}">home</a></li>
<li> Checkout Page</li>
</ul>
</div>
</div>
</div>
<!-- checkout-area start -->
<div class="checkout-area ptb-100">
<div class="container">
<!-- header end -->
<div class="breadcrumb-area pt-205 breadcrumb-padding pb-210" style="background-image: url({{ asset('frontend/assets/img/logo/home-bg2.png') }})">
<div class="container">
<div class="breadcrumb-content text-center">
<h2>Checkout Page</h2>
<ul>
<li><a href="{{ url('/') }}">home</a></li>
<li> Checkout Page</li>
</ul>
</div>
</div>
</div>
<!-- checkout-area start -->
<div class="checkout-area ptb-100">
<div class="container">
<form action="{{ route('checkout') }}" method="post">
@csrf
<div class="row">
<div class="col-lg-6 col-md-12 col-12">
<div class="checkbox-form">
<h3>Billing Details</h3>
<div class="row">
<div class="col-md-12">
<div class="checkout-form-list">
<label>Username <span class="required">*</span></label>
<input type="text" name="username">
</div>
</div>
<div class="col-md-6">
<div class="checkout-form-list">
<label>WhatsApp<span class="required">*</span></label>
<input type="text" name="phone" value="{{ auth()->user()->phone }}">
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-12 col-12">
<div class="checkbox-form">
<h3>Billing Details</h3>
<div class="row">
<div class="col-md-12">
<div class="checkout-form-list">
<label>Username <span class="required">*</span></label>
<input type="text" name="username" value="{{ auth()->user()->username }}">
</div>
</div>
<div class="col-md-6">
<div class="checkout-form-list">
<label>WhatsApp<span class="required">*</span></label>
<input type="text" name="phone" value="{{ auth()->user()->phone }}">
</div>
</div>
<div class="order-notes">
<div class="checkout-form-list mrg-nn">
<label for="note">Order Notes</label>
<textarea name="note" id="note" cols="30" rows="10"></textarea>
</div>
</div>
<div class="order-notes">
<div class="checkout-form-list mrg-nn">
<label for="note">Order Notes</label>
<textarea name="note" id="note" cols="30" rows="10"></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-12 col-12">
<div class="your-order">
<h3>Your order</h3>
<div class="your-order-table table-responsive">
<table>
<thead>
<tr>
<th class="product-name">Product</th>
<th class="product-total">Total</th>
</tr>
</thead>
<tbody>
@forelse ($items as $item)
@php
$product = $item->associatedModel;
$image = !empty($product->firstMedia) ? asset('storage/images/products/'. $product->firstMedia->file_name) : asset('frontend/assets/img/cart/3.jpg')
</div>
</div>
</div>
<div class="col-lg-6 col-md-12 col-12">
<div class="your-order">
<h3>Your order</h3>
<div class="your-order-table table-responsive">
<table>
<thead>
<tr>
<th class="product-name">Product</th>
<th class="product-total">Total</th>
</tr>
</thead>
<tbody>
@forelse ($items as $item)
@php
$product = $item->associatedModel;
$image = !empty($product->firstMedia) ? asset('storage/images/products/'. $product->firstMedia->file_name) : asset('frontend/assets/img/cart/3.jpg');
@endphp
<tr class="cart_item">
<td class="product-name">
{{ $item->name }} <strong class="product-quantity"> × {{ $item->quantity }}</strong>
</td>
<td class="product-total">
<span class="amount">{{ number_format(\Cart::get($item->id)->getPriceSum()) }}</span>
</td>
</tr>
@empty
<tr>
<td colspan="2">The cart is empty!</td>
</tr>
@endforelse
</tbody>
<tfoot>
<tr class="order-total">
<th>Order Total</th>
<td><strong><span class="total-amount">{{ number_format(\Cart::getTotal()) }}</span></strong></td>
</tr>
</tfoot>
</table>
</div>
<div class="payment-method">
<div class="payment-accordion">
<h3>Payment</h3>
<div class="ship-different-title">
<h4>
<input id="cash" type="checkbox" name="cash" />
<label for="cash">Cash</label>
</h4>
<h4>
<input id="cashless" type="checkbox" name="cashless" />
<label for="cashless">Cashless</label>
</h4>
</div>
</div>
<div class="order-button-payment">
<input type="submit" value="Pay Now" />
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<!-- checkout-area end -->
@endphp
<tr class="cart_item">
<td class="product-name">
{{ $item->name }} <strong class="product-quantity"> × {{ $item->quantity }}</strong>
</td>
<td class="product-total">
<span class="amount">{{ number_format(\Cart::get($item->id)->getPriceSum()) }}</span>
</td>
</tr>
@empty
<tr>
<td colspan="2">The cart is empty! </td>
</tr>
@endforelse
</tbody>
<tfoot>
{{-- <tr class="cart-subtotal">
<th>Subtotal</th>
<td><span class="amount">{{ number_format(\Cart::getSubTotal()) }}</span></td>
</tr>
<tr class="cart-subtotal">
<th>Tax</th>
<td><span class="amount">{{ number_format(\Cart::getSubTotal()) }}</span></td>
</tr> --}}
{{-- <tr class="cart-subtotal">
<th>Shipping Cost ({{ $totalWeight }} gram)</th>
<td><select id="shipping-cost-option" required name="shipping_service"></select></td>
</tr> --}}
<tr class="order-total">
<th>Order Total</th>
<td><strong><span class="total-amount">{{ number_format(\Cart::getTotal()) }}</span></strong>
</td>
</tr>
</tfoot>
</table>
</div>
<div class="payment-method">
<div class="payment-accordion">
<div class="panel-group" id="faq">
{{-- <div class="panel panel-default">
<div class="panel-heading">
<h5 class="panel-title"><a data-toggle="collapse" aria-expanded="true" data-parent="#faq" href="#payment-1">Direct Bank Transfer.</a></h5>
</div>
<div id="payment-1" class="panel-collapse collapse show">
<div class="panel-body">
<p>Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order wont be shipped until the funds have cleared in our account.</p>
</div>
</div>
</div> --}}
{{-- <div class="panel panel-default">
<div class="panel-heading">
<h5 class="panel-title"><a class="collapsed" data-toggle="collapse" aria-expanded="false" data-parent="#faq" href="#payment-2">Cheque Payment</a></h5>
</div>
<div id="payment-2" class="panel-collapse collapse">
<div class="panel-body">
<p>Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order wont be shipped until the funds have cleared in our account.</p>
</div>
</div>
</div> --}}
{{-- <div class="panel panel-default">
<div class="panel-heading">
<h5 class="panel-title"><a class="collapsed" data-toggle="collapse" aria-expanded="false" data-parent="#faq" href="#payment-3">PayPal</a></h5>
</div>
<div id="payment-3" class="panel-collapse collapse">
<div class="panel-body">
<p>Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order wont be shipped until the funds have cleared in our account.</p>
</div>
</div>
</div> --}}
<h3>Payment</h3>
<div class="ship-different-title">
<h4>
<input id="cash" type="checkbox" name="cash"/>
<label for="cash">Cash</label>
</h4>
<h4>
<input id="cashless" type="checkbox" name="cashless"/>
<label for="cashless">Cashless</label>
</h4>
</div>
</div>
<div class="order-button-payment" >
<input type="submit" id="test" value="Pay Now" />
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<!-- checkout-area end -->
<script>
function toggleResellerFields() {
var resellerCheckbox = document.getElementById('reseller');
var resellerFields = document.getElementById('reseller-fields');
if (resellerCheckbox.checked) {
resellerFields.style.display = 'block';
document.getElementById('reseller_name').setAttribute('required', 'required');
document.getElementById('reseller_phone').setAttribute('required', 'required');
} else {
resellerFields.style.display = 'none';
document.getElementById('reseller_name').removeAttribute('required');
document.getElementById('reseller_phone').removeAttribute('required');
}
}
</script>
@endsection

View File

@ -43,7 +43,7 @@
{{ $order->code }}<br>
<span style="font-size: 12px; font-weight: normal"> {{ $order->order_date }}</span>
</td>
<td>{{ number_format($order->grand_total) }}</td>
<td>{{ number_format($order->base_total_price, 0, '.', '.') }}</td>
<td>{{ $order->status }}</td>
<td>{{ $order->payment_status }}</td>
<td>

View File

@ -33,40 +33,12 @@
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Billing Address</p>
<address>
{{ $order->customer_first_name }} {{ $order->customer_last_name }}
<br> {{ $order->customer_address1 }}
<br> {{ $order->customer_address2 }}
<br> Email: {{ $order->customer_email }}
<br>Name: {{ $order->customer_first_name }} {{ $order->customer_last_name }}
<br> Phone: {{ $order->customer_phone }}
<br> Postcode: {{ $order->customer_postcode }}
</address>
</div>
@if ($order->shipment)
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Shipment Address</p>
<address>
{{ $order->shipment->first_name }} {{ $order->shipment->last_name }}
<br> {{ $order->shipment->address1 }}
<br> {{ $order->shipment->address2 }}
<br> Email: {{ $order->shipment->email }}
<br> Phone: {{ $order->shipment->phone }}
<br> Postcode: {{ $order->shipment->postcode }}
</address>
</div>
@endif
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Details</p>
<address>
ID: <span class="text-dark">#{{ $order->code }}</span>
<br> {{ $order->order_date }}
<br> Status: {{ $order->status }} {{ $order->isCancelled() ? '('. $order->cancelled_at .')' : null}}
@if ($order->isCancelled())
<br> Cancellation Note : {{ $order->cancellation_note}}
@endif
<br> Payment Status: {{ $order->payment_status }}
<br> Shipped by: {{ $order->shipping_service_name }}
</address>
</div>
</div>
<div class="table-content table-responsive">
<table class="table table-bordered table-striped">

View File

@ -2,19 +2,18 @@
@section('title', $product->name)
@section('content')
<div class="product-details ptb-100 pb-90">
@if(session()->has('message'))
<div class="alert alert-{{ session()->get('alert-type') }} alert-dismissible fade show" role="alert" id="alert-message">
{{ session()->get('message') }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
@endif
@if(session()->has('message'))
<div class="alert alert-{{ session()->get('alert-type') }} alert-dismissible fade show" role="alert" id="alert-message">
{{ session()->get('message') }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
@endif
<div class="container">
<div class="row">
<div class="col-md-12 col-lg-7 col-12">
<div class="col-md-6">
<div class="product-details-img-content">
<div class="product-details-tab mr-70">
@if($product->media_count)
@ -24,17 +23,17 @@
href="#pro-details{{ $loop->index }}" data-toggle="tab" role="tab"
aria-selected="true">
<img src="{{ asset('storage/images/products/' . $media->file_name ) }}"
alt="{{ $product->name }}">
alt="{{ $product->name }}" class="img-fluid">
</a>
@endforeach
</div>
@else
<img src="{{ asset('img/no-img.png' ) }}" alt="{{ $product->name }}">
<img src="{{ asset('img/no-img.png' ) }}" alt="{{ $product->name }}" class="img-fluid">
@endif
</div>
</div>
</div>
<div class="col-md-12 col-lg-5 col-12">
<div class="col-md-6">
<div class="product-details-content">
<h3>{{ $product->name }}</h3>
@ -43,12 +42,12 @@
</div>
<p>{!! $product->description !!}</p>
<form action="{{ route('cart.store') }}" method="post">
@csrf
@csrf
<input type="hidden" name="product_id" value="{{ $product->id }}">
<div class="quickview-plus-minus">
<div class="cart-plus-minus">
<input type="number" name="qty" min="1" value="1" class="cart-plus-minus-box" placeholder="qty">
<input type="number" name="qty" min="1" value="1" class="form-control cart-plus-minus-box" placeholder="qty">
</div>
<div class="quickview-btn-cart">
<button type="submit" class="submit contact-btn btn-hover">add to cart</button>
@ -59,7 +58,7 @@
</a>
</div>
</div>
</form>
</form>
<div class="product-details-cati-tag mt-35">
<ul>
<li class="categories-title">Categories :</li>
@ -80,27 +79,11 @@
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="product-description-review-area pb-90">
<div class="container">
<div class="product-description-review text-center">
<div class="description-review-title nav" role=tablist>
<a href="#pro-dec" data-toggle="tab" role="tab" aria-selected="true">
Description
</a>
</div>
<div class="description-review-text tab-content">
<div class="tab-pane fade show active" id="pro-dec" role="tabpanel">
<p>{!! $product->details !!}</p>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -6,6 +6,7 @@
</div>
<div class="shop-page-wrapper shop-page-padding ptb-100">
<div class="container-fluid">
<div class="row justify-content-center">
@foreach ($serviceCategories as $serviceCategory)
<div class="col-lg-3">
@ -13,7 +14,8 @@
<div class="card-body">
<h4 class="card-title mb-5">{{ $serviceCategory->name }}</h4>
<img src="{{ url('/frontend/assets/img/iconservice.png') }}" class="img-fluid" alt="...">
<a href="{{ route('service.show', $serviceCategory->name) }}" class="btn btn-primary mt-5 d-block">Detail</a>
<a href="{{ route('service.show', $serviceCategory->name) }}" class="btn btn-dark mt-5 d-block">Detail</a>
</div>
</div>
</div>

View File

@ -23,9 +23,7 @@
<div id="app">
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span>
</button>

View File

@ -42,7 +42,7 @@
<div class="header-bottom-wrapper">
<div class="logo-2 furniture-logo ptb-30">
<a href="/">
<img height="60" style="transform:scale(1.5);object-fit: cover;" src="{{ asset('frontend/assets/img/logo/logo.png') }}" alt="">
<img height="60" style="transform:scale(2);object-fit: cover;" src="{{ asset('frontend/assets/img/logo/logo.jpg') }}" alt="">
</a>
</div>
<div class="menu-style-2 furniture-menu menu-hover">
@ -188,77 +188,72 @@
@yield('content')
<!-- footer -->
<footer class="footer-area">
<div class="footer-top-area pt-70 pb-35 wrapper-padding-5">
<div class="container-fluid">
<div class="widget-wrapper">
<div class="footer-widget mb-30">
<img height="60" style="transform:scale(1.5);object-fit: cover;" src="{{ asset('frontend/assets/img/logo/logo.png') }}" alt="">
<div class="footer-about-2">
<p>There are many variations of passages of Lorem Ipsum <br>the majority have suffered alteration in some form, by <br> injected humour</p>
</div>
</div>
<div class="footer-widget mb-30">
<h3 class="footer-widget-title-5">Contact Info</h3>
<div class="footer-info-wrapper-3">
<div class="footer-address-furniture">
<div class="footer-info-icon3">
<span>Address: </span>
</div>
<div class="footer-info-content3">
<p>66 Sipu road Rampura Banasree <br>USA- 10800</p>
</div>
</div>
<div class="footer-address-furniture">
<div class="footer-info-icon3">
<span>Phone: </span>
</div>
<div class="footer-info-content3">
<p>+8801 (33) 515609735 <br>+8801 (66) 223352333</p>
</div>
</div>
<div class="footer-address-furniture">
<div class="footer-info-icon3">
<span>E-mail: </span>
</div>
<div class="footer-info-content3">
<p><a href="#"> email@domain.com</a> <br><a href="#"> domain@mail.info</a></p>
</div>
</div>
</div>
</div>
<div class="footer-widget mb-30">
<h3 class="footer-widget-title-5">Newsletter</h3>
<div class="footer-newsletter-2">
<p>Send us your mail or next updates</p>
<div id="mc_embed_signup" class="subscribe-form-5">
<form action="http://devitems.us11.list-manage.com/subscribe/post?u=6bbb9b6f5827bd842d9640c82&amp;id=05d85f18ef" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll" class="mc-form">
<input type="email" value="" name="EMAIL" class="email" placeholder="Enter mail address" required>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div class="mc-news" aria-hidden="true"><input type="text" name="b_6bbb9b6f5827bd842d9640c82_05d85f18ef" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>
<div class="footer-top-area pt-70 pb-35 wrapper-padding-5">
<div class="container-fluid">
<div class="widget-wrapper">
<div class="footer-widget mb-30">
<img height="60" style="transform:scale(1.5);object-fit: cover;" src="{{ asset('frontend/assets/img/logo/logo.jpg') }}" alt="">
<div class="footer-about-2">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3952.720934169864!2d113.2532870147671!3d-7.764183794418034!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x2dd6862a8f23b04d%3A0x6c21b32ee7b8d746!2sJl.%20Mastrip%20No.159%2C%20Jrebeng%20Wetan%2C%20Kec.%20Kedopok%2C%20Kota%20Probolinggo%2C%20Jawa%20Timur%2067227!5e0!3m2!1sen!2sid!4v1649652136072!5m2!1sen!2sid" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>
</div>
</div>
<div class="footer-widget mb-30">
<h3 class="footer-widget-title-5">Contact Info</h3>
<div class="footer-info-wrapper-3">
<div class="footer-address-furniture">
<div class="footer-info-icon3">
<span>Alamat: </span>
</div>
<div class="footer-info-content3">
<p>Jl. Mastrip No.159 <br>Kec. Kedopok, Kota Probolinggo</p>
</div>
</div>
<div class="footer-address-furniture">
<div class="footer-info-icon3">
<span>WA: </span>
</div>
<div class="footer-info-content3">
<p><a href="https://wa.me/6285645979260" target="_blank">085645979260</a></p>
</div>
</div>
<div class="footer-address-furniture">
<div class="footer-info-icon3">
<span>IG: </span>
</div>
<div class="footer-info-content3">
<p><a href="https://www.instagram.com/aleea.beautysalon" target="_blank">aleea.beautysalon</a></p>
</div>
</div>
</div>
</div>
<div class="footer-widget mb-30">
<h3 class="footer-widget-title-5" style="font-size: 1.5em;">Quick Links</h3>
<div class="footer-newsletter-2">
<ul style="font-size: 1.2em;">
<li><a href="/">Home</a></li>
<li><a href="{{ route('shop.index') }}">Shop</a></li>
<li><a href="{{ route('service.index') }}">Services</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-bottom ptb-20 gray-bg-8">
<div class="container">
<div class="row">
<div class="col-12 text-center">
<div class="copyright-furniture">
<p>Copyright © <a href="https://hastech.company/">HasTech</a> 2018 . All Right Reserved.</p>
</div>
</div>
</div>
</div>
<div class="footer-bottom ptb-20 gray-bg-8">
<div class="container">
<div class="row">
<div class="col-12 text-center">
<div class="copyright-furniture">
<p>Copyright © <a href="https://hastech.company/">Aleea Salon</a> 2024 . All Right Reserved.</p>
</div>
</div>
</div>
</footer>
</div>
</div>
</footer>

View File

@ -1,120 +0,0 @@
<div class="blog-details content" x-data="{ showForm: @entangle('showForm') }">
<div class="comments_area pb-5">
<ul class="comment__list">
@forelse($product->approvedReviews as $review)
<li>
<div class="wn__comment d-flex" style="column-gap: 1rem;">
<div class="">
@if($review->user && $review->user->user_image)
<img class="rounded-circle" src="{{ assest('storage/images/users/' . $review->user->user_image) }}" alt="" width="50">
@else
<img src="https://ui-avatars.com/api/?name={{ $review->user->name }}&background=0d8abc&color=fff" alt="{{ $review->name }}">
@endif
</div>
<div class="content d-flex" style="column-gap: 2rem;">
<div class="">
<strong>{{ $review->user->name }}</strong>
<small class="comnt__author d-block d-sm-flex">{{ $review->created_at ? $review->created_at->format('d M, Y') : '' }}</small>
<div>
@if($review->rating)
@for($i = 0; $i < 5; $i++)
<i class="{{ round($review->rating) <= $i ? 'far' : 'fas' }} fa-star"></i>
@endfor
@endif
</div>
<div>
<p style="width: 100%; font-size: 14px;">{{ $review->content }}</p>
</div>
</div>
<div class="ml-auto">
@if($currentRatingId === $review->id)
@auth
<span x-on:click="showForm = !showForm"
class="text-primary" style="cursor: pointer">
<i class="fas fa-edit"></i>
</span>
<br><br>
<span x-on:click.prevent="return confirm('Are you sure?') ? @this.delete({{ $currentRatingId }}) : false"
class="text-danger" style="cursor: pointer">
<i class="fas fa-trash"></i>
</span>
@endauth
@endif
</div>
</div>
</div>
</li>
@empty
<a class="m-2">Be the first to write your review!</a>
@endforelse
</ul>
</div>
@auth
<div class="comment_respond" x-show="showForm">
@if($canRate)
@if($showForm)
<h3 class="reply_title">{{ $currentRatingId ? 'Your Rating' : 'Leave a Reply' }}</h3>
<form wire:submit.prevent="rate()" class="review__form score">
<div class="score-wrap">
<label for="star1">
<input hidden wire:model="rating" type="radio" id="star1" name="rating" value="1" />
<span class="stars-active" data-value="1">
<i class=" @if($rating >= 1 ) fas fa-star @else far fa-star @endif" style="cursor: pointer"></i>
</span>
</label>
<label for="star2">
<input hidden wire:model="rating" type="radio" id="star2" name="rating" value="2" />
<span class="stars-active" data-value="2">
<i class=" @if($rating >= 2 ) fas fa-star @else far fa-star @endif" style="cursor: pointer"></i>
</span>
</label>
<label for="star3">
<input hidden wire:model="rating" type="radio" id="star3" name="rating" value="3" />
<span class="stars-active" data-value="3">
<i class=" @if($rating >= 3 ) fas fa-star @else far fa-star @endif" style="cursor: pointer"></i>
</span>
</label>
<label for="star4">
<input hidden wire:model="rating" type="radio" id="star4" name="rating" value="4" />
<span class="stars-active" data-value="4">
<i class=" @if($rating >= 4 ) fas fa-star @else far fa-star @endif" style="cursor: pointer"></i>
</span>
</label>
<label for="star5">
<input hidden wire:model="rating" type="radio" id="star5" name="rating" value="5" />
<span class="stars-active" data-value="5">
<i class=" @if($rating >= 5 ) fas fa-star @else far fa-star @endif" style="cursor: pointer"></i>
</span>
</label>
</div>
<p>@error('rating')<span class="text-danger">{{ $message }}</span>@enderror</p>
<div class="input__box text-left">
<textarea class="form-control" rows="5" wire:model.lazy="content">{{ old('review') }}</textarea>
@error('content')<span class="text-danger">{{ $message }}</span>@enderror
</div>
<div class="submite__btn">
@if($currentRatingId)
@auth
<button type="submit" class="btn btn-dark rounded shadow-lg">Update</button>
<button type="button" x-on:click="showForm = false" class="btn btn-secondary rounded shadow-lg">Close</button>
@endauth
@else
<button type="submit" class="btn btn-dark rounded shadow-lg">Rate</button>
@endif
</div>
</form>
@endif
@else
<div class="alert alert-danger" role="alert">
<small>Must buy this product before write a review.</small>
</div>
@endif
</div>
@else
<a href="{{ route('login') }}" class="btn btn-dark">
Login to write a review!
</a>
@endauth
</div>

View File

@ -1,77 +1,96 @@
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">
<!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ url('/') }}">
<div class="sidebar-brand-text mx-3">{{ __('Homepage') }}</div>
<!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ url('/') }}">
<div class="sidebar-brand-icon">
<i class="fas fa-spa"></i> <!-- Simbol Spa -->
</div>
<div class="sidebar-brand-text mx-3">Aleea Salon</div> <!-- Nama Aleea Salon -->
</a>
<!-- Divider -->
<hr class="sidebar-divider my-0">
<!-- Nav Item - Dashboard -->
<li class="nav-item {{ request()->is('admin/dashboard') || request()->is('admin/dashboard') ? 'active' : '' }}">
<a class="nav-link" href="{{ route('admin.dashboard.index') }}">
<i class="fas fa-fw fa-tachometer-alt"></i>
<span>{{ __('Dashboard') }}</span>
</a>
</li>
<!-- Divider -->
<hr class="sidebar-divider">
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
<i class="fas fa-users"></i>
<span>{{ __('User Management') }}</span>
</a>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/users') || request()->is('admin/users/*') ? 'active' : '' }}" href="{{ route('admin.users.index') }}"> <i class="fas fa-user mr-2"></i> {{ __('Users') }}</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseProduct" aria-expanded="true" aria-controls="collapseTwo">
<i class="fas fa-cubes"></i>
<span>{{ __('Product Management') }}</span>
</a>
<div id="collapseProduct" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/tags') || request()->is('admin/tags/*') ? 'active' : '' }}" href="{{ route('admin.tags.index') }}"> <i class="fas fa-tags mr-2"></i> {{ __('Tags') }}</a>
<a class="collapse-item {{ request()->is('admin/categories') || request()->is('admin/categories/*') ? 'active' : '' }}" href="{{ route('admin.categories.index') }}"> <i class="fas fa-list mr-2"></i> {{ __('Categories') }}</a>
<a class="collapse-item {{ request()->is('admin/products') || request()->is('admin/products/*') ? 'active' : '' }}" href="{{ route('admin.products.index') }}"> <i class="fas fa-boxes mr-2"></i> {{ __('Products') }}</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseServices" aria-expanded="true" aria-controls="collapseServices">
<i class="fas fa-tools"></i>
<span>{{ __('Services Management') }}</span>
</a>
<div id="collapseServices" class="collapse" aria-labelledby="headingServices" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/schedule') || request()->is('admin/schedule/*') ? 'active' : '' }}" href="{{ route('admin.schedule.index') }}"> <i class="fas fa-calendar-alt mr-2"></i> {{ __('Schedule') }}</a>
<a class="collapse-item {{ request()->is('admin/category') || request()->is('admin/category/*') ? 'active' : '' }}" href="{{ route('admin.category.index') }}"> <i class="fas fa-list-alt mr-2"></i> {{ __('Service Category') }}</a>
<a class="collapse-item {{ request()->is('admin/obtained') || request()->is('admin/obtained/*') ? 'active' : '' }}" href="{{ route('admin.obtained.index') }}"> <i class="fas fa-hand-holding-usd mr-2"></i> {{ __('Services Obtained') }}</a>
<a class="collapse-item {{ request()->is('admin/service') || request()->is('admin/service/*') ? 'active' : '' }}" href="{{ route('admin.service.index') }}"> <i class="fas fa-tools mr-2"></i> {{ __('Services') }}</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseOrder" aria-expanded="true" aria-controls="collapseTwo">
<i class="fas fa-shopping-cart"></i>
<span>{{ __('Transaction') }}</span>
</a>
<div id="collapseOrder" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/orders') || request()->is('admin/orders/*') ? 'active' : '' }}" href="{{ route('admin.orders.index') }}"> <i class="fas fa-file-invoice-dollar mr-2"></i> {{ __('Orders') }}</a>
<a class="collapse-item {{ request()->is('admin/booking') || request()->is('admin/booking/*') ? 'active' : '' }}" href="{{ route('admin.booking.index') }}"> <i class="fas fa-book-open mr-2"></i> {{ __('Booking') }}</a>
</div>
</div>
</li>
<!-- resources/views/layouts/sidebar.blade.php atau yang setara -->
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseReports" aria-expanded="true" aria-controls="collapseReports">
<i class="fas fa-file-alt"></i>
<span>{{ __('Reports Management') }}</span>
</a>
<div id="collapseReports" class="collapse" aria-labelledby="headingReports" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/reports/revenue') ? 'active' : '' }}" href="{{ route('admin.reports.revenue') }}">
<i class="fas fa-chart-line mr-2"></i> {{ __('Data Laporan') }}
</a>
<a class="collapse-item {{ request()->is('admin/reports/total-revenue') ? 'active' : '' }}" href="{{ route('admin.reports.total-revenue') }}">
<i class="fas fa-coins mr-2"></i> {{ __('Data Rekap') }}
</a>
</div>
</div>
</li>
<!-- Divider -->
<hr class="sidebar-divider my-0">
<!-- Nav Item - Dashboard -->
<li class="nav-item {{ request()->is('admin/dashboard') || request()->is('admin/dashboard') ? 'active' : '' }}">
<a class="nav-link" href="{{ route('admin.dashboard.index') }}">
<i class="fas fa-fw fa-tachometer-alt"></i>
<span>{{ __('Dashboard') }}</span></a>
</li>
<!-- Divider -->
<hr class="sidebar-divider">
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
<span>{{ __('User Management') }}</span>
</a>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/users') || request()->is('admin/users/*') ? 'active' : '' }}" href="{{ route('admin.users.index') }}"> <i class="fa fa-user mr-2"></i> {{ __('Users') }}</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseProduct" aria-expanded="true" aria-controls="collapseTwo">
<span>{{ __('Product Management') }}</span>
</a>
<div id="collapseProduct" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/tags') || request()->is('admin/tags/*') ? 'active' : '' }}" href="{{ route('admin.tags.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Tags') }}</a>
<a class="collapse-item {{ request()->is('admin/categories') || request()->is('admin/categories/*') ? 'active' : '' }}" href="{{ route('admin.categories.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Categories') }}</a>
<a class="collapse-item {{ request()->is('admin/products') || request()->is('admin/products/*') ? 'active' : '' }}" href="{{ route('admin.products.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Products') }}</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseServices" aria-expanded="true" aria-controls="collapseServices">
<span>{{ __('Services Management') }}</span>
</a>
<div id="collapseServices" class="collapse" aria-labelledby="headingServices" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/schedule') || request()->is('admin/schedule/*') ? 'active' : '' }}" href="{{ route('admin.schedule.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Schedule') }}</a>
<a class="collapse-item {{ request()->is('admin/category') || request()->is('admin/category/*') ? 'active' : '' }}" href="{{ route('admin.category.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Service Category') }}</a>
<a class="collapse-item {{ request()->is('admin/obtained') || request()->is('admin/obtained/*') ? 'active' : '' }}" href="{{ route('admin.obtained.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Services Obtained') }}</a>
<a class="collapse-item {{ request()->is('admin/service') || request()->is('admin/service/*') ? 'active' : '' }}" href="{{ route('admin.service.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Services') }}</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseOrder" aria-expanded="true" aria-controls="collapseTwo">
<span>{{ __('Transaction Management') }}</span>
</a>
<div id="collapseOrder" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/orders') || request()->is('admin/orders/*') ? 'active' : '' }}" href="{{ route('admin.orders.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Orders') }}</a>
<a class="collapse-item {{ request()->is('admin/booking') || request()->is('admin/booking/*') ? 'active' : '' }}" href="{{ route('admin.booking.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Booking') }}</a>
</div>
</div>
</li>
</ul>
</ul>

Some files were not shown because too many files have changed in this diff Show More