bug fix import voucher update

dev
Aji Kamaludin 1 year ago
parent f5519657db
commit 4138f22f0d
No known key found for this signature in database
GPG Key ID: 19058F67F0083AD3

@ -4,14 +4,14 @@ namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Models\Notification;
use Illuminate\Http\Request;
class NotificationController extends Controller
{
public function update(Notification $notif)
{
if ($notif->id == null) {
(new Notification())->mark_all_as_read();
(new Notification)->mark_all_as_read();
return;
}
$notif->mark_as_read();

@ -15,7 +15,7 @@ class CoinRewardController extends Controller
return inertia('CoinReward/Index', [
'query' => $query->paginate(),
'levels' => CustomerLevel::all()
'levels' => CustomerLevel::all(),
]);
}

@ -71,7 +71,7 @@ class AuthController extends Controller
'fullname' => $user->name,
'name' => $user->nickname,
'email' => $user->email,
'username' => Str::slug($user->name . '_' . Str::random(5), '_'),
'username' => Str::slug($user->name.'_'.Str::random(5), '_'),
'google_id' => $user->id,
'google_oauth_response' => json_encode($user),
]);
@ -97,7 +97,7 @@ class AuthController extends Controller
'phone' => 'required|numeric',
'username' => 'required|string|min:5|alpha_dash|unique:customers,username',
'password' => 'required|string|min:8|confirmed',
'referral_code' => 'nullable|exists:customers,referral_code'
'referral_code' => 'nullable|exists:customers,referral_code',
]);
DB::beginTransaction();
@ -114,7 +114,7 @@ class AuthController extends Controller
$refferal = Customer::where('referral_code', $request->referral_code)->first();
$refferal->customerRefferals()->create([
'refferal_id' => $customer->id,
'customer_code' => $refferal->referral_code
'customer_code' => $refferal->referral_code,
]);
$affilateEnabled = Setting::getByKey('AFFILATE_ENABLED');
@ -122,7 +122,7 @@ class AuthController extends Controller
$bonusCoin = Setting::getByKey('AFFILATE_COIN_AMOUNT');
$coin = $refferal->coins()->create([
'debit' => $bonusCoin,
'description' => 'Bonus Refferal #' . Str::random(5),
'description' => 'Bonus Refferal #'.Str::random(5),
]);
$coin->update_customer_balance();

