interfaces & proxy class implemented
This commit is contained in:
parent
6172692954
commit
b019a248cf
|
|
@ -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\Core\Eloquent\TranslatableModel;
|
||||||
use Webkul\Attribute\Models\AttributeOption;
|
use Webkul\Attribute\Models\AttributeOption;
|
||||||
use Webkul\Attribute\Models\AttributeGroup;
|
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'];
|
public $translatedAttributes = ['name'];
|
||||||
|
|
||||||
|
|
@ -19,7 +20,7 @@ class Attribute extends TranslatableModel
|
||||||
*/
|
*/
|
||||||
public function options()
|
public function options()
|
||||||
{
|
{
|
||||||
return $this->hasMany(AttributeOption::class);
|
return $this->hasMany(AttributeOptionProxy::modelClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@
|
||||||
namespace Webkul\Attribute\Models;
|
namespace Webkul\Attribute\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Webkul\Attribute\Models\AttributeGroup;
|
use Webkul\Product\Models\ProductProxy;
|
||||||
use Webkul\Product\Models\Product;
|
use Webkul\Attribute\Contracts\AttributeFamily as AttributeFamilyContract;
|
||||||
|
|
||||||
class AttributeFamily extends Model
|
class AttributeFamily extends Model implements AttributeFamilyContract
|
||||||
{
|
{
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@ class AttributeFamily extends Model
|
||||||
*/
|
*/
|
||||||
public function custom_attributes()
|
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_groups', 'attribute_group_mappings.attribute_group_id', '=', 'attribute_groups.id')
|
||||||
->join('attribute_families', 'attribute_groups.attribute_family_id', '=', 'attribute_families.id')
|
->join('attribute_families', 'attribute_groups.attribute_family_id', '=', 'attribute_families.id')
|
||||||
->where('attribute_families.id', $this->id)
|
->where('attribute_families.id', $this->id)
|
||||||
|
|
@ -37,7 +37,7 @@ class AttributeFamily extends Model
|
||||||
*/
|
*/
|
||||||
public function attribute_groups()
|
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()
|
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,8 +4,9 @@ namespace Webkul\Attribute\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Webkul\Attribute\Models\Attribute;
|
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;
|
public $timestamps = false;
|
||||||
|
|
||||||
|
|
@ -16,7 +17,7 @@ class AttributeGroup extends Model
|
||||||
*/
|
*/
|
||||||
public function custom_attributes()
|
public function custom_attributes()
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(Attribute::class, 'attribute_group_mappings')
|
return $this->belongsToMany(AttributeProxy::modelClass(), 'attribute_group_mappings')
|
||||||
->withPivot('position')
|
->withPivot('position')
|
||||||
->orderBy('pivot_position', 'asc');
|
->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 Webkul\Core\Eloquent\TranslatableModel;
|
||||||
use Dimsav\Translatable\Translatable;
|
use Dimsav\Translatable\Translatable;
|
||||||
use Webkul\Attribute\Models\Attribute;
|
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;
|
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;
|
namespace Webkul\Attribute\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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;
|
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,8 +3,9 @@
|
||||||
namespace Webkul\Attribute\Models;
|
namespace Webkul\Attribute\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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;
|
public $timestamps = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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)
|
public function boot(Router $router)
|
||||||
{
|
{
|
||||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
$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()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Attribute\Models\AttributeFamily';
|
return 'Webkul\Attribute\Contracts\AttributeFamily';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,6 @@ class AttributeGroupRepository extends Repository
|
||||||
*/
|
*/
|
||||||
function model()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Attribute\Models\AttributeGroup';
|
return 'Webkul\Attribute\Contracts\AttributeGroup';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -20,6 +20,6 @@ class AttributeOptionRepository extends Repository
|
||||||
*/
|
*/
|
||||||
function model()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Attribute\Models\AttributeOption';
|
return 'Webkul\Attribute\Contracts\AttributeOption';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -42,7 +42,7 @@ class AttributeRepository extends Repository
|
||||||
*/
|
*/
|
||||||
function model()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Attribute\Models\Attribute';
|
return 'Webkul\Attribute\Contracts\Attribute';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -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 Webkul\Core\Eloquent\TranslatableModel;
|
||||||
use Kalnoy\Nestedset\NodeTrait;
|
use Kalnoy\Nestedset\NodeTrait;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Webkul\Category\Contracts\Category as CategoryContract;
|
||||||
|
|
||||||
class Category extends TranslatableModel
|
class Category extends TranslatableModel implements CategoryContract
|
||||||
{
|
{
|
||||||
use NodeTrait;
|
use NodeTrait;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Category\Models;
|
||||||
|
|
||||||
|
use Konekt\Concord\Proxies\ModelProxy;
|
||||||
|
|
||||||
|
class CategoryProxy extends ModelProxy
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -3,8 +3,9 @@
|
||||||
namespace Webkul\Category\Models;
|
namespace Webkul\Category\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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;
|
public $timestamps = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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)
|
public function boot(Router $router)
|
||||||
{
|
{
|
||||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
$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()
|
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;
|
namespace Webkul\Checkout\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Webkul\Product\Models\Product;
|
use Webkul\Product\Models\ProductProxy;
|
||||||
use Webkul\Checkout\Models\CartItem;
|
use Webkul\Checkout\Contracts\Cart as CartContract;
|
||||||
use Webkul\Checkout\Models\CartAddress;
|
|
||||||
use Webkul\Checkout\Models\CartPayment;
|
|
||||||
use Webkul\Checkout\Models\CartShippingRate;
|
|
||||||
|
|
||||||
class Cart extends Model
|
class Cart extends Model implements CartContract
|
||||||
{
|
{
|
||||||
protected $table = 'cart';
|
protected $table = 'cart';
|
||||||
|
|
||||||
|
|
@ -23,14 +20,14 @@ class Cart extends Model
|
||||||
* To get relevant associated items with the cart instance
|
* To get relevant associated items with the cart instance
|
||||||
*/
|
*/
|
||||||
public function items() {
|
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
|
* To get all the associated items with the cart instance even the parent and child items of configurable products
|
||||||
*/
|
*/
|
||||||
public function all_items() {
|
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()
|
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()
|
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()
|
public function payment()
|
||||||
{
|
{
|
||||||
return $this->hasOne(CartPayment::class);
|
return $this->hasOne(CartPaymentProxy::modelClass());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
namespace Webkul\Checkout\Models;
|
namespace Webkul\Checkout\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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';
|
protected $table = 'cart_address';
|
||||||
|
|
||||||
|
|
@ -16,7 +16,7 @@ class CartAddress extends Model
|
||||||
*/
|
*/
|
||||||
public function shipping_rates()
|
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;
|
namespace Webkul\Checkout\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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';
|
protected $table = 'cart_items';
|
||||||
|
|
||||||
|
|
@ -18,12 +19,12 @@ class CartItem extends Model
|
||||||
|
|
||||||
public function product()
|
public function product()
|
||||||
{
|
{
|
||||||
return $this->hasOne(Product::class, 'id', 'product_id');
|
return $this->hasOne(ProductProxy::modelClass(), 'id', 'product_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cart()
|
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;
|
namespace Webkul\Checkout\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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';
|
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;
|
namespace Webkul\Checkout\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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.
|
* Get the post that owns the comment.
|
||||||
*/
|
*/
|
||||||
public function shipping_address()
|
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';
|
include __DIR__ . '/../Http/helpers.php';
|
||||||
|
|
||||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
$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()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Checkout\Models\CartAddress';
|
return 'Webkul\Checkout\Contracts\CartAddress';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -21,7 +21,7 @@ class CartItemRepository extends Repository
|
||||||
|
|
||||||
function model()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Checkout\Models\CartItem';
|
return 'Webkul\Checkout\Contracts\CartItem';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class CartRepository extends Repository
|
||||||
|
|
||||||
function model()
|
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\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Webkul\Core\Models\Locale;
|
use Webkul\Category\Models\CategoryProxy;
|
||||||
use Webkul\Core\Models\Currency;
|
use Webkul\Inventory\Models\InventorySourceProxy;
|
||||||
use Webkul\Category\Models\Category;
|
use Webkul\Core\Contracts\Channel as ChannelContract;
|
||||||
use Webkul\Inventory\Models\InventorySource;
|
|
||||||
|
|
||||||
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'];
|
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()
|
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()
|
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()
|
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()
|
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()
|
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()
|
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;
|
namespace Webkul\Core\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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.
|
* 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;
|
namespace Webkul\Core\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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;
|
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;
|
namespace Webkul\Core\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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;
|
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;
|
namespace Webkul\Core\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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.
|
* The attributes that are mass assignable.
|
||||||
|
|
@ -21,6 +21,6 @@ class Currency extends Model
|
||||||
*/
|
*/
|
||||||
public function CurrencyExchangeRate()
|
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;
|
namespace Webkul\Core\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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.
|
* 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;
|
namespace Webkul\Core\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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.
|
* 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;
|
namespace Webkul\Core\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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.
|
* 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;
|
namespace Webkul\Core\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
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.
|
* 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 Illuminate\Database\Eloquent\Model;
|
||||||
use Webkul\Core\Models\TaxRate;
|
use Webkul\Core\Models\TaxRate;
|
||||||
use Webkul\Core\Models\TaxMap;
|
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.
|
* The attributes that are mass assignable.
|
||||||
|
|
@ -22,6 +23,6 @@ class TaxCategory extends Model
|
||||||
|
|
||||||
//for joining the two way pivot table
|
//for joining the two way pivot table
|
||||||
public function tax_rates() {
|
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 Illuminate\Database\Eloquent\Model;
|
||||||
use Webkul\Core\Models\TaxCategory;
|
use Webkul\Core\Models\TaxCategory;
|
||||||
use Webkul\Core\Models\TaxRate;
|
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.
|
* 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 Illuminate\Database\Eloquent\Model;
|
||||||
use Webkul\Core\Models\TaxCategory;
|
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.
|
* The attributes that are mass assignable.
|
||||||
|
|
@ -20,6 +21,6 @@ class TaxRate extends Model
|
||||||
];
|
];
|
||||||
|
|
||||||
public function tax_categories() {
|
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
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -29,6 +29,8 @@ class CoreServiceProvider extends ServiceProvider
|
||||||
Validator::extend('code', 'Webkul\Core\Contracts\Validations\Code@passes');
|
Validator::extend('code', 'Webkul\Core\Contracts\Validations\Code@passes');
|
||||||
|
|
||||||
Validator::extend('decimal', 'Webkul\Core\Contracts\Validations\Decimal@passes');
|
Validator::extend('decimal', 'Webkul\Core\Contracts\Validations\Decimal@passes');
|
||||||
|
|
||||||
|
$this->app->register(ModuleServiceProvider::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -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()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Core\Models\Channel';
|
return 'Webkul\Core\Contracts\Channel';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ class CoreConfigRepository extends Repository
|
||||||
*/
|
*/
|
||||||
function model()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Core\Models\CoreConfig';
|
return 'Webkul\Core\Contracts\CoreConfig';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,6 @@ class CountryRepository extends Repository
|
||||||
*/
|
*/
|
||||||
function model()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Core\Models\Country';
|
return 'Webkul\Core\Contracts\Country';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -19,6 +19,6 @@ class CountryStateRepository extends Repository
|
||||||
*/
|
*/
|
||||||
function model()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Core\Models\CountryState';
|
return 'Webkul\Core\Contracts\CountryState';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -19,7 +19,7 @@ class CurrencyRepository extends Repository
|
||||||
*/
|
*/
|
||||||
function model()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Core\Models\Currency';
|
return 'Webkul\Core\Contracts\Currency';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete($id) {
|
public function delete($id) {
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,6 @@ class ExchangeRateRepository extends Repository
|
||||||
*/
|
*/
|
||||||
function model()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Core\Models\CurrencyExchangeRate';
|
return 'Webkul\Core\Contracts\CurrencyExchangeRate';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -19,6 +19,6 @@ class LocaleRepository extends Repository
|
||||||
*/
|
*/
|
||||||
function model()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Core\Models\Locale';
|
return 'Webkul\Core\Contracts\Locale';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -34,7 +34,7 @@ class SliderRepository extends Repository
|
||||||
*/
|
*/
|
||||||
function model()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Core\Models\Slider';
|
return 'Webkul\Core\Contracts\Slider';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ class SubscribersListRepository extends Repository
|
||||||
*/
|
*/
|
||||||
function model()
|
function model()
|
||||||
{
|
{
|
||||||
return 'Webkul\Core\Models\SubscribersList';
|
return 'Webkul\Core\Contracts\SubscribersList';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue