diff --git a/config/.gitignore b/config/.gitignore new file mode 100644 index 000000000..179ac6036 --- /dev/null +++ b/config/.gitignore @@ -0,0 +1,13 @@ +db-blade-compiler.php +debugbar.php +dompdf.php +excel.php +flare.php +ignition.php +image.php +imagecache.php +jwt.php +repository.php +scout.php +tinker.php +translatable.php \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php b/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php index a22c8e69d..6ed7cb881 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php @@ -79,6 +79,7 @@ class ConfigurationController extends Controller { if (! request()->route('slug')) { $firstItem = current($this->configTree->items); + $secondItem = current($firstItem['children']); return $this->getSlugs($secondItem); @@ -109,6 +110,7 @@ class ConfigurationController extends Controller foreach ($data['sales']['carriers'] as $carrier) { if ($carrier['active']) { $atLeastOneCarrierEnabled = true; + break; } } diff --git a/packages/Webkul/Admin/src/Http/Controllers/Customer/AddressController.php b/packages/Webkul/Admin/src/Http/Controllers/Customer/AddressController.php index d9534868b..dfe05ea40 100644 --- a/packages/Webkul/Admin/src/Http/Controllers/Customer/AddressController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Customer/AddressController.php @@ -73,8 +73,6 @@ class AddressController extends Controller 'address1' => implode(PHP_EOL, array_filter(request()->input('address1'))), ]); - $data = collect(request()->input())->except('_token')->toArray(); - $this->validate(request(), [ 'company_name' => 'string', 'address1' => 'string|required', @@ -86,10 +84,10 @@ class AddressController extends Controller 'vat_id' => new VatIdRule(), ]); - if ($this->customerAddressRepository->create($data)) { + if ($this->customerAddressRepository->create(request()->all())) { session()->flash('success', trans('admin::app.customers.addresses.success-create')); - return redirect()->route('admin.customer.edit', ['id' => $data['customer_id']]); + return redirect()->route('admin.customer.edit', ['id' => request('customer_id')]); } else { session()->flash('success', trans('admin::app.customers.addresses.error-create')); @@ -131,18 +129,11 @@ class AddressController extends Controller 'vat_id' => new VatIdRule(), ]); - $data = collect(request()->input())->except('_token')->toArray(); + $this->customerAddressRepository->update(request()->all(), $id); - $address = $this->customerAddressRepository->find($id); + session()->flash('success', trans('admin::app.customers.addresses.success-update')); - if ($address) { - $this->customerAddressRepository->update($data, $id); - - session()->flash('success', trans('admin::app.customers.addresses.success-update')); - - return redirect()->route('admin.customer.addresses.index', ['id' => $address->customer_id]); - } - return redirect()->route($this->_config['redirect']); + return redirect()->route('admin.customer.addresses.index', ['id' => $address->customer_id]); } /** @@ -157,7 +148,7 @@ class AddressController extends Controller return response()->json([ 'redirect' => false, - 'message' => trans('admin::app.customers.addresses.success-delete') + 'message' => trans('admin::app.customers.addresses.success-delete') ]); } diff --git a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php index 29a564394..5f0628536 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php @@ -8,8 +8,6 @@ use Webkul\Admin\DataGrids\CustomerOrderDataGrid; use Webkul\Admin\DataGrids\CustomersInvoicesDataGrid; use Webkul\Admin\Http\Controllers\Controller; use Webkul\Admin\Mail\NewCustomerNotification; -use Webkul\Core\Repositories\ChannelRepository; -use Webkul\Customer\Repositories\CustomerAddressRepository; use Webkul\Customer\Repositories\CustomerGroupRepository; use Webkul\Customer\Repositories\CustomerRepository; @@ -26,15 +24,11 @@ class CustomerController extends Controller * Create a new controller instance. * * @param \Webkul\Customer\Repositories\CustomerRepository $customerRepository - * @param \Webkul\Customer\Repositories\CustomerAddressRepository $customerAddressRepository * @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository - * @param \Webkul\Core\Repositories\ChannelRepository $channelRepository */ public function __construct( protected CustomerRepository $customerRepository, - protected CustomerAddressRepository $customerAddressRepository, - protected CustomerGroupRepository $customerGroupRepository, - protected ChannelRepository $channelRepository + protected CustomerGroupRepository $customerGroupRepository ) { $this->_config = request('_config'); @@ -61,11 +55,9 @@ class CustomerController extends Controller */ public function create() { - $customerGroup = $this->customerGroupRepository->findWhere([['code', '<>', 'guest']]); + $groups = $this->customerGroupRepository->findWhere([['code', '<>', 'guest']]); - $channelName = $this->channelRepository->all(); - - return view($this->_config['view'], compact('customerGroup', 'channelName')); + return view($this->_config['view'], compact('groups')); } /** @@ -83,18 +75,16 @@ class CustomerController extends Controller 'date_of_birth' => 'date|before:today', ]); - $data = request()->all(); - $password = rand(100000, 10000000); - $data['password'] = bcrypt($password); - - $data['is_verified'] = 1; - - $customer = $this->customerRepository->create($data); + $customer = $this->customerRepository->create(array_merge(request()->all() , [ + 'password' => bcrypt($password), + 'is_verified' => 1, + ])); try { $configKey = 'emails.general.notifications.emails.general.notifications.customer'; + if (core()->getConfigData($configKey)) { Mail::queue(new NewCustomerNotification($customer, $password)); } @@ -116,11 +106,10 @@ class CustomerController extends Controller public function edit($id) { $customer = $this->customerRepository->findOrFail($id); - $address = $this->customerAddressRepository->find($id); - $customerGroup = $this->customerGroupRepository->findWhere([['code', '<>', 'guest']]); - $channelName = $this->channelRepository->all(); - return view($this->_config['view'], compact('customer', 'address', 'customerGroup', 'channelName')); + $groups = $this->customerGroupRepository->findWhere([['code', '<>', 'guest']]); + + return view($this->_config['view'], compact('customer', 'groups')); } /** @@ -139,13 +128,10 @@ class CustomerController extends Controller 'date_of_birth' => 'date|before:today', ]); - $data = request()->all(); - - $data['status'] = ! isset($data['status']) ? 0 : 1; - - $data['is_suspended'] = ! isset($data['is_suspended']) ? 0 : 1; - - $this->customerRepository->update($data, $id); + $this->customerRepository->update(array_merge(request()->all(), [ + 'status' => isset($data['status']), + 'is_suspended' => isset($data['is_suspended']), + ]), $id); session()->flash('success', trans('admin::app.response.update-success', ['name' => 'Customer'])); @@ -203,11 +189,7 @@ class CustomerController extends Controller $noteTaken = $customer->update(['notes' => request()->input('notes')]); - if ($noteTaken) { - session()->flash('success', 'Note taken'); - } else { - session()->flash('error', 'Note cannot be taken'); - } + session()->flash('success', 'Note taken'); return redirect()->route($this->_config['redirect']); } @@ -220,6 +202,7 @@ class CustomerController extends Controller public function massUpdate() { $customerIds = explode(',', request()->input('indexes')); + $updateOption = request()->input('update-options'); foreach ($customerIds as $customerId) { @@ -254,6 +237,7 @@ class CustomerController extends Controller } session()->flash('error', trans('admin::app.response.order-pending', ['name' => 'Customers'])); + return redirect()->back(); } diff --git a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php index d43ad4fee..cfd122bf7 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php @@ -62,11 +62,9 @@ class CustomerGroupController extends Controller 'name' => 'required', ]); - $data = request()->all(); - - $data['is_user_defined'] = 1; - - $this->customerGroupRepository->create($data); + $this->customerGroupRepository->create(array_merge(request()->all() , [ + 'is_user_defined' => 1, + ])); session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Customer Group'])); @@ -116,13 +114,13 @@ class CustomerGroupController extends Controller { $customerGroup = $this->customerGroupRepository->findOrFail($id); - if ($customerGroup->is_user_defined == 0) { + if (! $customerGroup->is_user_defined) { return response()->json([ 'message' => trans('admin::app.customers.customers.group-default'), ], 400); } - if (count($customerGroup->customers) > 0) { + if ($customerGroup->customers->count()) { return response()->json([ 'message' => trans('admin::app.response.customer-associate', ['name' => 'Customer Group']), ], 400); diff --git a/packages/Webkul/Admin/src/Http/Controllers/ExportController.php b/packages/Webkul/Admin/src/Http/Controllers/ExportController.php index a207ff302..beeb9298e 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/ExportController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/ExportController.php @@ -20,9 +20,7 @@ class ExportController extends Controller $gridName = explode('\\', $criteria['gridName']); - $path = '\Webkul\Admin\DataGrids' . '\\' . last($gridName); - - $gridInstance = app($path); + $gridInstance = app('\Webkul\Admin\DataGrids' . '\\' . last($gridName)); $records = $gridInstance->export(); @@ -34,9 +32,7 @@ class ExportController extends Controller if ($format == 'csv') { return Excel::download(new DataGridExport($records), last($gridName) . '.csv'); - } - - if ($format == 'xls') { + } elseif ($format == 'xls') { return Excel::download(new DataGridExport($records), last($gridName) . '.xlsx'); } diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php index ff21aa646..172f3da6f 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php @@ -99,21 +99,21 @@ class InvoiceController extends Controller 'invoice.items.*' => 'required|numeric|min:0', ]); - $data = request()->all(); - - if (! $this->invoiceRepository->haveProductToInvoice($data)) { + if (! $this->invoiceRepository->haveProductToInvoice(request()->all())) { session()->flash('error', trans('admin::app.sales.invoices.product-error')); return redirect()->back(); } - if (! $this->invoiceRepository->isValidQuantity($data)) { + if (! $this->invoiceRepository->isValidQuantity(request()->all())) { session()->flash('error', trans('admin::app.sales.invoices.invalid-qty')); return redirect()->back(); } - $this->invoiceRepository->create(array_merge($data, ['order_id' => $orderId])); + $this->invoiceRepository->create(array_merge(request()->all(), [ + 'order_id' => $orderId, + ])); session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Invoice'])); @@ -148,15 +148,9 @@ class InvoiceController extends Controller $invoice = $this->invoiceRepository->findOrFail($id); - if ($invoice) { - $this->sendDuplicateInvoiceMail($invoice, $request->email); + $this->sendDuplicateInvoiceMail($invoice, $request->email); - session()->flash('success', __('admin::app.sales.invoices.invoice-sent')); - - return redirect()->back(); - } - - session()->flash('error', __('admin::app.response.something-went-wrong')); + session()->flash('success', trans('admin::app.sales.invoices.invoice-sent')); return redirect()->back(); } diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php index 7708bffe6..f65a12fac 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php @@ -86,15 +86,12 @@ class OrderController extends Controller */ public function comment($id) { - $data = array_merge(request()->all(), [ - 'order_id' => $id, - ]); + Event::dispatch('sales.order.comment.create.before'); - $data['customer_notified'] = isset($data['customer_notified']) ? 1 : 0; - - Event::dispatch('sales.order.comment.create.before', $data); - - $comment = $this->orderCommentRepository->create($data); + $comment = $this->orderCommentRepository->create(array_merge(request()->all(), [ + 'order_id' => $id, + 'customer_notified' => isset($data['customer_notified']), + ])); Event::dispatch('sales.order.comment.create.after', $comment); diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php index feae119ba..8af17fb4c 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php @@ -88,15 +88,15 @@ class ShipmentController extends Controller 'shipment.items.*.*' => 'required|numeric|min:0', ]); - $data = request()->all(); - - if (! $this->isInventoryValidate($data)) { + if (! $this->isInventoryValidate(request()->all())) { session()->flash('error', trans('admin::app.sales.shipments.quantity-invalid')); return redirect()->back(); } - $this->shipmentRepository->create(array_merge($data, ['order_id' => $orderId])); + $this->shipmentRepository->create(array_merge(request()->all(), [ + 'order_id' => $orderId, + ])); session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Shipment'])); @@ -141,7 +141,10 @@ class ShipmentController extends Controller ->where('inventory_source_id', $inventorySourceId) ->sum('qty'); - if ($child->qty_to_ship < $finalQty || $availableQty < $finalQty) { + if ( + $child->qty_to_ship < $finalQty + || $availableQty < $finalQty + ) { return false; } } @@ -150,7 +153,10 @@ class ShipmentController extends Controller ->where('inventory_source_id', $inventorySourceId) ->sum('qty'); - if ($orderItem->qty_to_ship < $qty || $availableQty < $qty) { + if ( + $orderItem->qty_to_ship < $qty + || $availableQty < $qty + ) { return false; } } diff --git a/packages/Webkul/Admin/src/Listeners/PasswordChange.php b/packages/Webkul/Admin/src/Listeners/PasswordChange.php index 88fedf523..6f0a0e919 100644 --- a/packages/Webkul/Admin/src/Listeners/PasswordChange.php +++ b/packages/Webkul/Admin/src/Listeners/PasswordChange.php @@ -5,6 +5,8 @@ namespace Webkul\Admin\Listeners; use Illuminate\Support\Facades\Mail; use Webkul\User\Notifications\AdminUpdatePassword; use Webkul\Customer\Notifications\CustomerUpdatePassword; +use Webkul\Customer\Models\Customer; +use Webkul\User\Models\Admin; class PasswordChange { @@ -17,11 +19,9 @@ class PasswordChange public function sendUpdatePasswordMail($adminOrCustomer) { try { - if ($adminOrCustomer instanceof \Webkul\Customer\Models\Customer) { + if ($adminOrCustomer instanceof Customer) { Mail::queue(new CustomerUpdatePassword($adminOrCustomer)); - } - - if ($adminOrCustomer instanceof \Webkul\User\Models\Admin) { + } elseif ($adminOrCustomer instanceof Admin) { Mail::queue(new AdminUpdatePassword($adminOrCustomer)); } } catch (\Exception $e) { diff --git a/packages/Webkul/Admin/src/Mail/CancelOrderAdminNotification.php b/packages/Webkul/Admin/src/Mail/CancelOrderAdminNotification.php index b7f671107..0022c9574 100644 --- a/packages/Webkul/Admin/src/Mail/CancelOrderAdminNotification.php +++ b/packages/Webkul/Admin/src/Mail/CancelOrderAdminNotification.php @@ -21,8 +21,8 @@ class CancelOrderAdminNotification extends Mailable public function build() { return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) - ->to(core()->getAdminEmailDetails()['email']) - ->subject(trans('shop::app.mail.order.cancel.subject')) - ->view('shop::emails.sales.order-cancel-admin'); + ->to(core()->getAdminEmailDetails()['email']) + ->subject(trans('shop::app.mail.order.cancel.subject')) + ->view('shop::emails.sales.order-cancel-admin'); } } \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Mail/CancelOrderNotification.php b/packages/Webkul/Admin/src/Mail/CancelOrderNotification.php index 2cb0810a0..f649be5a2 100644 --- a/packages/Webkul/Admin/src/Mail/CancelOrderNotification.php +++ b/packages/Webkul/Admin/src/Mail/CancelOrderNotification.php @@ -22,8 +22,8 @@ class CancelOrderNotification extends Mailable public function build() { return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) - ->to($this->order->customer_email, $this->order->customer_full_name) - ->subject(trans('shop::app.mail.order.cancel.subject')) - ->view('shop::emails.sales.order-cancel'); + ->to($this->order->customer_email, $this->order->customer_full_name) + ->subject(trans('shop::app.mail.order.cancel.subject')) + ->view('shop::emails.sales.order-cancel'); } } \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Mail/DuplicateInvoiceNotification.php b/packages/Webkul/Admin/src/Mail/DuplicateInvoiceNotification.php index dda983a65..6d7569fe9 100755 --- a/packages/Webkul/Admin/src/Mail/DuplicateInvoiceNotification.php +++ b/packages/Webkul/Admin/src/Mail/DuplicateInvoiceNotification.php @@ -21,7 +21,8 @@ class DuplicateInvoiceNotification extends Mailable public $invoice, public $customerEmail ) - {} + { + } /** * Build the message. diff --git a/packages/Webkul/Admin/src/Mail/InvoiceOverdueReminder.php b/packages/Webkul/Admin/src/Mail/InvoiceOverdueReminder.php index ecf78ed9d..02a81fb9b 100644 --- a/packages/Webkul/Admin/src/Mail/InvoiceOverdueReminder.php +++ b/packages/Webkul/Admin/src/Mail/InvoiceOverdueReminder.php @@ -16,12 +16,15 @@ class InvoiceOverdueReminder extends Mailable * * @param \Webkul\Customer\Contracts\Customer $customer * @param \Webkul\Sales\Contracts\Invoice $invoice + * @return void */ public function __construct( public $customer, public $invoice ) - {} + { + + } /** * Build the message. @@ -31,8 +34,11 @@ class InvoiceOverdueReminder extends Mailable public function build() { return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) - ->to($this->customer->email) - ->subject(trans('shop::app.mail.invoice.reminder.subject')) - ->view('shop::emails.customer.invoice-reminder')->with(['customer' => $this->customer, 'invoice' => $this->invoice]); + ->to($this->customer->email) + ->subject(trans('shop::app.mail.invoice.reminder.subject')) + ->view('shop::emails.customer.invoice-reminder')->with([ + 'customer' => $this->customer, + 'invoice' => $this->invoice, + ]); } } \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Mail/NewAdminNotification.php b/packages/Webkul/Admin/src/Mail/NewAdminNotification.php index 48698f43d..a410568bd 100644 --- a/packages/Webkul/Admin/src/Mail/NewAdminNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewAdminNotification.php @@ -29,8 +29,8 @@ class NewAdminNotification extends Mailable public function build() { return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) - ->to(core()->getAdminEmailDetails()['email']) - ->subject(trans('shop::app.mail.order.subject')) - ->view('shop::emails.sales.new-admin-order'); + ->to(core()->getAdminEmailDetails()['email']) + ->subject(trans('shop::app.mail.order.subject')) + ->view('shop::emails.sales.new-admin-order'); } } \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Mail/NewCustomerNotification.php b/packages/Webkul/Admin/src/Mail/NewCustomerNotification.php index a18d67d4d..098503230 100644 --- a/packages/Webkul/Admin/src/Mail/NewCustomerNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewCustomerNotification.php @@ -33,8 +33,11 @@ class NewCustomerNotification extends Mailable public function build() { return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) - ->to($this->customer->email) - ->subject(trans('shop::app.mail.customer.new.subject')) - ->view('shop::emails.customer.new-customer')->with(['customer' => $this->customer, 'password' => $this->password]); + ->to($this->customer->email) + ->subject(trans('shop::app.mail.customer.new.subject')) + ->view('shop::emails.customer.new-customer')->with([ + 'customer' => $this->customer, + 'password' => $this->password, + ]); } } \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Mail/NewInventorySourceNotification.php b/packages/Webkul/Admin/src/Mail/NewInventorySourceNotification.php index 69ed8ec76..f5bad5910 100644 --- a/packages/Webkul/Admin/src/Mail/NewInventorySourceNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewInventorySourceNotification.php @@ -33,8 +33,8 @@ class NewInventorySourceNotification extends Mailable $inventory = $this->shipment->inventory_source; return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) - ->to($inventory->contact_email, $inventory->name) - ->subject(trans('shop::app.mail.shipment.subject', ['order_id' => $order->increment_id])) - ->view('shop::emails.sales.new-inventorysource-shipment'); + ->to($inventory->contact_email, $inventory->name) + ->subject(trans('shop::app.mail.shipment.subject', ['order_id' => $order->increment_id])) + ->view('shop::emails.sales.new-inventorysource-shipment'); } } diff --git a/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php b/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php index 1b65ed80b..482d74bda 100755 --- a/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php @@ -31,8 +31,8 @@ class NewInvoiceNotification extends Mailable $order = $this->invoice->order; return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) - ->to($order->customer_email, $order->customer_full_name) - ->subject(trans('shop::app.mail.invoice.subject', ['order_id' => $order->increment_id])) - ->view('shop::emails.sales.new-invoice'); + ->to($order->customer_email, $order->customer_full_name) + ->subject(trans('shop::app.mail.invoice.subject', ['order_id' => $order->increment_id])) + ->view('shop::emails.sales.new-invoice'); } } diff --git a/packages/Webkul/Admin/src/Mail/NewOrderNotification.php b/packages/Webkul/Admin/src/Mail/NewOrderNotification.php index a9d8a2f35..b4ed0717e 100755 --- a/packages/Webkul/Admin/src/Mail/NewOrderNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewOrderNotification.php @@ -29,8 +29,8 @@ class NewOrderNotification extends Mailable public function build() { return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) - ->to($this->order->customer_email, $this->order->customer_full_name) - ->subject(trans('shop::app.mail.order.subject')) - ->view('shop::emails.sales.new-order'); + ->to($this->order->customer_email, $this->order->customer_full_name) + ->subject(trans('shop::app.mail.order.subject')) + ->view('shop::emails.sales.new-order'); } } diff --git a/packages/Webkul/Admin/src/Mail/NewRefundNotification.php b/packages/Webkul/Admin/src/Mail/NewRefundNotification.php index 9b9ecd59b..e54a214a5 100644 --- a/packages/Webkul/Admin/src/Mail/NewRefundNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewRefundNotification.php @@ -31,8 +31,8 @@ class NewRefundNotification extends Mailable $order = $this->refund->order; return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) - ->to($order->customer_email, $order->customer_full_name) - ->subject(trans('shop::app.mail.refund.subject', ['order_id' => $order->increment_id])) - ->view('shop::emails.sales.new-refund'); + ->to($order->customer_email, $order->customer_full_name) + ->subject(trans('shop::app.mail.refund.subject', ['order_id' => $order->increment_id])) + ->view('shop::emails.sales.new-refund'); } } diff --git a/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php b/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php index a2fda88ea..2efff6bb0 100755 --- a/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php @@ -31,8 +31,8 @@ class NewShipmentNotification extends Mailable $order = $this->shipment->order; return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) - ->to($order->customer_email, $order->customer_full_name) - ->subject(trans('shop::app.mail.shipment.subject', ['order_id' => $order->increment_id])) - ->view('shop::emails.sales.new-shipment'); + ->to($order->customer_email, $order->customer_full_name) + ->subject(trans('shop::app.mail.shipment.subject', ['order_id' => $order->increment_id])) + ->view('shop::emails.sales.new-shipment'); } } diff --git a/packages/Webkul/Admin/src/Mail/OrderCommentNotification.php b/packages/Webkul/Admin/src/Mail/OrderCommentNotification.php index 8f1bb23fe..e7987813b 100644 --- a/packages/Webkul/Admin/src/Mail/OrderCommentNotification.php +++ b/packages/Webkul/Admin/src/Mail/OrderCommentNotification.php @@ -29,8 +29,8 @@ class OrderCommentNotification extends Mailable public function build() { return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) - ->to($this->comment->order->customer_email, $this->comment->order->customer_full_name) - ->subject(trans('shop::app.mail.order.comment.subject', ['order_id' => $this->comment->order->increment_id])) - ->view('shop::emails.sales.new-order-comment'); + ->to($this->comment->order->customer_email, $this->comment->order->customer_full_name) + ->subject(trans('shop::app.mail.order.comment.subject', ['order_id' => $this->comment->order->increment_id])) + ->view('shop::emails.sales.new-order-comment'); } } diff --git a/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php b/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php index cf9b31262..191a9b198 100755 --- a/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php +++ b/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php @@ -105,13 +105,15 @@ class AdminServiceProvider extends ServiceProvider && substr_count($item['key'], '.') == 1 ) { foreach ($allowedPermissions as $key => $value) { - if ($item['key'] == $value) { - $neededItem = $allowedPermissions[$key + 1]; + if ($item['key'] != $value) { + continue; + } - foreach (config('menu.admin') as $key1 => $findMatced) { - if ($findMatced['key'] == $neededItem) { - $item['route'] = $findMatced['route']; - } + $neededItem = $allowedPermissions[$key + 1]; + + foreach (config('menu.admin') as $key1 => $findMatced) { + if ($findMatced['key'] == $neededItem) { + $item['route'] = $findMatced['route']; } } } diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/families/create.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/families/create.blade.php index e5dca9f71..9e4139a5b 100755 --- a/packages/Webkul/Admin/src/Resources/views/catalog/families/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/families/create.blade.php @@ -240,7 +240,7 @@