@ -3,7 +3,6 @@
namespace App\Http\Controllers\Customer;
use App\Http\Controllers\Controller;
use App\Models\CoinHistory;
use App\Models\CoinReward;
use App\Models\Customer;
use App\Models\DepositHistory;
@ -19,7 +18,6 @@ class CartController extends Controller
* show list of item in cart
* has payed button
* show payment method -> deposit, coin, paylater
*
*/
public function index()
{
@ -41,7 +39,6 @@ class CartController extends Controller
/**
* handle cart add, remove or sub
*
*/
public function store(Request $request, Voucher $voucher)
{
@ -113,10 +110,11 @@ class CartController extends Controller
$batchCount = $item['voucher']->count_unsold();
if ($batchCount < $item['quantity']) {
session()->remove('carts');
return redirect()->route('home.index')
->with('message', ['type' => 'error', 'message' => 'transaksi gagal, voucher sedang tidak tersedia']);
}
};
}
$total = $carts->sum(function ($item) {
return $item['quantity'] * $item['voucher']->validate_price;
@ -127,6 +125,7 @@ class CartController extends Controller
$paylater_limit = (int) $customer->paylater_limit;
if (($paylater_limit + $customer->deposit_balance) < $total) {
session()->remove('carts');
return redirect()->route('home.index')
->with('message', ['type' => 'error', 'message' => 'transaksi gagal, pembayaran ditolak']);
}
@ -167,13 +166,13 @@ class CartController extends Controller
if ($bonus != null) {
$coin = $customer->coins()->create([
'debit' => $bonus->bonus_coin,
'description' => 'Bonus Pembelian #' . $sale->code,
'description' => 'Bonus Pembelian #'.$sale->code,
]);
$coin->update_customer_balance();
}
$description = 'Pembayaran #' . $sale->code;
$description = 'Pembayaran #'.$sale->code;
if ($customer->deposit_balance < $total) {
if ($customer->deposit_balance > 0) {
@ -191,7 +190,7 @@ class CartController extends Controller
$payedWithPaylater = $total - $customer->deposit_balance;
$paylater = $customer->paylaterHistories()->create([
'debit' => $payedWithPaylater,
'description' => $description
'description' => $description,
]);
$paylater->update_customer_paylater();

@ -4,7 +4,6 @@ namespace App\Http\Controllers\Customer;
use App\Http\Controllers\Controller;
use App\Models\CoinHistory;
use Illuminate\Http\Request;
class CoinController extends Controller
{

@ -9,7 +9,6 @@ use App\Models\Sale;
use App\Models\Voucher;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
class CoinExchangeController extends Controller
{
@ -53,7 +52,7 @@ class CoinExchangeController extends Controller
DB::beginTransaction();
$sale = $customer->sales()->create([
'code' => 'Tukar Coin ' . str()->upper(str()->random(5)),
'code' => 'Tukar Coin '.str()->upper(str()->random(5)),
'date_time' => now(),
'amount' => 0,
'payed_with' => Sale::PAYED_WITH_COIN,
@ -68,7 +67,7 @@ class CoinExchangeController extends Controller
'additional_info_json' => json_encode([
'id' => $voucher->id,
'quantity' => 1,
'voucher' => $voucher->load(['location'])
'voucher' => $voucher->load(['location']),
]),
]);

@ -48,7 +48,7 @@ class DepositController extends Controller
$deposit = DepositHistory::make([
'customer_id' => auth()->id(),
'debit' => $request->amount,
'description' => 'Top Up #' . Str::random(5),
'description' => 'Top Up #'.Str::random(5),
'payment_channel' => $request->payment,
]);

@ -47,7 +47,7 @@ class HomeController extends Controller
Notification::where('entity_id', auth()->id())->where('is_read', Notification::UNREAD)->update(['is_read' => Notification::READ]);
return inertia('Index/Notification', [
'notification' => Notification::where('entity_id', auth()->id())->orderBy('created_at', 'desc')->paginate()
'notification' => Notification::where('entity_id', auth()->id())->orderBy('created_at', 'desc')->paginate(),
]);
}
}

@ -26,7 +26,7 @@ class ProfileController extends Controller
'name' => 'string|required',
'address' => 'string|required',
'phone' => 'string|required|numeric',
'username' => 'string|required|min:5|alpha_dash|unique:customers,username,' . $customer->id,
'username' => 'string|required|min:5|alpha_dash|unique:customers,username,'.$customer->id,
'password' => 'nullable|string|min:8|confirmed',
'image' => 'nullable|image',
]);

@ -20,7 +20,7 @@ class TransactionController extends Controller
public function show(Sale $sale)
{
return inertia('Trx/Detail', [
'sale' => $sale->load(['items.voucher.location'])
'sale' => $sale->load(['items.voucher.location']),
]);
}
}

@ -59,14 +59,14 @@ class CustomerController extends Controller
{
return inertia('Customer/Form', [
'customer' => $customer->load(['level']),
'levels' => CustomerLevel::all()
'levels' => CustomerLevel::all(),
]);
}
public function update(Request $request, Customer $customer)
{
$request->validate([
'username' => 'required|string|min:5|alpha_dash|unique:customers,username,' . $customer->id,
'username' => 'required|string|min:5|alpha_dash|unique:customers,username,'.$customer->id,
'password' => 'nullable|string|min:8',
'name' => 'required|string',
'fullname' => 'required|string',
@ -121,7 +121,7 @@ class CustomerController extends Controller
$customer->paylater()->updateOrCreate([
'customer_id' => $customer->id,
], [
'limit' => $request->paylater_limit
'limit' => $request->paylater_limit,
]);
return redirect()->route('customer.index')

@ -66,7 +66,7 @@ class GeneralController extends Controller
->orderBy('date_time', 'asc')
->groupBy(DB::raw("strftime('%m/%d/%Y', date_time)"));
// filter lokasi
// filter lokasi
if ($request->location_id != '') {
$charts->whereHas('items', function ($q) use ($request) {
$q->join('vouchers', 'vouchers.id', '=', 'sale_items.entity_id')

@ -3,7 +3,6 @@
namespace App\Http\Controllers;
use App\Models\Notification;
use Illuminate\Http\Request;
class NotificationController extends Controller
{

@ -15,7 +15,7 @@ class VerificationController extends Controller
->orderBy('updated_at', 'desc');
return inertia('Verification/Index', [
'query' => $query->paginate()
'query' => $query->paginate(),
]);
}
@ -28,7 +28,7 @@ class VerificationController extends Controller
return inertia('Verification/Form', [
'customer' => $customer->load(['level']),
'levels' => $levels
'levels' => $levels,
]);
}
@ -43,13 +43,13 @@ class VerificationController extends Controller
$customer->update([
'customer_level_id' => $level->id,
'identity_verified' => Customer::VERIFIED
'identity_verified' => Customer::VERIFIED,
]);
$customer->paylater()->updateOrCreate([
'customer_id' => $customer->id,
], [
'limit' => $request->paylater_limit
'limit' => $request->paylater_limit,
]);
return redirect()->route('customer-verification.index')

@ -33,7 +33,7 @@ class VoucherController extends Controller
public function create()
{
return inertia('Voucher/Form', [
'levels' => CustomerLevel::all()
'levels' => CustomerLevel::all(),
]);
}
@ -55,7 +55,7 @@ class VoucherController extends Controller
'expired_unit' => 'required|string',
'prices' => 'nullable|array',
'prices.*.customer_level_id' => 'required|exists:customer_levels,id',
'prices.*.display_price' => 'required|numeric'
'prices.*.display_price' => 'required|numeric',
]);
DB::beginTransaction();
@ -96,7 +96,7 @@ class VoucherController extends Controller
{
return inertia('Voucher/Form', [
'voucher' => $voucher->load(['prices.level']),
'levels' => CustomerLevel::all()
'levels' => CustomerLevel::all(),
]);
}
@ -118,11 +118,13 @@ class VoucherController extends Controller
'expired_unit' => 'required|string',
'prices' => 'nullable|array',
'prices.*.customer_level_id' => 'required|exists:customer_levels,id',
'prices.*.display_price' => 'required|numeric'
'prices.*.display_price' => 'required|numeric',
]);
DB::beginTransaction();
$voucher->update([
$vouchers = Voucher::where('batch_id', $voucher->batch_id);
$vouchers->update([
'name' => $request->name,
'description' => $request->description,
'location_id' => $request->location_id,
@ -137,17 +139,19 @@ class VoucherController extends Controller
'expired' => $request->expired,
]);
$voucher->prices()->delete();
foreach (collect($request->prices) as $price) {
$finalPrice = $price['display_price'];
if ($voucher->discount > 0) {
$finalPrice = $finalPrice - round($finalPrice * ($voucher->discount / 100), 2);
foreach ($vouchers->get() as $voucher) {
$voucher->prices()->delete();
foreach (collect($request->prices) as $price) {
$finalPrice = $price['display_price'];
if ($voucher->discount > 0) {
$finalPrice = $finalPrice - round($finalPrice * ($voucher->discount / 100), 2);
}
$voucher->prices()->create([
'customer_level_id' => $price['customer_level_id'],
'price' => $finalPrice,
'display_price' => $price['display_price'],
]);
}
$voucher->prices()->create([
'customer_level_id' => $price['customer_level_id'],
'price' => $finalPrice,
'display_price' => $price['display_price'],
]);
}
DB::commit();
@ -166,7 +170,7 @@ class VoucherController extends Controller
public function form_import()
{
return inertia('Voucher/Import', [
'levels' => CustomerLevel::all()
'levels' => CustomerLevel::all(),
]);
}
@ -182,7 +186,7 @@ class VoucherController extends Controller
'expired_unit' => 'required|string',
'prices' => 'nullable|array',
'prices.*.customer_level_id' => 'required|exists:customer_levels,id',
'prices.*.display_price' => 'required|numeric'
'prices.*.display_price' => 'required|numeric',
]);
$batchId = Str::ulid();

@ -36,7 +36,6 @@ class CoinHistory extends Model
});
}
public function amount(): Attribute
{
return Attribute::make(get: function () {

@ -126,7 +126,7 @@ class Customer extends Authenticatable
return ' - ';
}
return '+62' . $this->phone;
return '+62'.$this->phone;
});
}
@ -150,6 +150,7 @@ class Customer extends Authenticatable
if ($this->is_allow_paylater) {
return $this->paylater->limit - $this->paylater->usage;
}
return '';
});
}
@ -167,7 +168,7 @@ class Customer extends Authenticatable
return [
self::VERIFIED => 'Terverifikasi',
self::IN_VERICATION => 'Menunggu Verifikasi',
self::NOT_VERIFIED => 'Tidak Terverifikasi'
self::NOT_VERIFIED => 'Tidak Terverifikasi',
][$this->identity_verified];
});
}
@ -233,13 +234,13 @@ class Customer extends Authenticatable
$paylater = $this->paylaterHistories()->create([
'credit' => $cut,
'description' => $deposit->description . " (Pengembalian)",
'description' => $deposit->description.' (Pengembalian)',
]);
$paylater->update_customer_paylater();
$deposit = $this->deposites()->create([
'credit' => $cut,
'description' => 'Pembayaran Paylater'
'description' => 'Pembayaran Paylater',
]);
$deposit->update_customer_balance();
}

