base sync with master
This commit is contained in:
commit
1f13298b65
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/admin.js": "/js/admin.js?id=7683c8f127f6ad2ac3ce",
|
||||
"/js/admin.js": "/js/admin.js?id=da5ebef9c25a064e7ed6",
|
||||
"/css/admin.css": "/css/admin.css?id=ccc39419fee98ed8ac7b"
|
||||
}
|
||||
}
|
||||
|
|
@ -34,6 +34,7 @@ class OrderDataGrid extends DataGrid
|
|||
|
||||
$this->addFilter('billed_to', DB::raw('CONCAT(order_address_billing.first_name, " ", order_address_billing.last_name)'));
|
||||
$this->addFilter('shipped_to', DB::raw('CONCAT(order_address_shipping.first_name, " ", order_address_shipping.last_name)'));
|
||||
$this->addFilter('id', 'orders.id');
|
||||
|
||||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,22 +19,23 @@ class OrderShipmentsDataGrid extends DataGrid
|
|||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('shipments as ship')
|
||||
$queryBuilder = DB::table('shipments')
|
||||
->leftJoin('order_address as order_address_shipping', function($leftJoin) {
|
||||
$leftJoin->on('order_address_shipping.order_id', '=', 'ship.order_address_id')
|
||||
$leftJoin->on('order_address_shipping.order_id', '=', 'shipments.order_id')
|
||||
->where('order_address_shipping.address_type', 'shipping');
|
||||
})
|
||||
->leftJoin('orders as ors', 'ship.order_id', '=', 'ors.id')
|
||||
->leftJoin('inventory_sources as is', 'ship.inventory_source_id', '=', 'is.id')
|
||||
->select('ship.id as shipment_id', 'ship.order_id as shipment_order_id', 'ship.total_qty as shipment_total_qty', 'is.name as inventory_source_name', 'ors.created_at as orderdate', 'ship.created_at as shipment_created_at')
|
||||
->leftJoin('orders as ors', 'shipments.order_id', '=', 'ors.id')
|
||||
->leftJoin('inventory_sources as is', 'shipments.inventory_source_id', '=', 'is.id')
|
||||
->select('shipments.id as shipment_id', 'shipments.order_id as shipment_order_id', 'shipments.total_qty as shipment_total_qty', 'is.name as inventory_source_name', 'ors.created_at as orderdate', 'shipments.created_at as shipment_created_at')
|
||||
->addSelect(DB::raw('CONCAT(order_address_shipping.first_name, " ", order_address_shipping.last_name) as shipped_to'));
|
||||
|
||||
$this->addFilter('shipment_id', 'ship.id');
|
||||
$this->addFilter('shipment_order_id', 'ship.order_id');
|
||||
$this->addFilter('shipment_total_qty', 'ship.total_qty');
|
||||
$this->addFilter('shipment_id', 'shipments.id');
|
||||
$this->addFilter('shipment_order_id', 'shipments.order_id');
|
||||
$this->addFilter('shipment_total_qty', 'shipments.total_qty');
|
||||
$this->addFilter('inventory_source_name', 'is.name');
|
||||
$this->addFilter('orderdate', 'ors.created_at');
|
||||
$this->addFilter('shipment_created_at', 'ship.created_at');
|
||||
$this->addFilter('shipment_created_at', 'shipments.created_at');
|
||||
$this->addFilter('shipped_to', DDB::raw('CONCAT(order_address_shipping.first_name, " ", order_address_shipping.last_name) as shipped_to'));
|
||||
|
||||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
</head>
|
||||
|
||||
<body style="scroll-behavior: smooth;">
|
||||
<body @if (app()->getLocale() == 'ar') class="rtl" @endif style="scroll-behavior: smooth;">
|
||||
{!! view_render_event('bagisto.admin.layout.body.before') !!}
|
||||
|
||||
<div id="app">
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
const { mix } = require("laravel-mix");
|
||||
require("laravel-mix-merge-manifest");
|
||||
|
||||
var publicPath = 'publishable/assets';
|
||||
// var publicPath = "../../../public/vendor/webkul/admin/assets";
|
||||
if (mix.inProduction()) {
|
||||
var publicPath = 'publishable/assets';
|
||||
} else {
|
||||
var publicPath = "../../../public/vendor/webkul/admin/assets";
|
||||
}
|
||||
|
||||
mix.setPublicPath(publicPath).mergeManifest();
|
||||
mix.disableNotifications();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Contracts;
|
||||
|
||||
interface Attribute
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Contracts;
|
||||
|
||||
interface AttributeFamily
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Contracts;
|
||||
|
||||
interface AttributeGroup
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Contracts;
|
||||
|
||||
interface AttributeOption
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Contracts;
|
||||
|
||||
interface AttributeOptionTranslation
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Contracts;
|
||||
|
||||
interface AttributeTranslation
|
||||
{
|
||||
}
|
||||
|
|
@ -5,8 +5,9 @@ namespace Webkul\Attribute\Models;
|
|||
use Webkul\Core\Eloquent\TranslatableModel;
|
||||
use Webkul\Attribute\Models\AttributeOption;
|
||||
use Webkul\Attribute\Models\AttributeGroup;
|
||||
use Webkul\Attribute\Contracts\Attribute as AttributeContract;
|
||||
|
||||
class Attribute extends TranslatableModel
|
||||
class Attribute extends TranslatableModel implements AttributeContract
|
||||
{
|
||||
public $translatedAttributes = ['name'];
|
||||
|
||||
|
|
@ -19,7 +20,7 @@ class Attribute extends TranslatableModel
|
|||
*/
|
||||
public function options()
|
||||
{
|
||||
return $this->hasMany(AttributeOption::class);
|
||||
return $this->hasMany(AttributeOptionProxy::modelClass());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
namespace Webkul\Attribute\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Attribute\Models\AttributeGroup;
|
||||
use Webkul\Product\Models\Product;
|
||||
use Webkul\Product\Models\ProductProxy;
|
||||
use Webkul\Attribute\Contracts\AttributeFamily as AttributeFamilyContract;
|
||||
|
||||
class AttributeFamily extends Model
|
||||
class AttributeFamily extends Model implements AttributeFamilyContract
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
|
||||
protected $fillable = ['code', 'name'];
|
||||
|
||||
/**
|
||||
|
|
@ -17,7 +17,7 @@ class AttributeFamily extends Model
|
|||
*/
|
||||
public function custom_attributes()
|
||||
{
|
||||
return Attribute::join('attribute_group_mappings', 'attributes.id', '=', 'attribute_group_mappings.attribute_id')
|
||||
return (AttributeProxy::modelClass())::join('attribute_group_mappings', 'attributes.id', '=', 'attribute_group_mappings.attribute_id')
|
||||
->join('attribute_groups', 'attribute_group_mappings.attribute_group_id', '=', 'attribute_groups.id')
|
||||
->join('attribute_families', 'attribute_groups.attribute_family_id', '=', 'attribute_families.id')
|
||||
->where('attribute_families.id', $this->id)
|
||||
|
|
@ -37,7 +37,7 @@ class AttributeFamily extends Model
|
|||
*/
|
||||
public function attribute_groups()
|
||||
{
|
||||
return $this->hasMany(AttributeGroup::class)->orderBy('position');
|
||||
return $this->hasMany(AttributeGroupProxy::modelClass())->orderBy('position');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -53,6 +53,6 @@ class AttributeFamily extends Model
|
|||
*/
|
||||
public function products()
|
||||
{
|
||||
return $this->hasMany(Product::class);
|
||||
return $this->hasMany(ProductProxy::modelClass());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class AttributeFamilyProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -4,11 +4,12 @@ namespace Webkul\Attribute\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Attribute\Models\Attribute;
|
||||
use Webkul\Attribute\Contracts\AttributeGroup as AttributeGroupContract;
|
||||
|
||||
class AttributeGroup extends Model
|
||||
class AttributeGroup extends Model implements AttributeGroupContract
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
|
||||
protected $fillable = ['name', 'position', 'is_user_defined'];
|
||||
|
||||
/**
|
||||
|
|
@ -16,7 +17,7 @@ class AttributeGroup extends Model
|
|||
*/
|
||||
public function custom_attributes()
|
||||
{
|
||||
return $this->belongsToMany(Attribute::class, 'attribute_group_mappings')
|
||||
return $this->belongsToMany(AttributeProxy::modelClass(), 'attribute_group_mappings')
|
||||
->withPivot('position')
|
||||
->orderBy('pivot_position', 'asc');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class AttributeGroupProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -5,8 +5,9 @@ namespace Webkul\Attribute\Models;
|
|||
use Webkul\Core\Eloquent\TranslatableModel;
|
||||
use Dimsav\Translatable\Translatable;
|
||||
use Webkul\Attribute\Models\Attribute;
|
||||
use Webkul\Attribute\Contracts\AttributeOption as AttributeOptionContract;
|
||||
|
||||
class AttributeOption extends TranslatableModel
|
||||
class AttributeOption extends TranslatableModel implements AttributeOptionContract
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class AttributeOptionProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,9 @@
|
|||
namespace Webkul\Attribute\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Attribute\Contracts\AttributeOptionTranslation as AttributeOptionTranslationContract;
|
||||
|
||||
class AttributeOptionTranslation extends Model
|
||||
class AttributeOptionTranslation extends Model implements AttributeOptionTranslationContract
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class AttributeOptionTranslationProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class AttributeProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,10 +3,11 @@
|
|||
namespace Webkul\Attribute\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Attribute\Contracts\AttributeTranslation as AttributeTranslationContract;
|
||||
|
||||
class AttributeTranslation extends Model
|
||||
class AttributeTranslation extends Model implements AttributeTranslationContract
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
|
||||
protected $fillable = ['name'];
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class AttributeTranslationProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -15,6 +15,8 @@ class AttributeServiceProvider extends ServiceProvider
|
|||
public function boot(Router $router)
|
||||
{
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||
|
||||
$this->app->register(ModuleServiceProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Providers;
|
||||
|
||||
use Konekt\Concord\BaseModuleServiceProvider;
|
||||
|
||||
class ModuleServiceProvider extends BaseModuleServiceProvider
|
||||
{
|
||||
protected $models = [
|
||||
\Webkul\Attribute\Models\Attribute::class,
|
||||
\Webkul\Attribute\Models\AttributeFamily::class,
|
||||
\Webkul\Attribute\Models\AttributeGroup::class,
|
||||
\Webkul\Attribute\Models\AttributeOption::class,
|
||||
\Webkul\Attribute\Models\AttributeOptionTranslation::class,
|
||||
\Webkul\Attribute\Models\AttributeTranslation::class,
|
||||
];
|
||||
}
|
||||
|
|
@ -53,7 +53,7 @@ class AttributeFamilyRepository extends Repository
|
|||
*/
|
||||
function model()
|
||||
{
|
||||
return 'Webkul\Attribute\Models\AttributeFamily';
|
||||
return 'Webkul\Attribute\Contracts\AttributeFamily';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -79,7 +79,7 @@ class AttributeFamilyRepository extends Repository
|
|||
} else {
|
||||
$attributeModel = $this->attribute->findOneByField('code', $attribute['code']);
|
||||
}
|
||||
|
||||
|
||||
$attributeGroup->custom_attributes()->save($attributeModel, ['position' => $key + 1]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Repositories;
|
||||
|
||||
|
||||
use Webkul\Core\Eloquent\Repository;
|
||||
|
||||
/**
|
||||
|
|
@ -12,7 +12,7 @@ use Webkul\Core\Eloquent\Repository;
|
|||
*/
|
||||
class AttributeGroupRepository extends Repository
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
|
|
@ -20,6 +20,6 @@ class AttributeGroupRepository extends Repository
|
|||
*/
|
||||
function model()
|
||||
{
|
||||
return 'Webkul\Attribute\Models\AttributeGroup';
|
||||
return 'Webkul\Attribute\Contracts\AttributeGroup';
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Repositories;
|
||||
|
||||
|
||||
use Webkul\Core\Eloquent\Repository;
|
||||
|
||||
/**
|
||||
|
|
@ -12,7 +12,7 @@ use Webkul\Core\Eloquent\Repository;
|
|||
*/
|
||||
class AttributeOptionRepository extends Repository
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
|
|
@ -20,6 +20,6 @@ class AttributeOptionRepository extends Repository
|
|||
*/
|
||||
function model()
|
||||
{
|
||||
return 'Webkul\Attribute\Models\AttributeOption';
|
||||
return 'Webkul\Attribute\Contracts\AttributeOption';
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
<?php
|
||||
|
||||
namespace Webkul\Attribute\Repositories;
|
||||
|
||||
|
||||
use Webkul\Core\Eloquent\Repository;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Webkul\Attribute\Repositories\AttributeOptionRepository;
|
||||
|
|
@ -42,7 +42,7 @@ class AttributeRepository extends Repository
|
|||
*/
|
||||
function model()
|
||||
{
|
||||
return 'Webkul\Attribute\Models\Attribute';
|
||||
return 'Webkul\Attribute\Contracts\Attribute';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -170,7 +170,7 @@ class AttributeRepository extends Repository
|
|||
'special_price_to',
|
||||
'status'
|
||||
], $attributeColumns);
|
||||
|
||||
|
||||
if (in_array('*', $codes))
|
||||
return $this->all($attributeColumns);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Category\Contracts;
|
||||
|
||||
interface Category
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Category\Contracts;
|
||||
|
||||
interface CategoryTranslation
|
||||
{
|
||||
}
|
||||
|
|
@ -5,8 +5,9 @@ namespace Webkul\Category\Models;
|
|||
use Webkul\Core\Eloquent\TranslatableModel;
|
||||
use Kalnoy\Nestedset\NodeTrait;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Webkul\Category\Contracts\Category as CategoryContract;
|
||||
|
||||
class Category extends TranslatableModel
|
||||
class Category extends TranslatableModel implements CategoryContract
|
||||
{
|
||||
use NodeTrait;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Category\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class CategoryProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,10 +3,11 @@
|
|||
namespace Webkul\Category\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Category\Contracts\CategoryTranslation as CategoryTranslationContract;
|
||||
|
||||
class CategoryTranslation extends Model
|
||||
class CategoryTranslation extends Model implements CategoryTranslationContract
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
|
||||
protected $fillable = ['name', 'description', 'slug', 'meta_title', 'meta_description', 'meta_keywords'];
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Category\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class CategoryTranslationProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -16,6 +16,8 @@ class CategoryServiceProvider extends ServiceProvider
|
|||
public function boot(Router $router)
|
||||
{
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||
|
||||
$this->app->register(ModuleServiceProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Category\Providers;
|
||||
|
||||
use Konekt\Concord\BaseModuleServiceProvider;
|
||||
|
||||
class ModuleServiceProvider extends BaseModuleServiceProvider
|
||||
{
|
||||
protected $models = [
|
||||
\Webkul\Category\Models\Category::class,
|
||||
\Webkul\Category\Models\CategoryTranslation::class,
|
||||
];
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ class CategoryRepository extends Repository
|
|||
*/
|
||||
public function model()
|
||||
{
|
||||
return 'Webkul\Category\Models\Category';
|
||||
return 'Webkul\Category\Contracts\Category';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Checkout\Contracts;
|
||||
|
||||
interface Cart
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Checkout\Contracts;
|
||||
|
||||
interface CartAddress
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Checkout\Contracts;
|
||||
|
||||
interface CartItem
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Checkout\Contracts;
|
||||
|
||||
interface CartPayment
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Checkout\Contracts;
|
||||
|
||||
interface CartShippingRate
|
||||
{
|
||||
}
|
||||
|
|
@ -3,13 +3,10 @@
|
|||
namespace Webkul\Checkout\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Product\Models\Product;
|
||||
use Webkul\Checkout\Models\CartItem;
|
||||
use Webkul\Checkout\Models\CartAddress;
|
||||
use Webkul\Checkout\Models\CartPayment;
|
||||
use Webkul\Checkout\Models\CartShippingRate;
|
||||
use Webkul\Product\Models\ProductProxy;
|
||||
use Webkul\Checkout\Contracts\Cart as CartContract;
|
||||
|
||||
class Cart extends Model
|
||||
class Cart extends Model implements CartContract
|
||||
{
|
||||
protected $table = 'cart';
|
||||
|
||||
|
|
@ -23,14 +20,14 @@ class Cart extends Model
|
|||
* To get relevant associated items with the cart instance
|
||||
*/
|
||||
public function items() {
|
||||
return $this->hasMany(CartItem::class)->whereNull('parent_id');
|
||||
return $this->hasMany(CartItemProxy::modelClass())->whereNull('parent_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* To get all the associated items with the cart instance even the parent and child items of configurable products
|
||||
*/
|
||||
public function all_items() {
|
||||
return $this->hasMany(CartItem::class);
|
||||
return $this->hasMany(CartItemProxy::modelClass());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -38,7 +35,7 @@ class Cart extends Model
|
|||
*/
|
||||
public function addresses()
|
||||
{
|
||||
return $this->hasMany(CartAddress::class);
|
||||
return $this->hasMany(CartAddressProxy::modelClass());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -78,7 +75,7 @@ class Cart extends Model
|
|||
*/
|
||||
public function shipping_rates()
|
||||
{
|
||||
return $this->hasManyThrough(CartShippingRate::class, CartAddress::class, 'cart_id', 'cart_address_id');
|
||||
return $this->hasManyThrough(CartShippingRateProxy::modelClass(), CartAddressProxy::modelClass(), 'cart_id', 'cart_address_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -102,6 +99,6 @@ class Cart extends Model
|
|||
*/
|
||||
public function payment()
|
||||
{
|
||||
return $this->hasOne(CartPayment::class);
|
||||
return $this->hasOne(CartPaymentProxy::modelClass());
|
||||
}
|
||||
}
|
||||
|
|
@ -3,9 +3,9 @@
|
|||
namespace Webkul\Checkout\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Checkout\Models\CartShippingRate;
|
||||
use Webkul\Checkout\Contracts\CartAddress as CartAddressContract;
|
||||
|
||||
class CartAddress extends Model
|
||||
class CartAddress extends Model implements CartAddressContract
|
||||
{
|
||||
protected $table = 'cart_address';
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ class CartAddress extends Model
|
|||
*/
|
||||
public function shipping_rates()
|
||||
{
|
||||
return $this->hasMany(CartShippingRate::class);
|
||||
return $this->hasMany(CartShippingRateProxy::modelClass());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Checkout\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class CartAddressProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,10 +3,11 @@
|
|||
namespace Webkul\Checkout\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Product\Models\Product;
|
||||
use Webkul\Product\Models\ProductProxy;
|
||||
use Webkul\Checkout\Contracts\CartItem as CartItemContract;
|
||||
|
||||
|
||||
class CartItem extends Model
|
||||
class CartItem extends Model implements CartItemContract
|
||||
{
|
||||
protected $table = 'cart_items';
|
||||
|
||||
|
|
@ -18,12 +19,12 @@ class CartItem extends Model
|
|||
|
||||
public function product()
|
||||
{
|
||||
return $this->hasOne(Product::class, 'id', 'product_id');
|
||||
return $this->hasOne(ProductProxy::modelClass(), 'id', 'product_id');
|
||||
}
|
||||
|
||||
public function cart()
|
||||
{
|
||||
return $this->hasOne(Cart::class, 'id', 'cart_id');
|
||||
return $this->hasOne(CartProxy::modelClass(), 'id', 'cart_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Checkout\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class CartItemProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,9 @@
|
|||
namespace Webkul\Checkout\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Checkout\Contracts\CartPayment as CartPaymentContract;
|
||||
|
||||
class CartPayment extends Model
|
||||
class CartPayment extends Model implements CartPaymentContract
|
||||
{
|
||||
protected $table = 'cart_payment';
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Checkout\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class CartPaymentProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Checkout\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class CartProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,15 +3,15 @@
|
|||
namespace Webkul\Checkout\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Checkout\Models\CartAddress;
|
||||
use Webkul\Checkout\Contracts\CartShippingRate as CartShippingRateContract;
|
||||
|
||||
class CartShippingRate extends Model
|
||||
class CartShippingRate extends Model implements CartShippingRateContract
|
||||
{
|
||||
/**
|
||||
* Get the post that owns the comment.
|
||||
*/
|
||||
public function shipping_address()
|
||||
{
|
||||
return $this->belongsTo(CartAddress::class);
|
||||
return $this->belongsTo(CartAddressProxy::modelClass());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Checkout\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class CartShippingRateProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -18,6 +18,8 @@ class CheckoutServiceProvider extends ServiceProvider
|
|||
include __DIR__ . '/../Http/helpers.php';
|
||||
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||
|
||||
$this->app->register(ModuleServiceProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Checkout\Providers;
|
||||
|
||||
use Konekt\Concord\BaseModuleServiceProvider;
|
||||
|
||||
class ModuleServiceProvider extends BaseModuleServiceProvider
|
||||
{
|
||||
protected $models = [
|
||||
\Webkul\Checkout\Models\Cart::class,
|
||||
\Webkul\Checkout\Models\CartAddress::class,
|
||||
\Webkul\Checkout\Models\CartItem::class,
|
||||
\Webkul\Checkout\Models\CartPayment::class,
|
||||
\Webkul\Checkout\Models\CartShippingRate::class,
|
||||
];
|
||||
}
|
||||
|
|
@ -20,6 +20,6 @@ class CartAddressRepository extends Repository
|
|||
*/
|
||||
function model()
|
||||
{
|
||||
return 'Webkul\Checkout\Models\CartAddress';
|
||||
return 'Webkul\Checkout\Contracts\CartAddress';
|
||||
}
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@ class CartItemRepository extends Repository
|
|||
|
||||
function model()
|
||||
{
|
||||
return 'Webkul\Checkout\Models\CartItem';
|
||||
return 'Webkul\Checkout\Contracts\CartItem';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class CartRepository extends Repository
|
|||
|
||||
function model()
|
||||
{
|
||||
return 'Webkul\Checkout\Models\Cart';
|
||||
return 'Webkul\Checkout\Contracts\Cart';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Contracts;
|
||||
|
||||
interface Channel
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Contracts;
|
||||
|
||||
interface CoreConfig
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Contracts;
|
||||
|
||||
interface Country
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Contracts;
|
||||
|
||||
interface CountryState
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Contracts;
|
||||
|
||||
interface Currency
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Contracts;
|
||||
|
||||
interface CurrencyExchangeRate
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Contracts;
|
||||
|
||||
interface Locale
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Contracts;
|
||||
|
||||
interface Slider
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Contracts;
|
||||
|
||||
interface SubscribersList
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Contracts;
|
||||
|
||||
interface TaxCategory
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Contracts;
|
||||
|
||||
interface TaxMap
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Contracts;
|
||||
|
||||
interface TaxRate
|
||||
{
|
||||
}
|
||||
|
|
@ -4,12 +4,11 @@ namespace Webkul\Core\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Webkul\Core\Models\Locale;
|
||||
use Webkul\Core\Models\Currency;
|
||||
use Webkul\Category\Models\Category;
|
||||
use Webkul\Inventory\Models\InventorySource;
|
||||
use Webkul\Category\Models\CategoryProxy;
|
||||
use Webkul\Inventory\Models\InventorySourceProxy;
|
||||
use Webkul\Core\Contracts\Channel as ChannelContract;
|
||||
|
||||
class Channel extends Model
|
||||
class Channel extends Model implements ChannelContract
|
||||
{
|
||||
protected $fillable = ['code', 'name', 'description', 'theme', 'home_page_content', 'footer_content', 'hostname', 'default_locale_id', 'base_currency_id', 'root_category_id'];
|
||||
|
||||
|
|
@ -18,7 +17,7 @@ class Channel extends Model
|
|||
*/
|
||||
public function locales()
|
||||
{
|
||||
return $this->belongsToMany(Locale::class, 'channel_locales');
|
||||
return $this->belongsToMany(LocaleProxy::modelClass(), 'channel_locales');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -26,7 +25,7 @@ class Channel extends Model
|
|||
*/
|
||||
public function default_locale()
|
||||
{
|
||||
return $this->belongsTo(Locale::class);
|
||||
return $this->belongsTo(LocaleProxy::modelClass());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -34,7 +33,7 @@ class Channel extends Model
|
|||
*/
|
||||
public function currencies()
|
||||
{
|
||||
return $this->belongsToMany(Currency::class, 'channel_currencies');
|
||||
return $this->belongsToMany(CurrencyProxy::modelClass(), 'channel_currencies');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -42,7 +41,7 @@ class Channel extends Model
|
|||
*/
|
||||
public function inventory_sources()
|
||||
{
|
||||
return $this->belongsToMany(InventorySource::class, 'channel_inventory_sources');
|
||||
return $this->belongsToMany(InventorySourceProxy::modelClass(), 'channel_inventory_sources');
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -53,7 +52,7 @@ class Channel extends Model
|
|||
*/
|
||||
public function base_currency()
|
||||
{
|
||||
return $this->belongsTo(Currency::class);
|
||||
return $this->belongsTo(CurrencyProxy::modelClass());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -61,7 +60,7 @@ class Channel extends Model
|
|||
*/
|
||||
public function root_category()
|
||||
{
|
||||
return $this->belongsTo(Category::class, 'root_category_id');
|
||||
return $this->belongsTo(CategoryProxy::modelClass(), 'root_category_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class ChannelProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,9 @@
|
|||
namespace Webkul\Core\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Core\Contracts\CoreConfig as CoreConfigContract;
|
||||
|
||||
class CoreConfig extends Model
|
||||
class CoreConfig extends Model implements CoreConfigContract
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class CoreConfigProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,9 @@
|
|||
namespace Webkul\Core\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Core\Contracts\Country as CountryContract;
|
||||
|
||||
class Country extends Model
|
||||
class Country extends Model implements CountryContract
|
||||
{
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class CountryProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,10 @@
|
|||
namespace Webkul\Core\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Core\Contracts\CountryState as CountryStateContract;
|
||||
|
||||
class CountryState extends Model
|
||||
|
||||
class CountryState extends Model implements CountryStateContract
|
||||
{
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class CountryStateProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,9 +3,9 @@
|
|||
namespace Webkul\Core\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Core\Models\CurrencyExchangeRate;
|
||||
use Webkul\Core\Contracts\Currency as CurrencyContract;
|
||||
|
||||
class Currency extends Model
|
||||
class Currency extends Model implements CurrencyContract
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
|
@ -21,6 +21,6 @@ class Currency extends Model
|
|||
*/
|
||||
public function CurrencyExchangeRate()
|
||||
{
|
||||
return $this->hasOne(CurrencyExchangeRate::class, 'target_currency');
|
||||
return $this->hasOne(CurrencyExchangeRateProxy::modelClass(), 'target_currency');
|
||||
}
|
||||
}
|
||||
|
|
@ -3,8 +3,9 @@
|
|||
namespace Webkul\Core\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Core\Contracts\CurrencyExchangeRate as CurrencyExchangeRateContract;
|
||||
|
||||
class CurrencyExchangeRate extends Model
|
||||
class CurrencyExchangeRate extends Model implements CurrencyExchangeRateContract
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class CurrencyExchangeRateProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class CurrencyProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,9 @@
|
|||
namespace Webkul\Core\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Core\Contracts\Locale as LocaleContract;
|
||||
|
||||
class Locale extends Model
|
||||
class Locale extends Model implements LocaleContract
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class LocaleProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,9 @@
|
|||
namespace Webkul\Core\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Core\Contracts\Slider as SliderContract;
|
||||
|
||||
class Slider extends Model
|
||||
class Slider extends Model implements SliderContract
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class SliderProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,9 @@
|
|||
namespace Webkul\Core\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Core\Contracts\SubscribersList as SubscribersListContract;
|
||||
|
||||
class SubscribersList extends Model
|
||||
class SubscribersList extends Model implements SubscribersListContract
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class SubscribersListProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -5,8 +5,9 @@ namespace Webkul\Core\Models;
|
|||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Core\Models\TaxRate;
|
||||
use Webkul\Core\Models\TaxMap;
|
||||
use Webkul\Core\Contracts\TaxCategory as TaxCategoryContract;
|
||||
|
||||
class TaxCategory extends Model
|
||||
class TaxCategory extends Model implements TaxCategoryContract
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
|
@ -22,6 +23,6 @@ class TaxCategory extends Model
|
|||
|
||||
//for joining the two way pivot table
|
||||
public function tax_rates() {
|
||||
return $this->belongsToMany(TaxRate::class, 'tax_categories_tax_rates', 'tax_category_id')->withPivot('id');
|
||||
return $this->belongsToMany(TaxRateProxy::modelClass(), 'tax_categories_tax_rates', 'tax_category_id')->withPivot('id');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class TaxCategoryProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -5,8 +5,9 @@ namespace Webkul\Core\Models;
|
|||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Core\Models\TaxCategory;
|
||||
use Webkul\Core\Models\TaxRate;
|
||||
use Webkul\Core\Contracts\TaxMap as TaxMapContract;
|
||||
|
||||
class TaxMap extends Model
|
||||
class TaxMap extends Model implements TaxMapContract
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class TaxMapProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -4,8 +4,9 @@ namespace Webkul\Core\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Core\Models\TaxCategory;
|
||||
use Webkul\Core\Contracts\TaxRate as TaxRateContract;
|
||||
|
||||
class TaxRate extends Model
|
||||
class TaxRate extends Model implements TaxRateContract
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
|
@ -20,6 +21,6 @@ class TaxRate extends Model
|
|||
];
|
||||
|
||||
public function tax_categories() {
|
||||
return $this->belongsToMany(TaxCategory::class, 'tax_categories_tax_rates', 'tax_rate_id', 'id');
|
||||
return $this->belongsToMany(TaxCategoryProxy::modelClass(), 'tax_categories_tax_rates', 'tax_rate_id', 'id');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class TaxRateProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -25,12 +25,14 @@ class CoreServiceProvider extends ServiceProvider
|
|||
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'core');
|
||||
|
||||
Validator::extend('slug', 'Webkul\Core\Contracts\Validations\Slug@passes');
|
||||
|
||||
|
||||
Validator::extend('code', 'Webkul\Core\Contracts\Validations\Code@passes');
|
||||
|
||||
Validator::extend('decimal', 'Webkul\Core\Contracts\Validations\Decimal@passes');
|
||||
|
||||
$this->app->register(ModuleServiceProvider::class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register services.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Core\Providers;
|
||||
|
||||
use Konekt\Concord\BaseModuleServiceProvider;
|
||||
|
||||
class ModuleServiceProvider extends BaseModuleServiceProvider
|
||||
{
|
||||
protected $models = [
|
||||
\Webkul\Core\Models\Channel::class,
|
||||
\Webkul\Core\Models\CoreConfig::class,
|
||||
\Webkul\Core\Models\Country::class,
|
||||
\Webkul\Core\Models\CountryState::class,
|
||||
\Webkul\Core\Models\Currency::class,
|
||||
\Webkul\Core\Models\CurrencyExchangeRate::class,
|
||||
\Webkul\Core\Models\Locale::class,
|
||||
\Webkul\Core\Models\Slider::class,
|
||||
\Webkul\Core\Models\SubscribersList::class,
|
||||
\Webkul\Core\Models\TaxCategory::class,
|
||||
\Webkul\Core\Models\TaxMap::class,
|
||||
\Webkul\Core\Models\TaxRate::class,
|
||||
];
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ class ChannelRepository extends Repository
|
|||
*/
|
||||
function model()
|
||||
{
|
||||
return 'Webkul\Core\Models\Channel';
|
||||
return 'Webkul\Core\Contracts\Channel';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class CoreConfigRepository extends Repository
|
|||
*/
|
||||
function model()
|
||||
{
|
||||
return 'Webkul\Core\Models\CoreConfig';
|
||||
return 'Webkul\Core\Contracts\CoreConfig';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,6 +19,6 @@ class CountryRepository extends Repository
|
|||
*/
|
||||
function model()
|
||||
{
|
||||
return 'Webkul\Core\Models\Country';
|
||||
return 'Webkul\Core\Contracts\Country';
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue