Merge branch 'bagisto/master' into introduce-company-name-and-sales-tax-id-columns

This commit is contained in:
Herbert Maschke 2020-01-21 11:36:26 +01:00
commit 4596a77c07
110 changed files with 9685 additions and 393 deletions

View File

@ -35,6 +35,7 @@ MAIL_ENCRYPTION=tls
SHOP_MAIL_FROM=
ADMIN_MAIL_TO=
MAIL_FROM_NAME=
fixer_api_key=

1
.gitignore vendored
View File

@ -16,7 +16,6 @@ npm-debug.log
yarn-error.log
.env
/ignorables/*
composer.lock
yarn.lock
package-lock.json
yarn.lock

View File

@ -64,7 +64,7 @@ Take advantage of two of the hottest frameworks used in this project -- Laravel
* **OS**: Ubuntu 16.04 LTS or higher / Windows 7 or Higher (WampServer / XAMPP).
* **SERVER**: Apache 2 or NGINX.
* **RAM**: 3 GB or higher.
* **PHP**: 7.1.3 or higher.
* **PHP**: 7.2.0 or higher.
* **Processor**: Clock Cycle 1 Ghz or higher.
* **For MySQL users**: 5.7.23 or higher.
* **For MariaDB users**: 10.2.7 or Higher.

View File

@ -18,20 +18,22 @@
"ext-pdo_mysql": "*",
"ext-tokenizer": "*",
"astrotomic/laravel-translatable": "^11.0.0",
"barryvdh/laravel-dompdf": "0.8.3",
"barryvdh/laravel-dompdf": "0.8.5",
"doctrine/dbal": "2.9.2",
"fideloper/proxy": "^4.0",
"flynsarmy/db-blade-compiler": "*",
"guzzlehttp/guzzle": "~6.0",
"intervention/image": "^2.4",
"intervention/imagecache": "^2.3",
"kalnoy/nestedset": "^4.3",
"kalnoy/nestedset": "5.0.0",
"konekt/concord": "^1.2",
"laravel/framework": "5.6.*",
"laravel/framework": "^6.0",
"laravel/helpers": "^1.1",
"laravel/tinker": "^1.0",
"maatwebsite/excel": "3.1.11",
"prettus/l5-repository": "2.6.32",
"tymon/jwt-auth": "1.0.0-rc.4"
"maatwebsite/excel": "3.1.18",
"nwidart/laravel-modules": "^3.2",
"prettus/l5-repository": "^2.6",
"tymon/jwt-auth": "^1.0.0"
},
"require-dev": {
@ -40,7 +42,7 @@
"barryvdh/laravel-debugbar": "^3.1",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"laravel/dusk": "^4.0",
"laravel/dusk": "^5.7.0",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"

8147
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -100,7 +100,7 @@ return [
'prefix' => env(
'CACHE_PREFIX',
str_slug(env('APP_NAME', 'laravel'), '_').'_cache'
\Illuminate\Support\Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'
),
];

View File

@ -124,7 +124,7 @@ return [
'cookie' => env(
'SESSION_COOKIE',
str_slug(env('APP_NAME', 'laravel'), '_').'_session'
\Illuminate\Support\Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
),
/*

View File

@ -98,7 +98,7 @@ class CartController extends Controller
*/
public function store($id)
{
Event::fire('checkout.cart.item.add.before', $id);
Event::dispatch('checkout.cart.item.add.before', $id);
$result = Cart::addProduct($id, request()->except('_token'));
@ -112,8 +112,8 @@ class CartController extends Controller
if ($customer = auth($this->guard)->user())
$this->wishlistRepository->deleteWhere(['product_id' => $id, 'customer_id' => $customer->id]);
Event::fire('checkout.cart.item.add.after', $result);
Event::dispatch('checkout.cart.item.add.after', $result);
Cart::collectTotals();
@ -143,11 +143,11 @@ class CartController extends Controller
foreach (request()->get('qty') as $itemId => $qty) {
$item = $this->cartItemRepository->findOneByField('id', $itemId);
Event::fire('checkout.cart.item.update.before', $itemId);
Event::dispatch('checkout.cart.item.update.before', $itemId);
Cart::updateItems(request()->all());
Event::fire('checkout.cart.item.update.after', $item);
Event::dispatch('checkout.cart.item.update.after', $item);
}
Cart::collectTotals();
@ -167,11 +167,11 @@ class CartController extends Controller
*/
public function destroy()
{
Event::fire('checkout.cart.delete.before');
Event::dispatch('checkout.cart.delete.before');
Cart::deActivateCart();
Event::fire('checkout.cart.delete.after');
Event::dispatch('checkout.cart.delete.after');
$cart = Cart::getCart();
@ -189,11 +189,11 @@ class CartController extends Controller
*/
public function destroyItem($id)
{
Event::fire('checkout.cart.item.delete.before', $id);
Event::dispatch('checkout.cart.item.delete.before', $id);
Cart::removeItem($id);
Event::fire('checkout.cart.item.delete.after', $id);
Event::dispatch('checkout.cart.item.delete.after', $id);
Cart::collectTotals();
@ -213,11 +213,11 @@ class CartController extends Controller
*/
public function moveToWishlist($id)
{
Event::fire('checkout.cart.item.move-to-wishlist.before', $id);
Event::dispatch('checkout.cart.item.move-to-wishlist.before', $id);
Cart::moveToWishlist($id);
Event::fire('checkout.cart.item.move-to-wishlist.after', $id);
Event::dispatch('checkout.cart.item.move-to-wishlist.after', $id);
Cart::collectTotals();

View File

@ -12,6 +12,7 @@ use Webkul\API\Http\Resources\Checkout\CartShippingRate as CartShippingRateResou
use Webkul\API\Http\Resources\Sales\Order as OrderResource;
use Webkul\Checkout\Http\Requests\CustomerAddressForm;
use Webkul\Sales\Repositories\OrderRepository;
use Illuminate\Support\Str;
use Cart;
/**
@ -60,9 +61,9 @@ class CheckoutController extends Controller
auth()->setDefaultDriver($this->guard);
// $this->middleware('auth:' . $this->guard);
$this->_config = request('_config');
$this->cartRepository = $cartRepository;
@ -90,7 +91,7 @@ class CheckoutController extends Controller
unset($data['billing']['address_id']);
}
if (isset($data['shipping']['id']) && str_contains($data['shipping']['id'], 'address_')) {
if (isset($data['shipping']['id']) && Str::contains($data['shipping']['id'], 'address_')) {
unset($data['shipping']['id']);
unset($data['shipping']['address_id']);
}

View File

@ -60,11 +60,11 @@ class CustomerController extends Controller
'customer_group_id' => 1
]);
Event::fire('customer.registration.before');
Event::dispatch('customer.registration.before');
$customer = $this->customerRepository->create($data);
Event::fire('customer.registration.after', $customer);
Event::dispatch('customer.registration.after', $customer);
return response()->json([
'message' => 'Your account has been created successfully.'

View File

@ -66,7 +66,7 @@ class SessionController extends Controller
], 401);
}
Event::fire('customer.after.login', request('email'));
Event::dispatch('customer.after.login', request('email'));
$customer = auth($this->guard)->user();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/admin.js": "/js/admin.js?id=d1daece26673ab30942b",
"/css/admin.css": "/css/admin.css?id=c845e7c275d4df7fa03f"
"/js/admin.js": "/js/admin.js?id=7da533d2597c7e84df97",
"/css/admin.css": "/css/admin.css?id=9a8c6ebe5e08965b7ae6"
}

View File

@ -182,12 +182,6 @@ return [
'sort' => 2,
'icon-class' => ''
], [
'key' => 'settings.development',
'name' => 'admin::app.settings.development.title',
'route' => 'admin.development.index',
'sort' => 8,
'icon-class' => ''
],[
'key' => 'promotions',
'name' => 'admin::app.layouts.promotions',
'route' => 'admin.catalog-rules.index',

View File

@ -118,7 +118,7 @@ class ConfigurationController extends Controller
*/
public function store()
{
Event::fire('core.configuration.save.before');
Event::dispatch('core.configuration.save.before');
if (request()->has('general.design.admin_logo.logo_image') && ! request()->input('general.design.admin_logo.logo_image.delete')) {
$this->validate(request(), [
@ -128,7 +128,7 @@ class ConfigurationController extends Controller
$this->coreConfigRepository->create(request()->all());
Event::fire('core.configuration.save.after');
Event::dispatch('core.configuration.save.after');
session()->flash('success', trans('admin::app.configuration.save-message'));

View File

@ -755,12 +755,6 @@ Route::group(['middleware' => ['web']], function () {
// 'redirect' => 'admin.cms.index'
// ])->name('admin.cms.delete');
});
// Development settings
Route::prefix('development')->group(function () {
Route::get('/', 'Webkul\Admin\Http\Controllers\Development\DashboardController@index')
->name('admin.development.index');
});
});
});
});

View File

@ -45,7 +45,6 @@ class NewInvoiceNotification extends Mailable
$order = $this->invoice->order;
return $this->to($order->customer_email, $order->customer_full_name)
->from(config('mail.from'))
->subject(trans('shop::app.mail.invoice.subject', ['order_id' => $order->increment_id]))
->view('shop::emails.sales.new-invoice');
}

View File

@ -42,7 +42,6 @@ class NewOrderNotification extends Mailable
public function build()
{
return $this->to($this->order->customer_email, $this->order->customer_full_name)
->from(config('mail.from'))
->subject(trans('shop::app.mail.order.subject'))
->view('shop::emails.sales.new-order');
}

View File

@ -45,7 +45,6 @@ class NewRefundNotification extends Mailable
$order = $this->refund->order;
return $this->to($order->customer_email, $order->customer_full_name)
->from(config('mail.from'))
->subject(trans('shop::app.mail.refund.subject', ['order_id' => $order->increment_id]))
->view('shop::emails.sales.new-refund');
}

View File

@ -45,7 +45,6 @@ class NewShipmentNotification extends Mailable
$order = $this->shipment->order;
return $this->to($order->customer_email, $order->customer_full_name)
->from(config('mail.from'))
->subject(trans('shop::app.mail.shipment.subject', ['order_id' => $order->increment_id]))
->view('shop::emails.sales.new-shipment');
}

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
<title>Angle-Right</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Angle-Right" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<polyline id="Path-3" stroke="#A2A2A2" stroke-width="3" points="7 3 14 10.058476 7.11598308 17"></polyline>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 618 B

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
<title>Icon-Graph-Green</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Icon-Graph-Green" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g transform="translate(8.000000, 5.000000)" stroke="#00C357" stroke-width="2">
<path d="M4,0 L4,14" id="Path-2"></path>
<path d="M4,0 L0,4" id="Path-3"></path>
<path d="M7.92330631,0 L3.92330631,4" id="Path-3-Copy" transform="translate(5.961653, 2.000000) scale(-1, 1) translate(-5.961653, -2.000000) "></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 881 B

View File