@ -6,7 +6,7 @@ class CustomerRefferal extends Model
{
protected $fillable = [
'customer_id', //customer has code
'refferal_id', //customer use the code
'refferal_id', //customer use the code
'customer_code', //code of referal
];
}

@ -76,10 +76,10 @@ class DepositHistory extends Model
{
return Attribute::make(get: function () {
if ($this->credit == 0) {
return 'Rp' . number_format($this->debit, is_float($this->debit) ? 2 : 0, ',', '.');
return 'Rp'.number_format($this->debit, is_float($this->debit) ? 2 : 0, ',', '.');
}
return '-Rp' . number_format($this->credit, is_float($this->credit) ? 2 : 0, ',', '.');
return '-Rp'.number_format($this->credit, is_float($this->credit) ? 2 : 0, ',', '.');
});
}
@ -109,20 +109,20 @@ class DepositHistory extends Model
public function create_notification()
{
if ($this->payment_channel == Setting::PAYMENT_MANUAL) {
$status = "";
$status = '';
if ($this->is_valid == self::STATUS_WAIT_APPROVE) {
$status = " (bukti bayar di upload, membutuhkan konfirmasi)";
$status = ' (bukti bayar di upload, membutuhkan konfirmasi)';
}
Notification::create([
'entity_type' => User::class,
'description' => $this->customer->fullname . ' melakukan deposit manual sebesar : ' . $this->amount . $status,
'description' => $this->customer->fullname.' melakukan deposit manual sebesar : '.$this->amount.$status,
]);
}
if ($this->payment_channel == Setting::PAYMENT_MIDTRANS) {
Notification::create([
'entity_type' => User::class,
'description' => $this->customer->fullname . ' melakukan deposit via midtrans sebesar : ' . $this->amount,
'description' => $this->customer->fullname.' melakukan deposit via midtrans sebesar : '.$this->amount,
]);
}
}
@ -131,7 +131,7 @@ class DepositHistory extends Model
{
Notification::create([
'entity_id' => $this->customer_id,
'description' => 'Deposit ' . $this->description . ' sebesar ' . $this->amount . ' sudah sukses diterima',
'description' => 'Deposit '.$this->description.' sebesar '.$this->amount.' sudah sukses diterima',
]);
}
}

@ -8,6 +8,7 @@ use Illuminate\Support\Carbon;
class Notification extends Model
{
const UNREAD = 0;
const READ = 1;
protected $fillable = [
@ -18,7 +19,7 @@ class Notification extends Model
];
protected $appends = [
'format_created_at'
'format_created_at',
];
public function mark_as_read()

@ -45,10 +45,10 @@ class PaylaterHistory extends Model
{
return Attribute::make(get: function () {
if ($this->credit == 0) {
return 'Rp' . number_format($this->debit, is_float($this->debit) ? 2 : 0, ',', '.');
return 'Rp'.number_format($this->debit, is_float($this->debit) ? 2 : 0, ',', '.');
}
return '-Rp' . number_format($this->credit, is_float($this->credit) ? 2 : 0, ',', '.');
return '-Rp'.number_format($this->credit, is_float($this->credit) ? 2 : 0, ',', '.');
});
}
}

@ -30,7 +30,6 @@ class Sale extends Model
'payment_type',
];
protected $appends = [
'format_human_created_at',
'format_created_at',
@ -64,7 +63,7 @@ class Sale extends Model
public function displayAmount(): Attribute
{
return Attribute::make(get: function () {
return 'Rp' . number_format($this->amount, is_float($this->amount) ? 2 : 0, ',', '.');
return 'Rp'.number_format($this->amount, is_float($this->amount) ? 2 : 0, ',', '.');
});
}
@ -73,12 +72,12 @@ class Sale extends Model
if ($this->payed_with == self::PAYED_WITH_COIN) {
Notification::create([
'entity_type' => User::class,
'description' => $this->customer->fullname . ' melakukan penukaran ' . $this->items()->count() . ' voucher sebesar ' . $this->items->value('price') . ' coin',
'description' => $this->customer->fullname.' melakukan penukaran '.$this->items()->count().' voucher sebesar '.$this->items->value('price').' coin',
]);
Notification::create([
'entity_id' => auth()->id(),
'description' => 'Transaksi ' . $this->code . ' berhasil',
'description' => 'Transaksi '.$this->code.' berhasil',
]);
return;
@ -86,12 +85,12 @@ class Sale extends Model
Notification::create([
'entity_type' => User::class,
'description' => $this->customer->fullname . ' melakukan pembelian ' . $this->items()->count() . ' voucher sebesar ' . $this->display_amount,
'description' => $this->customer->fullname.' melakukan pembelian '.$this->items()->count().' voucher sebesar '.$this->display_amount,
]);
Notification::create([
'entity_id' => auth()->id(),
'description' => 'Transaksi pembelian anda #' . $this->code . ' sebesar ' . $this->display_amount . ' berhasil',
'description' => 'Transaksi pembelian anda #'.$this->code.' sebesar '.$this->display_amount.' berhasil',
]);
}
}