@ -87,7 +87,7 @@ $(document).ready(function () {
},
addFlashMessages() {
if (typeof flashMessages !== 'undefined') {
if (typeof flashMessages == 'undefined') {
return;
};

View File

@ -58,7 +58,7 @@
<div class="control-group" :class="[errors.has('html_content') ? 'has-error' : '']">
<label for="html_content" class="required">{{ __('admin::app.cms.pages.content') }}</label>
<textarea type="text" class="control" id="content" name="html_content" v-validate="'required'" value="{{ old('html_content') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.content') }}&quot;"></textarea>
<textarea type="text" class="control" id="content" name="html_content" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.cms.pages.content') }}&quot;">{{ old('html_content') }}</textarea>
<span class="control-error" v-if="errors.has('html_content')">@{{ errors.first('html_content') }}</span>
</div>
@ -89,13 +89,13 @@
<div class="control-group">
<label for="meta_keywords">{{ __('admin::app.cms.pages.meta_keywords') }}</label>
<textarea type="text" class="control" name="meta_keywords" value="{{ old('meta_keywords') }}"></textarea>
<textarea type="text" class="control" name="meta_keywords">{{ old('meta_keywords') }}</textarea>
</div>
<div class="control-group">
<label for="meta_description">{{ __('admin::app.cms.pages.meta_description') }}</label>
<textarea type="text" class="control" name="meta_description" value="{{ old('meta_description') }}"></textarea>
<textarea type="text" class="control" name="meta_description">{{ old('meta_description') }}</textarea>
</div>
</div>
</accordian>

View File

@ -77,9 +77,7 @@
<div class="control-group" :class="[errors.has('{{$locale}}[html_content]') ? 'has-error' : '']">
<label for="html_content" class="required">{{ __('admin::app.cms.pages.content') }}</label>
<textarea type="text" class="control" id="content" name="{{$locale}}[html_content]" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.cms.pages.content') }}&quot;">
{{ old($locale)['html_content'] ?? ($page->translate($locale)['html_content'] ?? '') }}
</textarea>
<textarea type="text" class="control" id="content" name="{{$locale}}[html_content]" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.cms.pages.content') }}&quot;">{{ old($locale)['html_content'] ?? ($page->translate($locale)['html_content'] ?? '') }}</textarea>
<span class="control-error" v-if="errors.has('{{$locale}}[html_content]')">@{{ errors.first('{!!$locale!!}[html_content]') }}</span>
</div>
@ -105,17 +103,13 @@
<div class="control-group">
<label for="meta_keywords">{{ __('admin::app.cms.pages.meta_keywords') }}</label>
<textarea type="text" class="control" name="{{$locale}}[meta_keywords]">
{{ old($locale)['meta_keywords'] ?? ($page->translate($locale)['meta_keywords'] ?? '') }}
</textarea>
<textarea type="text" class="control" name="{{$locale}}[meta_keywords]">{{ old($locale)['meta_keywords'] ?? ($page->translate($locale)['meta_keywords'] ?? '') }}</textarea>
</div>
<div class="control-group">
<label for="meta_description">{{ __('admin::app.cms.pages.meta_description') }}</label>
<textarea type="text" class="control" name="{{$locale}}[meta_description]">
{{ old($locale)['meta_description'] ?? ($page->translate($locale)['meta_description'] ?? '') }}
</textarea>
<textarea type="text" class="control" name="{{$locale}}[meta_description]">{{ old($locale)['meta_description'] ?? ($page->translate($locale)['meta_description'] ?? '') }}</textarea>
</div>
</div>
</accordian>

View File

@ -54,7 +54,7 @@
<div class="form-container">
@csrf()
@if ($groups = array_get($config->items, request()->route('slug') . '.children.' . request()->route('slug2') . '.children'))
@if ($groups = \Illuminate\Support\Arr::get($config->items, request()->route('slug') . '.children.' . request()->route('slug2') . '.children'))
@foreach ($groups as $key => $item)

View File

@ -4,7 +4,7 @@
<?php $keys = explode('.', $menu->currentKey); ?>
@if(isset($keys) && strlen($keys[0]))
@foreach (array_get($menu->items, current($keys) . '.children') as $item)
@foreach (\Illuminate\Support\Arr::get($menu->items, current($keys) . '.children') as $item)
<li class="{{ $menu->getActive($item) }}">
<a href="{{ $item['url'] }}">
{{ trans($item['name']) }}

View File

@ -4,11 +4,11 @@
<?php $keys = explode('.', $menu->currentKey); ?>
@if ($items = array_get($menu->items, implode('.children.', array_slice($keys, 0, 2)) . '.children'))
@if ($items = \Illuminate\Support\Arr::get($menu->items, implode('.children.', array_slice($keys, 0, 2)) . '.children'))
<ul>
@foreach (array_get($menu->items, implode('.children.', array_slice($keys, 0, 2)) . '.children') as $item)
@foreach (\Illuminate\Support\Arr::get($menu->items, implode('.children.', array_slice($keys, 0, 2)) . '.children') as $item)
<li class="{{ $menu->getActive($item) }}">
<a href="{{ $item['url'] }}">
@ -17,14 +17,14 @@
</li>
@endforeach
</ul>
@endif
@else
@if ($items = array_get($config->items, request()->route('slug') . '.children'))
@if ($items = \Illuminate\Support\Arr::get($config->items, request()->route('slug') . '.children'))
<ul>

View File

@ -28,7 +28,7 @@
<div class="form-container">
@csrf()
{!! view_render_event('bagisto.admin.settings.locale.edit.before') !!}
{!! view_render_event('bagisto.admin.settings.locale.edit.before', ['locale' => $locale]) !!}
<input name="_method" type="hidden" value="PUT">
@ -60,7 +60,7 @@
</div>
</accordian>
{!! view_render_event('bagisto.admin.settings.locale.edit.after') !!}
{!! view_render_event('bagisto.admin.settings.locale.edit.after', ['locale' => $locale]) !!}
</div>
</div>
</form>

View File

@ -16,7 +16,6 @@ mix.setPublicPath(publicPath).mergeManifest();
mix.disableNotifications();
mix.js(__dirname + "/src/Resources/assets/js/app.js", "js/admin.js")
.copyDirectory( __dirname + '/src/Resources/assets/images', publicPath + '/images')
.sass(__dirname + "/src/Resources/assets/sass/app.scss", "css/admin.css")
.options({
processCssUrls: false

View File

@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Event;
use Webkul\Attribute\Repositories\AttributeRepository;
use Webkul\Attribute\Repositories\AttributeGroupRepository;
use Illuminate\Container\Container as App;
use Illuminate\Support\Str;
/**
* Attribute Reposotory
@ -66,7 +67,7 @@ class AttributeFamilyRepository extends Repository
*/
public function create(array $data)
{
Event::fire('catalog.attribute_family.create.before');
Event::dispatch('catalog.attribute_family.create.before');
$attributeGroups = isset($data['attribute_groups']) ? $data['attribute_groups'] : [];
unset($data['attribute_groups']);
@ -88,7 +89,7 @@ class AttributeFamilyRepository extends Repository
}
}
Event::fire('catalog.attribute_family.create.after', $family);
Event::dispatch('catalog.attribute_family.create.after', $family);
return $family;
}
@ -103,7 +104,7 @@ class AttributeFamilyRepository extends Repository
{
$family = $this->find($id);
Event::fire('catalog.attribute_family.update.before', $id);
Event::dispatch('catalog.attribute_family.update.before', $id);
$family->update($data);
@ -111,7 +112,7 @@ class AttributeFamilyRepository extends Repository
if (isset($data['attribute_groups'])) {
foreach ($data['attribute_groups'] as $attributeGroupId => $attributeGroupInputs) {
if (str_contains($attributeGroupId, 'group_')) {
if (Str::contains($attributeGroupId, 'group_')) {
$attributeGroup = $family->attribute_groups()->create($attributeGroupInputs);
if (isset($attributeGroupInputs['custom_attributes'])) {
@ -152,7 +153,7 @@ class AttributeFamilyRepository extends Repository
$this->attributeGroupRepository->delete($attributeGroupId);
}
Event::fire('catalog.attribute_family.update.after', $family);
Event::dispatch('catalog.attribute_family.update.after', $family);
return $family;
}
@ -181,10 +182,10 @@ class AttributeFamilyRepository extends Repository
*/
public function delete($id)
{
Event::fire('catalog.attribute_family.delete.before', $id);
Event::dispatch('catalog.attribute_family.delete.before', $id);
parent::delete($id);
Event::fire('catalog.attribute_family.delete.after', $id);
Event::dispatch('catalog.attribute_family.delete.after', $id);
}
}

View File

@ -6,6 +6,7 @@ use Webkul\Core\Eloquent\Repository;
use Illuminate\Support\Facades\Event;
use Webkul\Attribute\Repositories\AttributeOptionRepository;
use Illuminate\Container\Container as App;
use Illuminate\Support\Str;
/**
* Attribute Reposotory
@ -54,7 +55,7 @@ class AttributeRepository extends Repository
*/
public function create(array $data)
{
Event::fire('catalog.attribute.create.before');
Event::dispatch('catalog.attribute.create.before');
$data = $this->validateUserInput($data);
@ -70,7 +71,7 @@ class AttributeRepository extends Repository
}
}
Event::fire('catalog.attribute.create.after', $attribute);
Event::dispatch('catalog.attribute.create.after', $attribute);
return $attribute;
}
@ -87,7 +88,7 @@ class AttributeRepository extends Repository
$attribute = $this->find($id);
Event::fire('catalog.attribute.update.before', $id);
Event::dispatch('catalog.attribute.update.before', $id);
$attribute->update($data);
@ -96,7 +97,7 @@ class AttributeRepository extends Repository
if (in_array($attribute->type, ['select', 'multiselect', 'checkbox'])) {
if (isset($data['options'])) {
foreach ($data['options'] as $optionId => $optionInputs) {
if (str_contains($optionId, 'option_')) {
if (Str::contains($optionId, 'option_')) {
$this->attributeOptionRepository->create(array_merge([
'attribute_id' => $attribute->id,
], $optionInputs));
@ -115,7 +116,7 @@ class AttributeRepository extends Repository
$this->attributeOptionRepository->delete($optionId);
}
Event::fire('catalog.attribute.update.after', $attribute);
Event::dispatch('catalog.attribute.update.after', $attribute);
return $attribute;
}
@ -126,11 +127,11 @@ class AttributeRepository extends Repository
*/
public function delete($id)
{
Event::fire('catalog.attribute.delete.before', $id);
Event::dispatch('catalog.attribute.delete.before', $id);
parent::delete($id);
Event::fire('catalog.attribute.delete.after', $id);
Event::dispatch('catalog.attribute.delete.after', $id);
}
/**

View File

@ -31,7 +31,7 @@ class CmsRepository extends Repository
*/
public function create(array $data)
{
Event::fire('cms.pages.create.before');
Event::dispatch('cms.pages.create.before');
$model = $this->getModel();
@ -46,7 +46,7 @@ class CmsRepository extends Repository
$page->channels()->sync($data['channels']);
Event::fire('cms.pages.create.after', $page);
Event::dispatch('cms.pages.create.after', $page);
return $page;
}
@ -61,13 +61,13 @@ class CmsRepository extends Repository
{
$page = $this->find($id);
Event::fire('cms.pages.update.before', $id);
Event::dispatch('cms.pages.update.before', $id);
parent::update($data, $id, $attribute);
$page->channels()->sync($data['channels']);
Event::fire('cms.pages.update.after', $id);
Event::dispatch('cms.pages.update.after', $id);
return $page;
}

View File

@ -97,11 +97,11 @@ class CartRuleController extends Controller
$data = request()->all();
Event::fire('promotions.cart_rule.create.before');
Event::dispatch('promotions.cart_rule.create.before');
$cartRule = $this->cartRuleRepository->create($data);
Event::fire('promotions.cart_rule.create.after', $cartRule);
Event::dispatch('promotions.cart_rule.create.after', $cartRule);
session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Cart Rule']));
@ -145,11 +145,11 @@ class CartRuleController extends Controller
$cartRule = $this->cartRuleRepository->findOrFail($id);
Event::fire('promotions.cart_rule.update.before', $cartRule);
Event::dispatch('promotions.cart_rule.update.before', $cartRule);
$cartRule = $this->cartRuleRepository->update(request()->all(), $id);
Event::fire('promotions.cart_rule.update.after', $cartRule);
Event::dispatch('promotions.cart_rule.update.after', $cartRule);
session()->flash('success', trans('admin::app.response.update-success', ['name' => 'Cart Rule']));
@ -167,11 +167,11 @@ class CartRuleController extends Controller
$cartRule = $this->cartRuleRepository->findOrFail($id);
try {
Event::fire('promotions.cart_rule.delete.before', $id);
Event::dispatch('promotions.cart_rule.delete.before', $id);
$this->cartRuleRepository->delete($id);
Event::fire('promotions.cart_rule.delete.after', $id);
Event::dispatch('promotions.cart_rule.delete.after', $id);
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Cart Rule']));

View File

@ -94,11 +94,11 @@ class CatalogRuleController extends Controller
$data = request()->all();
Event::fire('promotions.catalog_rule.create.before');
Event::dispatch('promotions.catalog_rule.create.before');
$catalogRule = $this->catalogRuleRepository->create($data);
Event::fire('promotions.catalog_rule.create.after', $catalogRule);
Event::dispatch('promotions.catalog_rule.create.after', $catalogRule);
$this->catalogRuleIndexHelper->reindexComplete();
@ -141,11 +141,11 @@ class CatalogRuleController extends Controller
$catalogRule = $this->catalogRuleRepository->findOrFail($id);
Event::fire('promotions.catalog_rule.update.before', $catalogRule);
Event::dispatch('promotions.catalog_rule.update.before', $catalogRule);
$catalogRule = $this->catalogRuleRepository->update(request()->all(), $id);
Event::fire('promotions.catalog_rule.update.after', $catalogRule);
Event::dispatch('promotions.catalog_rule.update.after', $catalogRule);
$this->catalogRuleIndexHelper->reindexComplete();
@ -165,11 +165,11 @@ class CatalogRuleController extends Controller
$catalogRule = $this->catalogRuleRepository->findOrFail($id);
try {
Event::fire('promotions.catalog_rule.delete.before', $id);
Event::dispatch('promotions.catalog_rule.delete.before', $id);
$this->catalogRuleRepository->delete($id);
Event::fire('promotions.catalog_rule.delete.after', $id);
Event::dispatch('promotions.catalog_rule.delete.after', $id);
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Catalog Rule']));

View File

@ -1,10 +1,9 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use Faker\Generator as Faker;
use Webkul\Category\Models\Category;
/** @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(Category::class, function (Faker $faker, array $attributes) {
return [

View File

@ -115,15 +115,15 @@ class CategoryController extends Controller
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @param int $id
* @return \Illuminate\View\View
*/
public function edit($id)
{
$categories = $this->categoryRepository->getCategoryTree($id);
$category = $this->categoryRepository->findOrFail($id);
$categories = $this->categoryRepository->getCategoryTreeWithoutDescendant($id);
$attributes = $this->attributeRepository->findWhere(['is_filterable' => 1]);
return view($this->_config['view'], compact('category', 'categories', 'attributes'));
@ -174,7 +174,7 @@ class CategoryController extends Controller
$this->categoryRepository->delete($id);
Event::fire('catalog.category.delete.after', $id);
Event::dispatch('catalog.category.delete.after', $id);
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Category']));
@ -200,11 +200,11 @@ class CategoryController extends Controller
foreach ($indexes as $key => $value) {
try {
Event::fire('catalog.category.delete.before', $value);
Event::dispatch('catalog.category.delete.before', $value);
$this->categoryRepository->delete($value);
Event::fire('catalog.category.delete.after', $value);
Event::dispatch('catalog.category.delete.after', $value);
} catch(\Exception $e) {
$suppressFlash = true;

View File

@ -5,8 +5,10 @@ namespace Webkul\Category\Models;
use Webkul\Core\Eloquent\TranslatableModel;
use Kalnoy\Nestedset\NodeTrait;
use Illuminate\Support\Facades\Storage;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Webkul\Category\Contracts\Category as CategoryContract;
use Webkul\Attribute\Models\AttributeProxy;
use Webkul\Category\Repositories\CategoryRepository;
/**
* Class Category
@ -19,7 +21,7 @@ class Category extends TranslatableModel implements CategoryContract
{
use NodeTrait;
public $translatedAttributes = ['name', 'description', 'slug', 'meta_title', 'meta_description', 'meta_keywords'];
public $translatedAttributes = ['name', 'description', 'slug', 'url_path', 'meta_title', 'meta_description', 'meta_keywords'];
protected $fillable = ['position', 'status', 'display_mode', 'parent_id'];
@ -51,4 +53,63 @@ class Category extends TranslatableModel implements CategoryContract
{
return $this->belongsToMany(AttributeProxy::modelClass(), 'category_filterable_attributes')->with('options');
}
/**
* Getting the root category of a category
*
* @return Category
*/
public function getRootCategory(): Category
{
return Category::where([
['parent_id', '=', null],
['_lft', '<=', $this->_lft],
['_rgt', '>=', $this->_rgt],
])->first();
}
/**
* Returns all categories within the category's path
*
* @return Category[]
*/
public function getPathCategories(): array
{
$category = $this->findInTree();
$categories = [$category];
while (isset($category->parent)) {
$category = $category->parent;
$categories[] = $category;
}
return array_reverse($categories);
}
/**
* Finds and returns the category within a nested category tree
* will search in root category by default
* is used to minimize the numbers of sql queries for it only uses the already cached tree
*
* @param Category[] $categoryTree
* @return Category
*/
public function findInTree($categoryTree = null): Category
{
if (! $categoryTree) {
$categoryTree = app(CategoryRepository::class)->getVisibleCategoryTree($this->getRootCategory()->id);
}
$category = $categoryTree->first();
if (! $category) {
throw new NotFoundHttpException('category not found in tree');
}
if ($category->id === $this->id) {
return $category;
}
return $this->findInTree($category->children);
}
}

View File

@ -9,6 +9,7 @@ use Webkul\Core\Eloquent\Repository;
use Webkul\Category\Models\Category;
use Webkul\Category\Models\CategoryTranslation;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Support\Facades\DB;
/**
* Category Reposotory
@ -34,7 +35,7 @@ class CategoryRepository extends Repository
*/
public function create(array $data)
{
Event::fire('catalog.category.create.before');
Event::dispatch('catalog.category.create.before');
if (isset($data['locale']) && $data['locale'] == 'all') {
$model = app()->make($this->model());
@ -57,7 +58,7 @@ class CategoryRepository extends Repository
$category->filterableAttributes()->sync($data['attributes']);
}
Event::fire('catalog.category.create.after', $category);
Event::dispatch('catalog.category.create.after', $category);
return $category;
}
@ -75,6 +76,18 @@ class CategoryRepository extends Repository
: $this->model::orderBy('position', 'ASC')->get()->toTree();
}
/**
* Specify category tree
*
* @param integer $id
* @return mixed
*/
public function getCategoryTreeWithoutDescendant($id = null)
{
return $id
? $this->model::orderBy('position', 'ASC')->where('id', '!=', $id)->whereNotDescendantOf($id)->get()->toTree()
: $this->model::orderBy('position', 'ASC')->get()->toTree();
}
/**
* Get root categories
@ -116,7 +129,7 @@ class CategoryRepository extends Repository
$exists = CategoryTranslation::where('category_id', '<>', $id)
->where('slug', $slug)
->limit(1)
->select(\DB::raw(1))
->select(DB::raw(1))
->exists();
return $exists ? false : true;
@ -161,7 +174,7 @@ class CategoryRepository extends Repository
{
$category = $this->find($id);
Event::fire('catalog.category.update.before', $id);
Event::dispatch('catalog.category.update.before', $id);
$category->update($data);
@ -171,7 +184,7 @@ class CategoryRepository extends Repository
$category->filterableAttributes()->sync($data['attributes']);
}
Event::fire('catalog.category.update.after', $id);
Event::dispatch('catalog.category.update.after', $id);
return $category;
}
@ -182,11 +195,11 @@ class CategoryRepository extends Repository
*/
public function delete($id)
{
Event::fire('catalog.category.delete.before', $id);
Event::dispatch('catalog.category.delete.before', $id);
parent::delete($id);
Event::fire('catalog.category.delete.after', $id);
Event::dispatch('catalog.category.delete.after', $id);
}
/**

View File

@ -12,6 +12,7 @@ use Webkul\Checkout\Models\CartPayment;
use Webkul\Customer\Repositories\WishlistRepository;
use Webkul\Customer\Repositories\CustomerAddressRepository;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Arr;
/**
* Facades handler for all the methods to be implemented in Cart.
@ -131,7 +132,7 @@ class Cart {
*/
public function addProduct($productId, $data)
{
Event::fire('checkout.cart.add.before', $productId);
Event::dispatch('checkout.cart.add.before', $productId);
$cart = $this->getCart();
@ -170,7 +171,7 @@ class Cart {
}
}
Event::fire('checkout.cart.add.after', $cart);
Event::dispatch('checkout.cart.add.after', $cart);
$this->collectTotals();
@ -244,7 +245,7 @@ class Cart {
if (! $this->isItemHaveQuantity($item))
throw new \Exception(trans('shop::app.checkout.cart.quantity.inventory_warning'));
Event::fire('checkout.cart.update.before', $item);
Event::dispatch('checkout.cart.update.before', $item);
$this->cartItemRepository->update([
'quantity' => $quantity,
@ -254,7 +255,7 @@ class Cart {
'base_total_weight' => $item->weight * $quantity
], $itemId);
Event::fire('checkout.cart.update.after', $item);
Event::dispatch('checkout.cart.update.after', $item);
}
$this->collectTotals();
@ -292,7 +293,7 @@ class Cart {
*/
public function removeItem($itemId)
{
Event::fire('checkout.cart.delete.before', $itemId);
Event::dispatch('checkout.cart.delete.before', $itemId);
if (! $cart = $this->getCart())
return false;
@ -308,7 +309,7 @@ class Cart {
}
}
Event::fire('checkout.cart.delete.after', $itemId);
Event::dispatch('checkout.cart.delete.after', $itemId);
$this->collectTotals();
@ -614,7 +615,7 @@ class Cart {
if (! $cart = $this->getCart())
return false;
Event::fire('checkout.cart.collect.totals.before', $cart);
Event::dispatch('checkout.cart.collect.totals.before', $cart);
$this->calculateItemsTax();
@ -657,7 +658,7 @@ class Cart {
$cart->save();
Event::fire('checkout.cart.collect.totals.after', $cart);
Event::dispatch('checkout.cart.collect.totals.after', $cart);
}
/**
@ -847,8 +848,8 @@ class Cart {
'applied_cart_rule_ids' => $data['applied_cart_rule_ids'],
'discount_amount' => $data['discount_amount'],
'base_discount_amount' => $data['base_discount_amount'],
'billing_address' => array_except($data['billing_address'], ['id', 'cart_id']),
'payment' => array_except($data['payment'], ['id', 'cart_id']),
'billing_address' => Arr::except($data['billing_address'], ['id', 'cart_id']),
'payment' => Arr::except($data['payment'], ['id', 'cart_id']),
'channel' => core()->getCurrentChannel(),
];
@ -859,9 +860,9 @@ class Cart {
'shipping_description' => $data['selected_shipping_rate']['method_description'],
'shipping_amount' => $data['selected_shipping_rate']['price'],
'base_shipping_amount' => $data['selected_shipping_rate']['base_price'],
'shipping_address' => Arr::except($data['shipping_address'], ['id', 'cart_id']),
'shipping_discount_amount' => $data['selected_shipping_rate']['discount_amount'],
'base_shipping_discount_amount' => $data['selected_shipping_rate']['base_discount_amount'],
'shipping_address' => array_except($data['shipping_address'], ['id', 'cart_id']),
]);
}

View File

@ -82,18 +82,28 @@ abstract class Repository extends BaseRepository {
return $this->parserResult($model);
}
/**
* @return mixed
/**
* Count results of repository
*
* @param array $where
* @param string $columns
*
* @return int
*/
public function count()
public function count(array $where = [], $columns = '*')
{
$this->applyCriteria();
$this->applyScope();
$total = $this->model->count();
$this->resetModel();
if ($where) {
$this->applyConditions($where);
}
return $total;
$result = $this->model->count($columns);
$this->resetModel();
$this->resetScope();
return $result;
}
/**

View File

@ -96,11 +96,11 @@ class ChannelController extends Controller
unset($data['seo']);
Event::fire('core.channel.create.before');
Event::dispatch('core.channel.create.before');
$channel = $this->channelRepository->create($data);
Event::fire('core.channel.create.after', $channel);
Event::dispatch('core.channel.create.after', $channel);
session()->flash('success', trans('admin::app.settings.channels.create-success'));
@ -153,11 +153,11 @@ class ChannelController extends Controller
$data['home_seo'] = json_encode($data['seo']);
Event::fire('core.channel.update.before', $id);
Event::dispatch('core.channel.update.before', $id);
$channel = $this->channelRepository->update($data, $id);
Event::fire('core.channel.update.after', $channel);
Event::dispatch('core.channel.update.after', $channel);
session()->flash('success', trans('admin::app.settings.channels.update-success'));
@ -178,11 +178,11 @@ class ChannelController extends Controller
session()->flash('error', trans('admin::app.settings.channels.last-delete-error'));
} else {
try {
Event::fire('core.channel.delete.before', $id);
Event::dispatch('core.channel.delete.before', $id);
$this->channelRepository->delete($id);
Event::fire('core.channel.delete.after', $id);
Event::dispatch('core.channel.delete.after', $id);
session()->flash('success', trans('admin::app.settings.channels.delete-success'));

View File

@ -72,11 +72,11 @@ class CurrencyController extends Controller
'name' => 'required'
]);
Event::fire('core.channel.create.before');
Event::dispatch('core.channel.create.before');
$currency = $this->currencyRepository->create(request()->all());
Event::fire('core.currency.create.after', $currency);
Event::dispatch('core.currency.create.after', $currency);
session()->flash('success', trans('admin::app.settings.currencies.create-success'));
@ -109,11 +109,11 @@ class CurrencyController extends Controller
'name' => 'required'
]);
Event::fire('core.currency.update.before', $id);
Event::dispatch('core.currency.update.before', $id);
$currency = $this->currencyRepository->update(request()->all(), $id);
Event::fire('core.currency.update.after', $currency);
Event::dispatch('core.currency.update.after', $currency);
session()->flash('success', trans('admin::app.settings.currencies.update-success'));
@ -134,11 +134,11 @@ class CurrencyController extends Controller
session()->flash('warning', trans('admin::app.settings.currencies.last-delete-error'));
} else {
try {
Event::fire('core.currency.delete.before', $id);
Event::dispatch('core.currency.delete.before', $id);
$this->currencyRepository->delete($id);
Event::fire('core.currency.delete.after', $id);
Event::dispatch('core.currency.delete.after', $id);
session()->flash('success', trans('admin::app.settings.currencies.delete-success'));
@ -164,11 +164,11 @@ class CurrencyController extends Controller
foreach ($indexes as $key => $value) {
try {
Event::fire('core.currency.delete.before', $value);
Event::dispatch('core.currency.delete.before', $value);
$this->currencyRepository->delete($value);
Event::fire('core.currency.delete.after', $value);
Event::dispatch('core.currency.delete.after', $value);
} catch(\Exception $e) {
$suppressFlash = true;

View File

@ -23,7 +23,7 @@ class ExchangeRateController extends Controller
/**
* ExchangeRateRepository instance
*
*
* @var Object
*/
protected $exchangeRateRepository;
@ -90,11 +90,11 @@ class ExchangeRateController extends Controller
'rate' => 'required|numeric'
]);
Event::fire('core.exchange_rate.create.before');
Event::dispatch('core.exchange_rate.create.before');
$exchangeRate = $this->exchangeRateRepository->create(request()->all());
Event::fire('core.exchange_rate.create.after', $exchangeRate);
Event::dispatch('core.exchange_rate.create.after', $exchangeRate);
session()->flash('success', trans('admin::app.settings.exchange_rates.create-success'));
@ -129,11 +129,11 @@ class ExchangeRateController extends Controller
'rate' => 'required|numeric'
]);
Event::fire('core.exchange_rate.update.before', $id);
Event::dispatch('core.exchange_rate.update.before', $id);
$exchangeRate = $this->exchangeRateRepository->update(request()->all(), $id);
Event::fire('core.exchange_rate.update.after', $exchangeRate);
Event::dispatch('core.exchange_rate.update.after', $exchangeRate);
session()->flash('success', trans('admin::app.settings.exchange_rates.update-success'));
@ -190,13 +190,13 @@ class ExchangeRateController extends Controller
session()->flash('error', trans('admin::app.settings.exchange_rates.last-delete-error'));
} else {
try {
Event::fire('core.exchange_rate.delete.before', $id);
Event::dispatch('core.exchange_rate.delete.before', $id);
$this->exchangeRateRepository->delete($id);
session()->flash('success', trans('admin::app.settings.exchange_rates.delete-success'));
Event::fire('core.exchange_rate.delete.after', $id);
Event::dispatch('core.exchange_rate.delete.after', $id);
return response()->json(['message' => true], 200);
} catch (\Exception $e) {

View File

@ -73,11 +73,11 @@ class LocaleController extends Controller
'direction' => 'in:ltr,rtl'
]);
Event::fire('core.locale.create.before');
Event::dispatch('core.locale.create.before');
$locale = $this->localeRepository->create(request()->all());
Event::fire('core.locale.create.after', $locale);
Event::dispatch('core.locale.create.after', $locale);
session()->flash('success', trans('admin::app.settings.locales.create-success'));
@ -111,11 +111,11 @@ class LocaleController extends Controller
'direction' => 'in:ltr,rtl'
]);
Event::fire('core.locale.update.before', $id);
Event::dispatch('core.locale.update.before', $id);
$locale = $this->localeRepository->update(request()->all(), $id);
Event::fire('core.locale.update.after', $locale);
Event::dispatch('core.locale.update.after', $locale);
session()->flash('success', trans('admin::app.settings.locales.update-success'));
@ -136,11 +136,11 @@ class LocaleController extends Controller
session()->flash('error', trans('admin::app.settings.locales.last-delete-error'));
} else {
try {
Event::fire('core.locale.delete.before', $id);
Event::dispatch('core.locale.delete.before', $id);
$this->localeRepository->delete($id);
Event::fire('core.locale.delete.after', $id);
Event::dispatch('core.locale.delete.after', $id);
session()->flash('success', trans('admin::app.settings.locales.delete-success'));

View File

@ -7,6 +7,7 @@ use Webkul\Core\Eloquent\Repository;
use Illuminate\Support\Facades\Event;
use Illuminate\Container\Container as App;
use Webkul\Core\Repositories\ChannelRepository;
use Illuminate\Support\Arr;
/**
* Slider Repository
@ -55,7 +56,7 @@ class SliderRepository extends Repository
*/
public function save(array $data)
{
Event::fire('core.settings.slider.create.before', $id);
Event::dispatch('core.settings.slider.create.before', $data);
$channelName = $this->channelRepository->find($data['channel_id'])->name;
@ -65,7 +66,7 @@ class SliderRepository extends Repository
$image = false;
if (isset($data['image'])) {
$image = $first = array_first($data['image'], function ($value, $key) {
$image = $first = Arr::first($data['image'], function ($value, $key) {
if ($value)
return $value;
else
@ -87,7 +88,7 @@ class SliderRepository extends Repository
$slider = $this->create($data);
Event::fire('core.settings.slider.create.after', $slider);
Event::dispatch('core.settings.slider.create.after', $slider);
return true;
}
@ -98,7 +99,7 @@ class SliderRepository extends Repository
*/
public function updateItem(array $data, $id)
{
Event::fire('core.settings.slider.update.before', $id);
Event::dispatch('core.settings.slider.update.before', $id);
$channelName = $this->channelRepository->find($data['channel_id'])->name;
@ -107,7 +108,7 @@ class SliderRepository extends Repository
$uploaded = $image = false;
if (isset($data['image'])) {
$image = $first = array_first($data['image'], function ($value, $key) {
$image = $first = Arr::first($data['image'], function ($value, $key) {
return $value ? $value : false;
});
}
@ -130,7 +131,7 @@ class SliderRepository extends Repository
$slider = $this->update($data, $id);
Event::fire('core.settings.slider.update.after', $slider);
Event::dispatch('core.settings.slider.update.after', $slider);
return true;
}

View File

@ -98,11 +98,11 @@ class RegistrationController extends Controller
$verificationData['token'] = md5(uniqid(rand(), true));
$data['token'] = $verificationData['token'];
Event::fire('customer.registration.before');
Event::dispatch('customer.registration.before');
$customer = $this->customerRepository->create($data);
Event::fire('customer.registration.after', $customer);
Event::dispatch('customer.registration.after', $customer);
if ($customer) {
if (core()->getConfigData('customer.settings.email.verification')) {

View File

@ -85,7 +85,7 @@ class SessionController extends Controller
}
//Event passed to prepare cart after login
Event::fire('customer.after.login', request('email'));
Event::dispatch('customer.after.login', request('email'));
return redirect()->intended(route($this->_config['redirect']));
}
@ -100,7 +100,7 @@ class SessionController extends Controller
{
auth()->guard('customer')->logout();
Event::fire('customer.after.logout', $id);
Event::dispatch('customer.after.logout', $id);
return redirect()->route($this->_config['redirect']);
}

View File

@ -170,7 +170,7 @@ class WishlistController extends Controller
} catch (\Exception $e) {
session()->flash('warning', $e->getMessage());
return redirect()->route('shop.productOrCategory.index', ['slug' => $wishlistItem->product->url_key]);
return redirect()->route('shop.productOrCategory.index', ['slugOrPath' => $wishlistItem->product->url_key]);
}
}

View File

@ -31,7 +31,6 @@ class RegistrationEmail extends Mailable
public function build()
{
return $this->to($this->data['email'])
->from(config('mail.from'))
->subject(trans('shop::app.mail.customer.registration.customer-registration'))
->view('shop::emails.customer.registration')->with('data', $this->data);
}

View File

@ -31,7 +31,6 @@ class VerificationEmail extends Mailable
public function build()
{
return $this->to($this->verificationData['email'])
->from(config('mail.from'))
->subject(trans('shop::app.mail.customer.verification.subject'))
->view('shop::emails.customer.verification-email')->with('data', ['email' => $this->verificationData['email'], 'token' => $this->verificationData['token']]);
}

View File

@ -21,7 +21,6 @@ class CustomerResetPassword extends ResetPassword
}
return (new MailMessage)
->from(config('mail.from'))
->subject(__('shop::app.mail.forget-password.subject') )
->view('shop::emails.customer.forget-password', [
'user_name' => $notifiable->name,

View File

@ -31,7 +31,7 @@ class CustomerAddressRepository extends Repository
*/
public function create(array $data)
{
Event::fire('customer.addresses.create.before');
Event::dispatch('customer.addresses.create.before');
$data['default_address'] = isset($data['default_address']) ? 1 : 0;
@ -45,7 +45,7 @@ class CustomerAddressRepository extends Repository
$address = $this->model->create($data);
Event::fire('customer.addresses.create.after', $address);
Event::dispatch('customer.addresses.create.after', $address);
return $address;
}
@ -60,7 +60,7 @@ class CustomerAddressRepository extends Repository
{
$address = $this->find($id);
Event::fire('customer.addresses.update.before', $id);
Event::dispatch('customer.addresses.update.before', $id);
$data['default_address'] = isset($data['default_address']) ? 1 : 0;
@ -77,7 +77,7 @@ class CustomerAddressRepository extends Repository
$address->update($data);
}
Event::fire('customer.addresses.update.after', $id);
Event::dispatch('customer.addresses.update.after', $id);
return $address;
}

View File

@ -84,11 +84,11 @@ class InventorySourceController extends Controller
$data['status'] = !isset($data['status']) ? 0 : 1;
Event::fire('inventory.inventory_source.create.before');
Event::dispatch('inventory.inventory_source.create.before');
$inventorySource = $this->inventorySourceRepository->create($data);
Event::fire('inventory.inventory_source.create.after', $inventorySource);
Event::dispatch('inventory.inventory_source.create.after', $inventorySource);
session()->flash('success', trans('admin::app.settings.inventory_sources.create-success'));
@ -133,11 +133,11 @@ class InventorySourceController extends Controller
$data['status'] = !isset($data['status']) ? 0 : 1;
Event::fire('inventory.inventory_source.update.before', $id);
Event::dispatch('inventory.inventory_source.update.before', $id);
$inventorySource = $this->inventorySourceRepository->update($data, $id);
Event::fire('inventory.inventory_source.update.after', $inventorySource);
Event::dispatch('inventory.inventory_source.update.after', $inventorySource);
session()->flash('success', trans('admin::app.settings.inventory_sources.update-success'));
@ -158,11 +158,11 @@ class InventorySourceController extends Controller
session()->flash('error', trans('admin::app.settings.inventory_sources.last-delete-error'));
} else {
try {
Event::fire('inventory.inventory_source.delete.before', $id);
Event::dispatch('inventory.inventory_source.delete.before', $id);
$this->inventorySourceRepository->delete($id);
Event::fire('inventory.inventory_source.delete.after', $id);
Event::dispatch('inventory.inventory_source.delete.after', $id);
session()->flash('success', trans('admin::app.settings.inventory_sources.delete-success'));

View File

@ -4,6 +4,7 @@ namespace Webkul\Product\Helpers;
use Webkul\Product\Repositories\ProductRepository as Product;
use Webkul\Attribute\Repositories\AttributeFamilyRepository as AttributeFamily;
use Illuminate\Support\Str;
class GenerateProduct
{
@ -41,7 +42,7 @@ class GenerateProduct
'code' => 'default'
]);
$sku = str_random(10);
$sku = Str::random(10);
$data['sku'] = strtolower($sku);
$data['attribute_family_id'] = $attributeFamily->first()->id;
$data['type'] = 'simple';
@ -51,23 +52,22 @@ class GenerateProduct
unset($data);
$faker = \Faker\Factory::create();
$date = date('Y-m-d');
$date = \Carbon\Carbon::parse($date);
$specialFrom = $date->toDateString();
$specialTo = $date->addDays(7)->toDateString();
foreach ($attributes as $attribute) {
if ($attribute->type == 'text') {
if ($attribute->code == 'width' || $attribute->code == 'height' || $attribute->code == 'depth' || $attribute->code == 'weight') {
foreach ($attributes as $attribute) {
if ($attribute->type == 'text') {
if ($attribute->code == 'width' || $attribute->code == 'height' || $attribute->code == 'depth' || $attribute->code == 'weight') {
$data[$attribute->code] = $faker->randomNumber(3);
} else if ($attribute->code == 'url_key') {
} else if ($attribute->code == 'url_key') {
$data[$attribute->code] = strtolower($sku);
} else if ($attribute->code != 'sku') {
$data[$attribute->code] = $faker->name;
} else {
$data[$attribute->code] = $sku;
}
$data[$attribute->code] = $sku;
}
} else if ($attribute->type == 'textarea') {
$data[$attribute->code] = $faker->text;
@ -99,7 +99,7 @@ class GenerateProduct
} else {
$data[$attribute->code] = "";
}
} else if ($attribute->type == 'multiselect') {
} else if ($attribute->type == 'multiselect') {
if ($options->count()) {
$option = $options->first()->id;
@ -152,7 +152,7 @@ class GenerateProduct
];
$updated = $this->product->update($data, $product->id);
return $updated;
}

View File

@ -310,7 +310,7 @@ class ProductController extends Controller
*/
public function sync()
{
Event::fire('products.datagrid.sync', true);
Event::dispatch('products.datagrid.sync', true);
return redirect()->route('admin.catalog.products.index');
}

View File

@ -45,7 +45,7 @@ class ReviewController extends Controller
/**
* Display a listing of the resource.
*
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function index()
{
@ -56,7 +56,7 @@ class ReviewController extends Controller
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function edit($id)
{
@ -73,11 +73,11 @@ class ReviewController extends Controller
*/
public function update($id)
{
Event::fire('customer.review.update.before', $id);
Event::dispatch('customer.review.update.before', $id);
$this->productReviewRepository->update(request()->all(), $id);
Event::fire('customer.review.update.after', $id);
Event::dispatch('customer.review.update.after', $id);
session()->flash('success', trans('admin::app.response.update-success', ['name' => 'Review']));
@ -95,11 +95,11 @@ class ReviewController extends Controller
$productReview = $this->productReviewRepository->findOrFail($id);
try {
Event::fire('customer.review.delete.before', $id);
Event::dispatch('customer.review.delete.before', $id);
$this->productReviewRepository->delete($id);
Event::fire('customer.review.delete.after', $id);
Event::dispatch('customer.review.delete.after', $id);
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Review']));
@ -127,11 +127,11 @@ class ReviewController extends Controller
foreach ($indexes as $key => $value) {
try {
Event::fire('customer.review.delete.before', $value);
Event::dispatch('customer.review.delete.before', $value);
$this->productReviewRepository->delete($value);
Event::fire('customer.review.delete.after', $value);
Event::dispatch('customer.review.delete.after', $value);
} catch(\Exception $e) {
$suppressFlash = true;
@ -173,11 +173,11 @@ class ReviewController extends Controller
try {
if ($data['massaction-type'] == 'update') {
if ($data['update-options'] == 1) {
Event::fire('customer.review.update.before', $value);
Event::dispatch('customer.review.update.before', $value);
$review->update(['status' => 'approved']);
Event::fire('customer.review.update.after', $review);
Event::dispatch('customer.review.update.after', $review);
} else if ($data['update-options'] == 0) {
$review->update(['status' => 'pending']);
} else if ($data['update-options'] == 2) {

View File

@ -3,6 +3,7 @@
namespace Webkul\Product\Repositories;
use Webkul\Core\Eloquent\Repository;
use Illuminate\Support\Str;
/**
* ProductBundleOptionProduct Repository
@ -28,9 +29,9 @@ class ProductBundleOptionProductRepository extends Repository
if (isset($data['products'])) {
$this->setIsDefaultFlag($data);
foreach ($data['products'] as $bundleOptionProductId => $bundleOptionProductInputs) {
if (str_contains($bundleOptionProductId, 'product_')) {
if (Str::contains($bundleOptionProductId, 'product_')) {
$this->create(array_merge([
'product_bundle_option_id' => $productBundleOption->id,
], $bundleOptionProductInputs));
@ -56,14 +57,14 @@ class ProductBundleOptionProductRepository extends Repository
{
if (! count($data['products']))
return;
$haveIsDefaulFlag = false;
foreach ($data['products'] as $key => $product) {
if (isset($product['is_default']) && $product['is_default']) {
$haveIsDefaulFlag = true;
} else {
$data['products'][$key]['is_default'] = 0;
$data['products'][$key]['is_default'] = 0;
}
}

View File

@ -4,6 +4,7 @@ namespace Webkul\Product\Repositories;
use Illuminate\Container\Container as App;
use Webkul\Core\Eloquent\Repository;
use Illuminate\Support\Str;
/**
* ProductBundleOption Repository
@ -52,7 +53,7 @@ class ProductBundleOptionRepository extends Repository
if (isset($data['bundle_options'])) {
foreach ($data['bundle_options'] as $bundleOptionId => $bundleOptionInputs) {
if (str_contains($bundleOptionId, 'option_')) {
if (Str::contains($bundleOptionId, 'option_')) {
$productBundleOption = $this->create(array_merge([
'product_id' => $product->id,
], $bundleOptionInputs));

View File

@ -4,6 +4,7 @@ namespace Webkul\Product\Repositories;
use Illuminate\Support\Facades\Storage;
use Webkul\Core\Eloquent\Repository;
use Illuminate\Support\Str;
/**
* Product Downloadable Link Reposotory
@ -54,7 +55,7 @@ class ProductDownloadableLinkRepository extends Repository
if (isset($data['downloadable_links'])) {
foreach ($data['downloadable_links'] as $linkId => $data) {
if (str_contains($linkId, 'link_')) {
if (Str::contains($linkId, 'link_')) {
$this->create(array_merge([
'product_id' => $product->id,
], $data));

View File

@ -4,6 +4,7 @@ namespace Webkul\Product\Repositories;
use Illuminate\Support\Facades\Storage;
use Webkul\Core\Eloquent\Repository;
use Illuminate\Support\Str;
/**
* Product Downloadable Sample Reposotory
@ -52,7 +53,7 @@ class ProductDownloadableSampleRepository extends Repository
if (isset($data['downloadable_samples'])) {
foreach ($data['downloadable_samples'] as $sampleId => $data) {
if (str_contains($sampleId, 'sample_')) {
if (Str::contains($sampleId, 'sample_')) {
$this->create(array_merge([
'product_id' => $product->id,
], $data));

View File

@ -4,6 +4,7 @@ namespace Webkul\Product\Repositories;
use Webkul\Core\Eloquent\Repository;
use Webkul\Product\Repositories\ProductRepository;
use Illuminate\Support\Str;
/**
* Product Grouped Product Repository
@ -29,7 +30,7 @@ class ProductGroupedProductRepository extends Repository
if (isset($data['links'])) {
foreach ($data['links'] as $linkId => $linkInputs) {
if (str_contains($linkId, 'link_')) {
if (Str::contains($linkId, 'link_')) {
$this->create(array_merge([
'product_id' => $product->id,
], $linkInputs));

View File

@ -4,6 +4,7 @@ namespace Webkul\Product\Repositories;
use Illuminate\Support\Facades\Storage;
use Webkul\Core\Eloquent\Repository;
use Illuminate\Support\Str;
/**
* Product Image Reposotory
@ -37,7 +38,7 @@ class ProductImageRepository extends Repository
$file = 'images.' . $imageId;
$dir = 'product/' . $product->id;
if (str_contains($imageId, 'image_')) {
if (Str::contains($imageId, 'image_')) {
if (request()->hasFile($file)) {
$this->create([
'path' => request()->file($file)->store($dir),

View File

@ -58,13 +58,13 @@ class ProductRepository extends Repository
*/
public function create(array $data)
{
Event::fire('catalog.product.create.before');
Event::dispatch('catalog.product.create.before');
$typeInstance = app(config('product_types.' . $data['type'] . '.class'));
$product = $typeInstance->create($data);
Event::fire('catalog.product.create.after', $product);
Event::dispatch('catalog.product.create.after', $product);
return $product;
}
@ -77,7 +77,7 @@ class ProductRepository extends Repository
*/
public function update(array $data, $id, $attribute = "id")
{
Event::fire('catalog.product.update.before', $id);
Event::dispatch('catalog.product.update.before', $id);
$product = $this->find($id);
@ -86,7 +86,7 @@ class ProductRepository extends Repository
if (isset($data['channels']))
$product['channels'] = $data['channels'];
Event::fire('catalog.product.update.after', $product);
Event::dispatch('catalog.product.update.after', $product);
return $product;
}
@ -97,11 +97,11 @@ class ProductRepository extends Repository
*/
public function delete($id)
{
Event::fire('catalog.product.delete.before', $id);
Event::dispatch('catalog.product.delete.before', $id);
parent::delete($id);
Event::fire('catalog.product.delete.after', $id);
Event::dispatch('catalog.product.delete.after', $id);
}
/**

View File

@ -181,7 +181,7 @@ class Bundle extends AbstractType
}
if (! $haveRequiredOptions)
$minPrice = min($minPrices);
$minPrice = count($minPrices) ? min($minPrices) : 0;
return $minPrice;
}

View File

@ -4,6 +4,7 @@ namespace Webkul\Product\Type;
use Webkul\Product\Models\ProductAttributeValue;
use Webkul\Product\Models\ProductFlat;
use Illuminate\Support\Str;
/**
* Class Configurable.
@ -96,7 +97,7 @@ class Configurable extends AbstractType
if (isset($data['variants'])) {
foreach ($data['variants'] as $variantId => $variantData) {
if (str_contains($variantId, 'variant_')) {
if (Str::contains($variantId, 'variant_')) {
$permutation = [];
foreach ($product->super_attributes as $superAttribute) {

View File

@ -52,7 +52,7 @@ class InvoiceItemRepository extends Repository
->whereIn('inventory_source_id', $data['invoice']->order->channel->inventory_sources()->pluck('id'))
->orderBy('qty', 'desc')
->get();
foreach ($inventories as $key => $inventory) {
if ($inventory->qty >= $data['qty']) {
$inventory->update(['qty' => $inventory->qty - $data['qty']]);
@ -65,6 +65,6 @@ class InvoiceItemRepository extends Repository
}
}
Event::fire('catalog.product.update.after', $data['product']);
Event::dispatch('catalog.product.update.after', $data['product']);
}
}

View File

@ -94,7 +94,7 @@ class InvoiceRepository extends Repository
DB::beginTransaction();
try {
Event::fire('sales.invoice.save.before', $data);
Event::dispatch('sales.invoice.save.before', $data);
$order = $this->orderRepository->find($data['order_id']);
@ -162,7 +162,7 @@ class InvoiceRepository extends Repository
'product_type' => $childOrderItem->product_type,
'additional' => $childOrderItem->additional
]);
if ($childOrderItem->product && ! $childOrderItem->getTypeInstance()->isStockable() && $childOrderItem->getTypeInstance()->showQuantityBox()) {
$this->invoiceItemRepository->updateProductInventory([
'invoice' => $invoice,
@ -194,7 +194,7 @@ class InvoiceRepository extends Repository
$this->orderRepository->updateOrderStatus($order);
Event::fire('sales.invoice.save.after', $invoice);
Event::dispatch('sales.invoice.save.after', $invoice);
} catch (\Exception $e) {
DB::rollBack();
@ -205,7 +205,7 @@ class InvoiceRepository extends Repository
return $invoice;
}
/**
* @param mixed $invoice
* @return mixed

View File

@ -74,11 +74,7 @@ class OrderRepository extends Repository
DB::beginTransaction();
try {
// first prepare all data, then send the 'before' event so hooked in business logic
// gets all prepared data:
$data = $this->prepareOrderData($data);
Event::fire('checkout.order.save.before', $data);
Event::dispatch('checkout.order.save.before', $data);
$order = $this->model->create($data);
@ -90,9 +86,25 @@ class OrderRepository extends Repository
$order->addresses()->create($data['billing_address']);
$this->handleOrderItems($order, $data);
foreach ($data['items'] as $item) {
Event::dispatch('checkout.order.orderitem.save.before', $data);
Event::fire('checkout.order.save.after', $order);
$orderItem = $this->orderItemRepository->create(array_merge($item, ['order_id' => $order->id]));
if (isset($item['children']) && $item['children']) {
foreach ($item['children'] as $child) {
$this->orderItemRepository->create(array_merge($child, ['order_id' => $order->id, 'parent_id' => $orderItem->id]));
}
}
$this->orderItemRepository->manageInventory($orderItem);
$this->downloadableLinkPurchasedRepository->saveLinks($orderItem, 'available');
Event::dispatch('checkout.order.orderitem.save.after', $data);
}
Event::dispatch('checkout.order.save.after', $order);
} catch (\Exception $e) {
DB::rollBack();
@ -117,7 +129,7 @@ class OrderRepository extends Repository
return false;
}
Event::fire('sales.order.cancel.before', $order);
Event::dispatch('sales.order.cancel.before', $order);
foreach ($order->items as $item) {
if (! $item->qty_to_cancel) {
@ -158,7 +170,7 @@ class OrderRepository extends Repository
$this->updateOrderStatus($order);
Event::fire('sales.order.cancel.after', $order);
Event::dispatch('sales.order.cancel.after', $order);
return true;
}
@ -345,58 +357,4 @@ class OrderRepository extends Repository
return $order;
}
/**
* @param array $data
*
* @return array
*/
private function prepareOrderData(array $data): array
{
if (isset($data['customer']) && $data['customer']) {
$data['customer_id'] = $data['customer']->id;
$data['customer_type'] = get_class($data['customer']);
} else {
unset($data['customer']);
}
if (isset($data['channel']) && $data['channel']) {
$data['channel_id'] = $data['channel']->id;
$data['channel_type'] = get_class($data['channel']);
$data['channel_name'] = $data['channel']->name;
} else {
unset($data['channel']);
}
$data['increment_id'] = $this->generateIncrementId();
$data['status'] = 'pending';
return $data;
}
/**
* @param array $data
* @param $order
*/
private function handleOrderItems(Order $order, array $data): void
{
foreach ($data['items'] as $item) {
Event::fire('checkout.order.orderitem.save.before', $data);
$orderItem = $this->orderItemRepository->create(array_merge($item, ['order_id' => $order->id]));
if (isset($item['children']) && $item['children']) {
foreach ($item['children'] as $child) {
$this->orderItemRepository->create(array_merge($child, ['order_id' => $order->id, 'parent_id' => $orderItem->id]));
}
}
$this->orderItemRepository->manageInventory($orderItem);
$this->downloadableLinkPurchasedRepository->saveLinks($orderItem, 'available');
Event::fire('checkout.order.orderitem.save.after', $data);
}
}
}

View File

@ -91,7 +91,7 @@ class RefundRepository extends Repository
DB::beginTransaction();
try {
Event::fire('sales.refund.save.before', $data);
Event::dispatch('sales.refund.save.before', $data);
$order = $this->orderRepository->find($data['order_id']);
@ -165,7 +165,7 @@ class RefundRepository extends Repository
'product_type' => $childOrderItem->product_type,
'additional' => $childOrderItem->additional
]);
if ($childOrderItem->getTypeInstance()->isStockable() || $childOrderItem->getTypeInstance()->showQuantityBox())
$this->refundItemRepository->returnQtyToProductInventory($childOrderItem, $finalQty);
@ -189,7 +189,7 @@ class RefundRepository extends Repository
$this->orderRepository->updateOrderStatus($order);
Event::fire('sales.refund.save.after', $refund);
Event::dispatch('sales.refund.save.after', $refund);
} catch (\Exception $e) {
DB::rollBack();

View File

@ -58,6 +58,6 @@ class ShipmentItemRepository extends Repository
$inventory->update(['qty' => $qty]);
Event::fire('catalog.product.update.after', $data['product']);
Event::dispatch('catalog.product.update.after', $data['product']);
}
}

View File

@ -63,7 +63,7 @@ class ShipmentRepository extends Repository
parent::__construct($app);
}
/**
* Specify Model class name
*
@ -82,9 +82,9 @@ class ShipmentRepository extends Repository
public function create(array $data)
{
DB::beginTransaction();
try {
Event::fire('sales.shipment.save.before', $data);
Event::dispatch('sales.shipment.save.before', $data);
$order = $this->orderRepository->find($data['order_id']);
@ -141,7 +141,7 @@ class ShipmentRepository extends Repository
'qty' => $finalQty,
'vendor_id' => isset($data['vendor_id']) ? $data['vendor_id'] : 0
]);
$this->orderItemRepository->update(['qty_shipped' => $child->qty_shipped + $finalQty], $child->id);
}
} else {
@ -163,13 +163,13 @@ class ShipmentRepository extends Repository
$this->orderRepository->updateOrderStatus($order);
Event::fire('sales.shipment.save.after', $shipment);
Event::dispatch('sales.shipment.save.after', $shipment);
} catch (\Exception $e) {
DB::rollBack();
throw $e;
}
DB::commit();
return $shipment;

View File

@ -0,0 +1,111 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Migrations\Migration;
class AlterTriggerCategoryTranslations extends Migration
{
private const TRIGGER_NAME_INSERT = 'trig_category_translations_insert';
private const TRIGGER_NAME_UPDATE = 'trig_category_translations_update';
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$triggerBody = $this->getTriggerBody();
$insertTrigger = <<< SQL
CREATE TRIGGER %s
BEFORE INSERT ON category_translations
FOR EACH ROW
BEGIN
$triggerBody
END;
SQL;
$updateTrigger = <<< SQL
CREATE TRIGGER %s
BEFORE UPDATE ON category_translations
FOR EACH ROW
BEGIN
$triggerBody
END;
SQL;
$this->dropTriggers();
DB::unprepared(sprintf($insertTrigger, self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf($updateTrigger, self::TRIGGER_NAME_UPDATE));
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$this->dropTriggers();
}
/**
* Drop the triggers
*/
private function dropTriggers()
{
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
}
/**
* Returns trigger body as string
*
* @return string
*/
private function getTriggerBody()
{
return <<<SQL
DECLARE parentUrlPath varchar(255);
DECLARE urlPath varchar(255);
IF NOT EXISTS (
SELECT id
FROM categories
WHERE
id = NEW.category_id
AND parent_id IS NULL
)
THEN
SELECT
GROUP_CONCAT(parent_translations.slug SEPARATOR '/') INTO parentUrlPath
FROM
categories AS node,
categories AS parent
JOIN category_translations AS parent_translations ON parent.id = parent_translations.category_id
WHERE
node._lft >= parent._lft
AND node._rgt <= parent._rgt
AND node.id = (SELECT parent_id FROM categories WHERE id = NEW.category_id)
AND node.parent_id IS NOT NULL
AND parent.parent_id IS NOT NULL
AND parent_translations.locale = NEW.locale
GROUP BY
node.id;
IF parentUrlPath IS NULL
THEN
SET urlPath = NEW.slug;
ELSE
SET urlPath = concat(parentUrlPath, '/', NEW.slug);
END IF;
SET NEW.url_path = urlPath;
END IF;
SQL;
}
}

View File

@ -0,0 +1,75 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Migrations\Migration;
class AlterStoredFunctionUrlPathCategory extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$functionSQL = <<< SQL
DROP FUNCTION IF EXISTS `get_url_path_of_category`;
CREATE FUNCTION get_url_path_of_category(
categoryId INT,
localeCode VARCHAR(255)
)
RETURNS VARCHAR(255)
DETERMINISTIC
BEGIN
DECLARE urlPath VARCHAR(255);
IF NOT EXISTS (
SELECT id
FROM categories
WHERE
id = categoryId
AND parent_id IS NULL
)
THEN
SELECT
GROUP_CONCAT(parent_translations.slug SEPARATOR '/') INTO urlPath
FROM
categories AS node,
categories AS parent
JOIN category_translations AS parent_translations ON parent.id = parent_translations.category_id
WHERE
node._lft >= parent._lft
AND node._rgt <= parent._rgt
AND node.id = categoryId
AND node.parent_id IS NOT NULL
AND parent.parent_id IS NOT NULL
AND parent_translations.locale = localeCode
GROUP BY
node.id;
IF urlPath IS NULL
THEN
SET urlPath = (SELECT slug FROM category_translations WHERE category_translations.category_id = categoryId);
END IF;
ELSE
SET urlPath = '';
END IF;
RETURN urlPath;
END;
SQL;
DB::unprepared($functionSQL);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
DB::unprepared('DROP FUNCTION IF EXISTS `get_url_path_of_category`;');
}
}

View File

@ -0,0 +1,114 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTriggerOnCategories extends Migration
{
private const TRIGGER_NAME_INSERT = 'trig_categories_insert';
private const TRIGGER_NAME_UPDATE = 'trig_categories_update';
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$triggerBody = $this->getTriggerBody();
$insertTrigger = <<< SQL
CREATE TRIGGER %s
AFTER INSERT ON categories
FOR EACH ROW
BEGIN
$triggerBody
END;
SQL;
$updateTrigger = <<< SQL
CREATE TRIGGER %s
AFTER UPDATE ON categories
FOR EACH ROW
BEGIN
$triggerBody
END;
SQL;
$this->dropTriggers();
DB::unprepared(sprintf($insertTrigger, self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf($updateTrigger, self::TRIGGER_NAME_UPDATE));
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$this->dropTriggers();
}
private function dropTriggers()
{
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
}
/**
* Returns trigger body as string
*
* @return string
*/
private function getTriggerBody(): string
{
return <<< SQL
DECLARE urlPath VARCHAR(255);
DECLARE localeCode VARCHAR(255);
DECLARE done INT;
DECLARE curs CURSOR FOR (SELECT category_translations.locale
FROM category_translations
WHERE category_id = NEW.id);
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
IF EXISTS (
SELECT *
FROM category_translations
WHERE category_id = NEW.id
)
THEN
OPEN curs;
SET done = 0;
REPEAT
FETCH curs INTO localeCode;
SELECT get_url_path_of_category(NEW.id, localeCode) INTO urlPath;
IF NEW.parent_id IS NULL
THEN
SET urlPath = '';
END IF;
UPDATE category_translations
SET url_path = urlPath
WHERE
category_translations.category_id = NEW.id
AND category_translations.locale = localeCode;
UNTIL done END REPEAT;
CLOSE curs;
END IF;
SQL;
}
}

View File

@ -61,7 +61,7 @@ class CartController extends Controller
/**
* Method to populate the cart page which will be populated before the checkout process.
*
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function index()
{
@ -96,7 +96,7 @@ class CartController extends Controller
$product = $this->productRepository->find($id);
return redirect()->route('shop.productOrCategory.index', ['slug' => $product->url_key]);
return redirect()->route('shop.productOrCategory.index', ['slugOrPath' => $product->url_key]);
}
return redirect()->back();

View File

@ -87,7 +87,7 @@ class ReviewController extends Controller
if (auth()->guard('customer')->user()) {
$data['customer_id'] = auth()->guard('customer')->user()->id;
$data['name'] = auth()->guard('customer')->user()->first_name .' ' . auth()->guard('customer')->user()->last_name;
$data['name'] = auth()->guard('customer')->user()->first_name . ' ' . auth()->guard('customer')->user()->last_name;
}
$data['status'] = 'pending';
@ -110,7 +110,7 @@ class ReviewController extends Controller
{
$product = $this->productRepository->findBySlugOrFail($slug);
return view($this->_config['view'],compact('product'));
return view($this->_config['view'], compact('product'));
}
/**

View File

@ -30,8 +30,7 @@ class SubscriptionEmail extends Mailable
*/
public function build()
{
return $this->to($this->subscriptionData['email'])
->from(config('mail.from.address'),config('mail.from.name'))
return $this->to($this->subscriptionData['email'])
->subject(trans('shop::app.mail.customer.subscription.subject'))
->view('shop::emails.customer.subscription-email')->with('data', ['content' => 'You Are Subscribed', 'token' => $this->subscriptionData['token']]);

View File

@ -35,7 +35,6 @@
<div class="account-item-card mt-15 mb-15">
<div class="media-info">
<?php $image = $productImageHelper->getProductBaseImage($review->product); ?>
<a href="{{ route('shop.productOrCategory.index', $review->product->url_key) }}" title="{{ $review->product->name }}">
<img class="media" src="{{ $image['small_image_url'] }}"/>
</a>

View File

@ -5,7 +5,7 @@
@stop
@section('seo')
<meta name="description" content="{{ trim($product->meta_description) != "" ? $product->meta_description : str_limit(strip_tags($product->description), 120, '') }}"/>
<meta name="description" content="{{ trim($product->meta_description) != "" ? $product->meta_description : \Illuminate\Support\Str::limit(strip_tags($product->description), 120, '') }}"/>
<meta name="keywords" content="{{ $product->meta_keywords }}"/>
@stop
@ -52,7 +52,6 @@
@else
<input type="hidden" name="quantity" value="1">
@endif
{!! view_render_event('bagisto.shop.products.view.quantity.after', ['product' => $product]) !!}
@ -63,7 +62,7 @@
@include ('shop::products.view.grouped-products')
@include ('shop::products.view.bundle-options')
{!! view_render_event('bagisto.shop.products.view.description.before', ['product' => $product]) !!}
<accordian :title="'{{ __('shop::app.products.description') }}'" :active="true">

View File

@ -57,7 +57,7 @@ class TaxCategoryController extends Controller
/**
* Function to show the tax category form
*
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function show()
{
@ -82,14 +82,14 @@ class TaxCategoryController extends Controller
'taxrates' => 'array|required'
]);
Event::fire('tax.tax_category.create.before');
Event::dispatch('tax.tax_category.create.before');
$taxCategory = $this->taxCategoryRepository->create($data);
//attach the categories in the tax map table
$this->taxCategoryRepository->attachOrDetach($taxCategory, $data['taxrates']);
Event::fire('tax.tax_category.create.after', $taxCategory);
Event::dispatch('tax.tax_category.create.after', $taxCategory);
session()->flash('success', trans('admin::app.settings.tax-categories.create-success'));
@ -100,7 +100,7 @@ class TaxCategoryController extends Controller
* To show the edit form form the tax category
*
* @param int $id
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function edit($id)
{
@ -127,11 +127,11 @@ class TaxCategoryController extends Controller
$data = request()->input();
Event::fire('tax.tax_category.update.before', $id);
Event::dispatch('tax.tax_category.update.before', $id);
$taxCategory = $this->taxCategoryRepository->update($data, $id);
Event::fire('tax.tax_category.update.after', $taxCategory);
Event::dispatch('tax.tax_category.update.after', $taxCategory);
if (! $taxCategory) {
session()->flash('error', trans('admin::app.settings.tax-categories.update-error'));
@ -160,11 +160,11 @@ class TaxCategoryController extends Controller
$taxCategory = $this->taxCategoryRepository->findOrFail($id);
try {
Event::fire('tax.tax_category.delete.before', $id);
Event::dispatch('tax.tax_category.delete.before', $id);
$this->taxCategoryRepository->delete($id);
Event::fire('tax.tax_category.delete.after', $id);
Event::dispatch('tax.tax_category.delete.after', $id);
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Tax Category']));

View File

@ -47,7 +47,7 @@ class TaxRateController extends Controller
/**
* Display a listing resource for the available tax rates.
*
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function index() {
@ -57,7 +57,7 @@ class TaxRateController extends Controller
/**
* Display a create form for tax rate
*
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function show()
{
@ -88,11 +88,11 @@ class TaxRateController extends Controller
unset($data['zip_code']);
}
Event::fire('tax.tax_rate.create.before');
Event::dispatch('tax.tax_rate.create.before');
$taxRate = $this->taxRateRepository->create($data);
Event::fire('tax.tax_rate.create.after', $taxRate);
Event::dispatch('tax.tax_rate.create.after', $taxRate);
session()->flash('success', trans('admin::app.settings.tax-rates.create-success'));
@ -102,7 +102,7 @@ class TaxRateController extends Controller
/**
* Show the edit form for the previously created tax rates.
*
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function edit($id)
{
@ -128,11 +128,11 @@ class TaxRateController extends Controller
'tax_rate' => 'required|numeric|min:0.0001'
]);
Event::fire('tax.tax_rate.update.before', $id);
Event::dispatch('tax.tax_rate.update.before', $id);
$taxRate = $this->taxRateRepository->update(request()->input(), $id);
Event::fire('tax.tax_rate.update.after', $taxRate);
Event::dispatch('tax.tax_rate.update.after', $taxRate);
session()->flash('success', trans('admin::app.settings.tax-rates.update-success'));
@ -150,11 +150,11 @@ class TaxRateController extends Controller
$taxRate = $this->taxRateRepository->findOrFail($id);
try {
Event::fire('tax.tax_rate.delete.before', $id);
Event::dispatch('tax.tax_rate.delete.before', $id);
$this->taxRateRepository->delete($id);
Event::fire('tax.tax_rate.delete.after', $id);
Event::dispatch('tax.tax_rate.delete.after', $id);
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Tax Rate']));
@ -217,7 +217,7 @@ class TaxRateController extends Controller
foreach ($filtered as $position => $identifier) {
$message[] = trans('admin::app.export.duplicate-error', ['identifier' => $identifier, 'position' => $position]);
}
$finalMsg = implode(" ", $message);
session()->flash('error', $finalMsg);

View File

@ -31,7 +31,7 @@ class ViewRenderEventManager
{
$this->params = $params ?? [];
Event::fire($eventName, $this);
Event::dispatch($eventName, $this);
return $this->templates;
}
@ -77,7 +77,7 @@ class ViewRenderEventManager
public function render()
{
$string = "";
foreach ($this->templates as $template) {
if (view()->exists($template)) {
$string .= view($template , $this->params)->render();
@ -86,7 +86,7 @@ class ViewRenderEventManager
$string .= $template;
}
}
return $string;
}
}

View File

@ -425,7 +425,7 @@ abstract class DataGrid
$eventName = $className . '.' . $name;
Event::fire($eventName, $this->invoker);
Event::dispatch($eventName, $this->invoker);
}
}

View File

@ -45,7 +45,7 @@ class RoleController extends Controller
/**
* Display a listing of the resource.
*
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function index()
{
@ -55,7 +55,7 @@ class RoleController extends Controller
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function create()
{
@ -74,11 +74,11 @@ class RoleController extends Controller
'permission_type' => 'required',
]);
Event::fire('user.role.create.before');
Event::dispatch('user.role.create.before');
$role = $this->roleRepository->create(request()->all());
Event::fire('user.role.create.after', $role);
Event::dispatch('user.role.create.after', $role);
session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Role']));
@ -89,7 +89,7 @@ class RoleController extends Controller
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function edit($id)
{
@ -111,11 +111,11 @@ class RoleController extends Controller
'permission_type' => 'required',
]);
Event::fire('user.role.update.before', $id);
Event::dispatch('user.role.update.before', $id);
$role = $this->roleRepository->update(request()->all(), $id);
Event::fire('user.role.update.after', $role);
Event::dispatch('user.role.update.after', $role);
session()->flash('success', trans('admin::app.response.update-success', ['name' => 'Role']));
@ -138,11 +138,11 @@ class RoleController extends Controller
session()->flash('error', trans('admin::app.response.last-delete-error', ['name' => 'Role']));
} else {
try {
Event::fire('user.role.delete.before', $id);
Event::dispatch('user.role.delete.before', $id);
$this->roleRepository->delete($id);
Event::fire('user.role.delete.after', $id);
Event::dispatch('user.role.delete.after', $id);
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Role']));

View File

@ -61,7 +61,7 @@ class UserController extends Controller
/**
* Display a listing of the resource.
*
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function index()
{
@ -71,7 +71,7 @@ class UserController extends Controller
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function create()
{
@ -93,11 +93,11 @@ class UserController extends Controller
if (isset($data['password']) && $data['password'])
$data['password'] = bcrypt($data['password']);
Event::fire('user.admin.create.before');
Event::dispatch('user.admin.create.before');
$admin = $this->adminRepository->create($data);
Event::fire('user.admin.create.after', $admin);
Event::dispatch('user.admin.create.after', $admin);
session()->flash('success', trans('admin::app.response.create-success', ['name' => 'User']));
@ -108,7 +108,7 @@ class UserController extends Controller
* Show the form for editing the specified resource.
*
* @param integer $id
* @return \Illuminate\View\View
* @return \Illuminate\View\View
*/
public function edit($id)
{
@ -141,11 +141,11 @@ class UserController extends Controller
$data['status'] = 0;
}
Event::fire('user.admin.update.before', $id);
Event::dispatch('user.admin.update.before', $id);
$admin = $this->adminRepository->update($data, $id);
Event::fire('user.admin.update.after', $admin);
Event::dispatch('user.admin.update.after', $admin);
session()->flash('success', trans('admin::app.response.update-success', ['name' => 'User']));
@ -156,7 +156,7 @@ class UserController extends Controller
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
* @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
*/
public function destroy($id)
{
@ -165,7 +165,7 @@ class UserController extends Controller
if ($this->adminRepository->count() == 1) {
session()->flash('error', trans('admin::app.response.last-delete-error', ['name' => 'Admin']));
} else {
Event::fire('user.admin.delete.before', $id);
Event::dispatch('user.admin.delete.before', $id);
if (auth()->guard('admin')->user()->id == $id) {
return view('admin::customers.confirm-password');
@ -176,7 +176,7 @@ class UserController extends Controller
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Admin']));
Event::fire('user.admin.delete.after', $id);
Event::dispatch('user.admin.delete.after', $id);
return response()->json(['message' => true], 200);
} catch (Exception $e) {
@ -202,11 +202,11 @@ class UserController extends Controller
} else {
$id = auth()->guard('admin')->user()->id;
Event::fire('user.admin.delete.before', $id);
Event::dispatch('user.admin.delete.before', $id);
$this->adminRepository->delete($id);
Event::fire('user.admin.delete.after', $id);
Event::dispatch('user.admin.delete.after', $id);
session()->flash('success', trans('admin::app.users.users.delete-success'));

View File

@ -0,0 +1,5 @@
@extends('errors::minimal')
@section('title', __('Unauthorized'))
@section('code', '401')
@section('message', __('Unauthorized'))

View File

@ -0,0 +1,5 @@
@extends('errors::minimal')
@section('title', __('Forbidden'))
@section('code', '403')
@section('message', __($exception->getMessage() ?: 'Forbidden'))

View File

@ -0,0 +1,5 @@
@extends('errors::minimal')
@section('title', __('Not Found'))
@section('code', '404')
@section('message', __('Not Found'))

View File

@ -0,0 +1,5 @@
@extends('errors::minimal')
@section('title', __('Page Expired'))
@section('code', '419')
@section('message', __('Page Expired'))

View File

@ -0,0 +1,5 @@
@extends('errors::minimal')
@section('title', __('Too Many Requests'))
@section('code', '429')
@section('message', __('Too Many Requests'))

View File

@ -0,0 +1,5 @@
@extends('errors::minimal')
@section('title', __('Server Error'))
@section('code', '500')
@section('message', __('Server Error'))

View File

@ -0,0 +1,5 @@
@extends('errors::minimal')
@section('title', __('Service Unavailable'))
@section('code', '503')
@section('message', __($exception->getMessage() ?: 'Service Unavailable'))

View File

@ -0,0 +1,486 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>@yield('title')</title>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<!-- Styles -->
<style>
html {
line-height: 1.15;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
header,
nav,
section {
display: block;
}
figcaption,
main {
display: block;
}
a {
background-color: transparent;
-webkit-text-decoration-skip: objects;
}
strong {
font-weight: inherit;
}
strong {
font-weight: bolder;
}
code {
font-family: monospace, monospace;
font-size: 1em;
}
dfn {
font-style: italic;
}
svg:not(:root) {
overflow: hidden;
}
button,
input {
font-family: sans-serif;
font-size: 100%;
line-height: 1.15;
margin: 0;
}
button,
input {
overflow: visible;
}
button {
text-transform: none;
}
button,
html [type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
legend {
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: inherit;
display: table;
max-width: 100%;
padding: 0;
white-space: normal;
}
[type="checkbox"],
[type="radio"] {
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
-webkit-appearance: button;
font: inherit;
}
menu {
display: block;
}
canvas {
display: inline-block;
}
template {
display: none;
}
[hidden] {
display: none;
}
html {
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-family: sans-serif;
}
*,
*::before,
*::after {
-webkit-box-sizing: inherit;
box-sizing: inherit;
}
p {
margin: 0;
}
button {
background: transparent;
padding: 0;
}
button:focus {
outline: 1px dotted;
outline: 5px auto -webkit-focus-ring-color;
}
*,
*::before,
*::after {
border-width: 0;
border-style: solid;
border-color: #dae1e7;
}
button,
[type="button"],
[type="reset"],
[type="submit"] {
border-radius: 0;
}
button,
input {
font-family: inherit;
}
input::-webkit-input-placeholder {
color: inherit;
opacity: .5;
}
input:-ms-input-placeholder {
color: inherit;
opacity: .5;
}
input::-ms-input-placeholder {
color: inherit;
opacity: .5;
}
input::placeholder {
color: inherit;
opacity: .5;
}
button,
[role=button] {
cursor: pointer;
}
.bg-transparent {
background-color: transparent;
}
.bg-white {
background-color: #fff;
}
.bg-teal-light {
background-color: #64d5ca;
}
.bg-blue-dark {
background-color: #2779bd;
}
.bg-indigo-light {
background-color: #7886d7;
}
.bg-purple-light {
background-color: #a779e9;
}
.bg-no-repeat {
background-repeat: no-repeat;
}
.bg-cover {
background-size: cover;
}
.border-grey-light {
border-color: #dae1e7;
}
.hover\:border-grey:hover {
border-color: #b8c2cc;
}
.rounded-lg {
border-radius: .5rem;
}
.border-2 {
border-width: 2px;
}
.hidden {
display: none;
}
.flex {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
.items-center {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.justify-center {
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
}
.font-sans {
font-family: Nunito, sans-serif;
}
.font-light {
font-weight: 300;
}
.font-bold {
font-weight: 700;
}
.font-black {
font-weight: 900;
}
.h-1 {
height: .25rem;
}
.leading-normal {
line-height: 1.5;
}
.m-8 {
margin: 2rem;
}
.my-3 {
margin-top: .75rem;
margin-bottom: .75rem;
}
.mb-8 {
margin-bottom: 2rem;
}
.max-w-sm {
max-width: 30rem;
}
.min-h-screen {
min-height: 100vh;
}
.py-3 {
padding-top: .75rem;
padding-bottom: .75rem;
}
.px-6 {
padding-left: 1.5rem;
padding-right: 1.5rem;
}
.pb-full {
padding-bottom: 100%;
}
.absolute {
position: absolute;
}
.relative {
position: relative;
}
.pin {
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.text-black {
color: #22292f;
}
.text-grey-darkest {
color: #3d4852;
}
.text-grey-darker {
color: #606f7b;
}
.text-2xl {
font-size: 1.5rem;
}
.text-5xl {
font-size: 3rem;
}
.uppercase {
text-transform: uppercase;
}
.antialiased {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.tracking-wide {
letter-spacing: .05em;
}
.w-16 {
width: 4rem;
}
.w-full {
width: 100%;
}
@media (min-width: 768px) {
.md\:bg-left {
background-position: left;
}
.md\:bg-right {
background-position: right;
}
.md\:flex {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
.md\:my-6 {
margin-top: 1.5rem;
margin-bottom: 1.5rem;
}
.md\:min-h-screen {
min-height: 100vh;
}
.md\:pb-0 {
padding-bottom: 0;
}
.md\:text-3xl {
font-size: 1.875rem;
}
.md\:text-15xl {
font-size: 9rem;
}
.md\:w-1\/2 {
width: 50%;
}
}
@media (min-width: 992px) {
.lg\:bg-center {
background-position: center;
}
}
</style>
</head>
<body class="antialiased font-sans">
<div class="md:flex min-h-screen">
<div class="w-full md:w-1/2 bg-white flex items-center justify-center">
<div class="max-w-sm m-8">
<div class="text-black text-5xl md:text-15xl font-black">
@yield('code', __('Oh no'))
</div>
<div class="w-16 h-1 bg-purple-light my-3 md:my-6"></div>
<p class="text-grey-darker text-2xl md:text-3xl font-light mb-8 leading-normal">
@yield('message')
</p>
<a href="{{ app('router')->has('home') ? route('home') : url('/') }}">
<button class="bg-transparent text-grey-darkest font-bold uppercase tracking-wide py-3 px-6 border-2 border-grey-light hover:border-grey rounded-lg">
{{ __('Go Home') }}
</button>
</a>
</div>
</div>
<div class="relative pb-full md:flex md:pb-0 md:min-h-screen w-full md:w-1/2">
@yield('image')
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,57 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>@yield('title')</title>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet" type="text/css">
<!-- Styles -->
<style>
html, body {
background-color: #fff;
color: #636b6f;
font-family: 'Nunito', sans-serif;
font-weight: 100;
height: 100vh;
margin: 0;
}
.full-height {
height: 100vh;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.content {
text-align: center;
}
.title {
font-size: 36px;
padding: 20px;
}
</style>
</head>
<body>
<div class="flex-center position-ref full-height">
<div class="content">
<div class="title">
@yield('message')
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>@yield('title')</title>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<!-- Styles -->
<style>
html, body {
background-color: #fff;
color: #636b6f;
font-family: 'Nunito', sans-serif;
font-weight: 100;
height: 100vh;
margin: 0;
}
.full-height {
height: 100vh;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.code {
border-right: 2px solid;
font-size: 26px;
padding: 0 15px 0 15px;
text-align: center;
}
.message {
font-size: 18px;
text-align: center;
}
</style>
</head>
<body>
<div class="flex-center position-ref full-height">
<div class="code">
@yield('code')
</div>
<div class="message" style="padding: 10px;">
@yield('message')
</div>
</div>
</body>
</html>

View File

@ -0,0 +1 @@
{{ $slot }}: {{ $url }}

View File

@ -0,0 +1 @@
{{ $slot }}

View File

@ -0,0 +1 @@
[{{ $slot }}]({{ $url }})

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