@ -41,21 +41,21 @@ class SaleItem extends Model
if ($item == null) {
return '';
}
$string = "Hai, aku baru beli voucher {$item->voucher->location->name} di " . route('home.index');
$string = "Hai, aku baru beli voucher {$item->voucher->location->name} di ".route('home.index');
$string .= " voucher {$item->voucher->display_quota} buat {$item->voucher->display_expired}
Username : {$item->voucher->username}
Password : {$item->voucher->password}
";
$string .= "Cuman Rp" . number_format($this->price, is_float($this->price) ? 2 : 0, ',', '.') . " aja, ";
$string .= 'Cuman Rp'.number_format($this->price, is_float($this->price) ? 2 : 0, ',', '.').' aja, ';
if ($item->voucher->discount > 0) {
$string .= "lagi ada discount {$item->voucher->discount}% loh.
";
}
$string .= "dapatkat penawaran voucher lainnya di " . route('home.index');
$string .= 'dapatkat penawaran voucher lainnya di '.route('home.index');
return $string;
});

@ -63,14 +63,14 @@ class Voucher extends Model
public function displayQuota(): Attribute
{
return Attribute::make(get: function () {
return round($this->quota / (1024 * 1024 * 1024), 2) . ' GB';
return round($this->quota / (1024 * 1024 * 1024), 2).' GB';
});
}
public function displayExpired(): Attribute
{
return Attribute::make(get: function () {
return $this->expired . ' ' . $this->expired_unit;
return $this->expired.' '.$this->expired_unit;
});
}
@ -80,6 +80,7 @@ class Voucher extends Model
if (auth('customer')->check()) {
if ($this->prices()->count() > 0) {
$price = $this->prices()->where('customer_level_id', auth()->user()->customer_level_id)->value('price');
return $price;
}
}
@ -94,6 +95,7 @@ class Voucher extends Model
if (auth('customer')->check()) {
if ($this->prices()->count() > 0) {
$price = $this->prices()->where('customer_level_id', auth()->user()->customer_level_id)->value('display_price');
return $price;
}
}
@ -116,7 +118,7 @@ class Voucher extends Model
{
$voucher = Voucher::where([
['is_sold', '=', self::UNSOLD],
['batch_id', '=', $this->batch_id]
['batch_id', '=', $this->batch_id],
])->first();
return $voucher;
@ -126,7 +128,7 @@ class Voucher extends Model
{
$voucher = Voucher::where([
['is_sold', '=', self::UNSOLD],
['batch_id', '=', $this->batch_id]
['batch_id', '=', $this->batch_id],
])->count();
return $voucher;
@ -136,7 +138,7 @@ class Voucher extends Model
{
$count = Voucher::where([
['is_sold', '=', self::UNSOLD],
['batch_id', '=', $this->batch_id]
['batch_id', '=', $this->batch_id],
])->count();
$treshold = Setting::getByKey('VOUCHER_STOCK_NOTIFICATION');
@ -144,7 +146,7 @@ class Voucher extends Model
if ($count <= $treshold) {
Notification::create([
'entity_type' => User::class,
'description' => "stok voucher " . $this->location->name . " ( " . $this->profile . " ) " . "tersisa : " . $count,
'description' => 'stok voucher '.$this->location->name.' ( '.$this->profile.' ) '.'tersisa : '.$count,
]);
}
}

@ -208,7 +208,7 @@ return [
'send_livewire_failed_validation' => [
'enabled' => env('DS_SEND_LIVEWIRE_FAILED_VALIDATION', false),
'sleep' => env('DS_SEND_LIVEWIRE_FAILED_VALIDATION_SLEEP', 400),
'sleep' => env('DS_SEND_LIVEWIRE_FAILED_VALIDATION_SLEEP', 400),
],
/*
@ -271,27 +271,27 @@ return [
'ide_handlers' => [
'atom' => [
'handler' => 'atom://core/open/file?filename=',
'handler' => 'atom://core/open/file?filename=',
'line_separator' => '&line=',
],
'phpstorm' => [
'handler' => 'phpstorm://open?file=',
'handler' => 'phpstorm://open?file=',
'line_separator' => '&line=',
],
'sublime' => [
'handler' => 'subl://open?url=file://',
'handler' => 'subl://open?url=file://',
'line_separator' => '&line=',
],
'vscode' => [
'handler' => 'vscode://file/',
'handler' => 'vscode://file/',
'line_separator' => ':',
],
'vscode_remote' => [
'handler' => 'vscode://vscode-remote/',
'handler' => 'vscode://vscode-remote/',
'line_separator' => ':',
'local_path' => 'wsl+' . env('DS_PREFERRED_WSL_DISTRO', 'Ubuntu20.04LTS'),
'remote_path' => env('DS_REMOTE_PATH', null),
'work_dir' => env('DS_WORKDIR', '/var/www/html'),
'local_path' => 'wsl+'.env('DS_PREFERRED_WSL_DISTRO', 'Ubuntu20.04LTS'),
'remote_path' => env('DS_REMOTE_PATH', null),
'work_dir' => env('DS_WORKDIR', '/var/www/html'),
],
],
@ -404,13 +404,13 @@ return [
*/
'level_log_colors_map' => [
'error' => env('DS_LOG_COLOR_ERROR', 'border-red-600'),
'critical' => env('DS_LOG_COLOR_CRITICAL', 'border-red-900'),
'alert' => env('DS_LOG_COLOR_ALERT', 'border-red-500'),
'error' => env('DS_LOG_COLOR_ERROR', 'border-red-600'),
'critical' => env('DS_LOG_COLOR_CRITICAL', 'border-red-900'),
'alert' => env('DS_LOG_COLOR_ALERT', 'border-red-500'),
'emergency' => env('DS_LOG_COLOR_EMERGENCY', 'border-red-600'),
'warning' => env('DS_LOG_COLOR_WARNING', 'border-orange-300'),
'notice' => env('DS_LOG_COLOR_NOTICE', 'border-green-300'),
'info' => env('DS_LOG_COLOR_INFO', 'border-blue-300'),
'debug' => env('DS_LOG_COLOR_INFO', 'border-black'),
'warning' => env('DS_LOG_COLOR_WARNING', 'border-orange-300'),
'notice' => env('DS_LOG_COLOR_NOTICE', 'border-green-300'),
'info' => env('DS_LOG_COLOR_INFO', 'border-blue-300'),
'debug' => env('DS_LOG_COLOR_INFO', 'border-black'),
],
];

@ -41,8 +41,8 @@ class DummySeeder extends Seeder
$images = ['1.webp', '2.webp', '3.webp'];
foreach ($images as $index => $image) {
Banner::create([
'title' => 'Banner ' . $index,
'image' => 'sample/' . $image,
'title' => 'Banner '.$index,
'image' => 'sample/'.$image,
'description' => '<h1>Banner </h1>',
]);
}

@ -1,22 +1,22 @@
<?php
use App\Http\Controllers\AccountController;
use App\Http\Controllers\NotificationController;
use App\Http\Controllers\Auth\AuthenticatedSessionController;
use App\Http\Controllers\BannerController;
use App\Http\Controllers\CoinRewardController;
use App\Http\Controllers\CustomerController;
use App\Http\Controllers\CustomerLevelController;
use App\Http\Controllers\VerificationController;
use App\Http\Controllers\DepositController;
use App\Http\Controllers\GeneralController;
use App\Http\Controllers\InfoController;
use App\Http\Controllers\LocationController;
use App\Http\Controllers\NotificationController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\RoleController;
use App\Http\Controllers\SaleController;
use App\Http\Controllers\SettingController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\VerificationController;
use App\Http\Controllers\VoucherController;
use Illuminate\Support\Facades\Route;

@ -1,10 +1,10 @@
<?php
use App\Http\Controllers\Api\CustomerController;
use App\Http\Controllers\Api\LocationController;
use App\Http\Controllers\Api\NotificationController;
use App\Http\Controllers\Api\RoleController;
use App\Http\Controllers\Customer\DepositController;
use App\Http\Controllers\Api\CustomerController;
use App\Http\Controllers\Api\NotificationController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

@ -41,7 +41,7 @@ Route::middleware(['http_secure_aware', 'guard_should_customer', 'inertia.custom
// logout
Route::post('logout', [AuthController::class, 'destroy'])->name('customer.logout');
// paylater
// paylater
Route::get('paylater', [PaylaterController::class, 'index'])->name('customer.paylater.index');
Route::get('paylater/trx/{paylater}', [PaylaterController::class, 'show'])->name('customer.paylater.show');
@ -58,7 +58,6 @@ Route::middleware(['http_secure_aware', 'guard_should_customer', 'inertia.custom
Route::get('coin', [CoinController::class, 'index'])->name('customer.coin.index');
Route::get('coin/{coin}', [CoinController::class, 'show'])->name('customer.coin.show');
// cart
Route::get('cart', [CartController::class, 'index'])->name('cart.index');
Route::post('cart/process', [CartController::class, 'purchase'])->name('cart.purchase');

Loading…
Cancel
Save