diff --git a/Laracel Command b/Laracel Command index 718158d3b..3abe99806 100644 --- a/Laracel Command +++ b/Laracel Command @@ -1,7 +1,7 @@ php artisan make:controller UserController && mv app/Http/Controllers/UserController.php packages/Webkul/User/src/Ht tp/Controllers -php artisan make:migration foo --path=packages/Webkul/User/src/Database/migrations +php artisan make:migration foo --path=packages/Webkul/User/src/Database/Migrations php artisan db:seed --class=Webkul\\User\\Database\\Seeders\\DatabaseSeeder diff --git a/composer.json b/composer.json index abf030b10..52f73a27b 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ "php": "^7.1.3", "dimsav/laravel-translatable": "^9.0", "fideloper/proxy": "^4.0", + "kalnoy/nestedset": "^4.3", "laravel/framework": "5.6.*", "laravel/tinker": "^1.0", "nwidart/laravel-modules": "^3.2", @@ -30,7 +31,10 @@ "webkul/laravel-ui": "self.version", "webkul/laravel-core": "self.version", "webkul/laravel-attribute": "self.version", - "webkul/laravel-customer": "self.version" + "webkul/laravel-customer": "self.version", + "webkul/laravel-category": "self.version", + "webkul/laravel-channel": "self.version", + "webkul/laravel-product": "self.version" }, "autoload": { "classmap": [ @@ -42,10 +46,14 @@ "Webkul\\User\\": "packages/Webkul/User/src", "Webkul\\Admin\\": "packages/Webkul/Admin/src", "Webkul\\Ui\\": "packages/Webkul/Ui/src", + "Webkul\\Category\\": "packages/Webkul/Category/src", "Webkul\\Attribute\\": "packages/Webkul/Attribute/src", "Webkul\\Shop\\": "packages/Webkul/Shop/src", "Webkul\\Core\\": "packages/Webkul/Core/src", - "Webkul\\Customer\\": "packages/Webkul/Customer/src" + "Webkul\\Customer\\": "packages/Webkul/Customer/src", + "Webkul\\Channel\\": "packages/Webkul/Channel/src", + "Webkul\\Inventory\\": "packages/Webkul/Inventory/src", + "Webkul\\Product\\": "packages/Webkul/Product/src" } }, "autoload-dev": { diff --git a/composer.lock b/composer.lock index 3185aedbb..9eed4b78b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e246cc7d779ef4098f86e289fe65a215", + "content-hash": "47eeeb44e8f067ec98ea469bd35acf54", "packages": [ { "name": "commerceguys/intl", @@ -617,6 +617,65 @@ ], "time": "2018-05-16T11:53:55+00:00" }, + { + "name": "kalnoy/nestedset", + "version": "v4.3.2", + "source": { + "type": "git", + "url": "https://github.com/lazychaser/laravel-nestedset.git", + "reference": "3265da51ef71238fc2d086b54eef7a75dd15c665" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lazychaser/laravel-nestedset/zipball/3265da51ef71238fc2d086b54eef7a75dd15c665", + "reference": "3265da51ef71238fc2d086b54eef7a75dd15c665", + "shasum": "" + }, + "require": { + "illuminate/database": "5.2 - 5.6", + "illuminate/events": "5.2 - 5.6", + "illuminate/support": "5.2 - 5.6", + "php": ">=5.5.9" + }, + "require-dev": { + "phpunit/phpunit": "4.8.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "v4.2.x-dev" + }, + "laravel": { + "providers": [ + "Kalnoy\\Nestedset\\NestedSetServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Kalnoy\\Nestedset\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alexander Kalnoy", + "email": "lazychaser@gmail.com" + } + ], + "description": "Nested Set Model for Laravel 4-5", + "keywords": [ + "database", + "hierarchy", + "laravel", + "nested sets", + "nsm" + ], + "time": "2018-02-04T08:47:55+00:00" + }, { "name": "laravel/framework", "version": "v5.6.27", diff --git a/config/app.php b/config/app.php index 1942b6c60..01dc1135c 100644 --- a/config/app.php +++ b/config/app.php @@ -174,10 +174,14 @@ return [ Webkul\User\Providers\UserServiceProvider::class, Webkul\Admin\Providers\AdminServiceProvider::class, Webkul\Ui\Providers\UiServiceProvider::class, + Webkul\Category\Providers\CategoryServiceProvider::class, Webkul\Attribute\Providers\AttributeServiceProvider::class, Webkul\Core\Providers\CoreServiceProvider::class, Webkul\Shop\Providers\ShopServiceProvider::class, Webkul\Customer\Providers\CustomerServiceProvider::class, + Webkul\Channel\Providers\ChannelServiceProvider::class, + Webkul\Inventory\Providers\InventoryServiceProvider::class, + Webkul\Product\Providers\ProductServiceProvider::class ], /* diff --git a/config/translatable.php b/config/translatable.php new file mode 100644 index 000000000..1ef910d3e --- /dev/null +++ b/config/translatable.php @@ -0,0 +1,116 @@ + [ + 'en', + 'fr', + 'es' => [ + 'MX', // mexican spanish + 'CO', // colombian spanish + ], + ], + + /* + |-------------------------------------------------------------------------- + | Locale separator + |-------------------------------------------------------------------------- + | + | This is a string used to glue the language and the country when defining + | the available locales. Example: if set to '-', then the locale for + | colombian spanish will be saved as 'es-CO' into the database. + | + */ + 'locale_separator' => '-', + + /* + |-------------------------------------------------------------------------- + | Default locale + |-------------------------------------------------------------------------- + | + | As a default locale, Translatable takes the locale of Laravel's + | translator. If for some reason you want to override this, + | you can specify what default should be used here. + | + */ + 'locale' => null, + + /* + |-------------------------------------------------------------------------- + | Use fallback + |-------------------------------------------------------------------------- + | + | Determine if fallback locales are returned by default or not. To add + | more flexibility and configure this option per "translatable" + | instance, this value will be overridden by the property + | $useTranslationFallback when defined + | + */ + 'use_fallback' => false, + + /* + |-------------------------------------------------------------------------- + | Use fallback per property + |-------------------------------------------------------------------------- + | + | The property fallback feature will return the translated value of + | the fallback locale if the property is empty for the selected + | locale. Note that 'use_fallback' must be enabled. + | + */ + 'use_property_fallback' => true, + + /* + |-------------------------------------------------------------------------- + | Fallback Locale + |-------------------------------------------------------------------------- + | + | A fallback locale is the locale being used to return a translation + | when the requested translation is not existing. To disable it + | set it to false. + | + */ + 'fallback_locale' => 'en', + + /* + |-------------------------------------------------------------------------- + | Translation Suffix + |-------------------------------------------------------------------------- + | + | Defines the default 'Translation' class suffix. For example, if + | you want to use CountryTrans instead of CountryTranslation + | application, set this to 'Trans'. + | + */ + 'translation_suffix' => 'Translation', + + /* + |-------------------------------------------------------------------------- + | Locale key + |-------------------------------------------------------------------------- + | + | Defines the 'locale' field name, which is used by the + | translation model. + | + */ + 'locale_key' => 'locale', + + /* + |-------------------------------------------------------------------------- + | Always load translations when converting to array + |-------------------------------------------------------------------------- + | Setting this to false will have a performance improvement but will + | not return the translations when using toArray(), unless the + | translations relationship is already loaded. + | + */ + 'to_array_always_loads_translations' => true, +]; diff --git a/packages/Webkul/Admin/src/Config/auth.php b/packages/Webkul/Admin/src/Config/auth.php index 89b6ecc26..21c43f718 100644 --- a/packages/Webkul/Admin/src/Config/auth.php +++ b/packages/Webkul/Admin/src/Config/auth.php @@ -1,6 +1,7 @@ [ 'web' => [ 'driver' => 'session', diff --git a/packages/Webkul/Admin/src/Http/routes.php b/packages/Webkul/Admin/src/Http/routes.php index ad6364f4c..663d24dcb 100644 --- a/packages/Webkul/Admin/src/Http/routes.php +++ b/packages/Webkul/Admin/src/Http/routes.php @@ -31,7 +31,7 @@ Route::group(['middleware' => ['web']], function () { // Admin Routes - Route::group(['middleware' => ['admin']], function () { + Route::group(['middleware' => ['admin', 'locale']], function () { Route::get('/logout', 'Webkul\User\Http\Controllers\SessionController@destroy')->defaults('_config', [ 'redirect' => 'admin.session.create' ])->name('admin.session.destroy'); @@ -43,6 +43,39 @@ Route::group(['middleware' => ['web']], function () { // Catalog Routes Route::prefix('catalog')->group(function () { + + // Catalog Product Routes + Route::get('/products', 'Webkul\Product\Http\Controllers\ProductController@index')->defaults('_config', [ + 'view' => 'admin::catalog.products.index' + ])->name('admin.catalog.products.index'); + + Route::get('/products/create', 'Webkul\Product\Http\Controllers\ProductController@create')->defaults('_config', [ + 'view' => 'admin::catalog.products.create' + ])->name('admin.catalog.products.create'); + + // Catalog Category Routes + Route::get('/categories', 'Webkul\Category\Http\Controllers\CategoryController@index')->defaults('_config', [ + 'view' => 'admin::catalog.categories.index' + ])->name('admin.catalog.categories.index'); + + Route::get('/categories/create', 'Webkul\Category\Http\Controllers\CategoryController@create')->defaults('_config', [ + 'view' => 'admin::catalog.categories.create' + ])->name('admin.catalog.categories.create'); + + Route::post('/categories/create', 'Webkul\Category\Http\Controllers\CategoryController@store')->defaults('_config', [ + 'redirect' => 'admin.catalog.categories.index' + ])->name('admin.catalog.categories.store'); + + Route::get('/categories/edit/{id}', 'Webkul\Category\Http\Controllers\CategoryController@edit')->defaults('_config', [ + 'view' => 'admin::catalog.categories.edit' + ])->name('admin.catalog.categories.edit'); + + Route::put('/categories/edit/{id}', 'Webkul\Category\Http\Controllers\CategoryController@update')->defaults('_config', [ + 'redirect' => 'admin.catalog.categories.index' + ])->name('admin.catalog.categories.update'); + + + // Catalog Attribute Routes Route::get('/attributes', 'Webkul\Attribute\Http\Controllers\AttributeController@index')->defaults('_config', [ 'view' => 'admin::catalog.attributes.index' ])->name('admin.catalog.attributes.index'); @@ -54,8 +87,39 @@ Route::group(['middleware' => ['web']], function () { Route::post('/attributes/create', 'Webkul\Attribute\Http\Controllers\AttributeController@store')->defaults('_config', [ 'redirect' => 'admin.catalog.attributes.index' ])->name('admin.catalog.attributes.store'); + + Route::get('/attributes/edit/{id}', 'Webkul\Attribute\Http\Controllers\AttributeController@edit')->defaults('_config', [ + 'view' => 'admin::catalog.attributes.edit' + ])->name('admin.catalog.attributes.edit'); + + Route::put('/attributes/edit/{id}', 'Webkul\Attribute\Http\Controllers\AttributeController@update')->defaults('_config', [ + 'redirect' => 'admin.catalog.attributes.index' + ])->name('admin.catalog.attributes.update'); + + + // Catalog Family Routes + Route::get('/families', 'Webkul\Attribute\Http\Controllers\AttributeFamilyController@index')->defaults('_config', [ + 'view' => 'admin::catalog.families.index' + ])->name('admin.catalog.families.index'); + + Route::get('/families/create', 'Webkul\Attribute\Http\Controllers\AttributeFamilyController@create')->defaults('_config', [ + 'view' => 'admin::catalog.families.create' + ])->name('admin.catalog.families.create'); + + Route::post('/families/create', 'Webkul\Attribute\Http\Controllers\AttributeFamilyController@store')->defaults('_config', [ + 'redirect' => 'admin.catalog.families.index' + ])->name('admin.catalog.families.store'); + + Route::get('/families/edit/{id}', 'Webkul\Attribute\Http\Controllers\AttributeFamilyController@edit')->defaults('_config', [ + 'view' => 'admin::catalog.families.edit' + ])->name('admin.catalog.families.edit'); + + Route::put('/families/edit/{id}', 'Webkul\Attribute\Http\Controllers\AttributeFamilyController@update')->defaults('_config', [ + 'redirect' => 'admin.catalog.families.index' + ])->name('admin.catalog.families.update'); }); + // Datagrid Routes //for datagrid and its loading, filtering, sorting and queries Route::get('datagrid', 'Webkul\Admin\Http\Controllers\DataGridController@index')->name('admin.datagrid.index'); @@ -108,11 +172,11 @@ Route::group(['middleware' => ['web']], function () { // Locale Routes Route::get('/locales', 'Webkul\Core\Http\Controllers\LocaleController@index')->defaults('_config', [ - 'view' => 'admin::locales.index' + 'view' => 'admin::settings.locales.index' ])->name('admin.locales.index'); Route::get('/locales/create', 'Webkul\Core\Http\Controllers\LocaleController@create')->defaults('_config', [ - 'view' => 'admin::locales.create' + 'view' => 'admin::settings.locales.create' ])->name('admin.locales.create'); Route::post('/locales/create', 'Webkul\Core\Http\Controllers\LocaleController@store')->defaults('_config', [ @@ -120,6 +184,101 @@ Route::group(['middleware' => ['web']], function () { ])->name('admin.locales.store'); + // Country Routes + Route::get('/countries', 'Webkul\Core\Http\Controllers\CountryController@index')->defaults('_config', [ + 'view' => 'admin::settings.countries.index' + ])->name('admin.countries.index'); + + Route::get('/countries/create', 'Webkul\Core\Http\Controllers\CountryController@create')->defaults('_config', [ + 'view' => 'admin::settings.countries.create' + ])->name('admin.countries.create'); + + Route::post('/countries/create', 'Webkul\Core\Http\Controllers\CountryController@store')->defaults('_config', [ + 'redirect' => 'admin.countries.index' + ])->name('admin.countries.store'); + + + // Country Routes + Route::get('/currencies', 'Webkul\Core\Http\Controllers\CurrencyController@index')->defaults('_config', [ + 'view' => 'admin::settings.currencies.index' + ])->name('admin.currencies.index'); + + Route::get('/currencies/create', 'Webkul\Core\Http\Controllers\CurrencyController@create')->defaults('_config', [ + 'view' => 'admin::settings.currencies.create' + ])->name('admin.currencies.create'); + + Route::post('/currencies/create', 'Webkul\Core\Http\Controllers\CurrencyController@store')->defaults('_config', [ + 'redirect' => 'admin.currencies.index' + ])->name('admin.currencies.store'); + + + // Country Routes + Route::get('/exchange_rates', 'Webkul\Core\Http\Controllers\ExchangeRateController@index')->defaults('_config', [ + 'view' => 'admin::settings.exchange_rates.index' + ])->name('admin.exchange_rates.index'); + + Route::get('/exchange_rates/create', 'Webkul\Core\Http\Controllers\ExchangeRateController@create')->defaults('_config', [ + 'view' => 'admin::settings.exchange_rates.create' + ])->name('admin.exchange_rates.create'); + + Route::post('/exchange_rates/create', 'Webkul\Core\Http\Controllers\ExchangeRateController@store')->defaults('_config', [ + 'redirect' => 'admin.exchange_rates.index' + ])->name('admin.exchange_rates.store'); + + Route::get('/exchange_rates/edit/{id}', 'Webkul\Core\Http\Controllers\ExchangeRateController@edit')->defaults('_config', [ + 'view' => 'admin::settings.exchange_rates.edit' + ])->name('admin.exchange_rates.edit'); + + Route::put('/exchange_rates/edit/{id}', 'Webkul\Core\Http\Controllers\ExchangeRateController@update')->defaults('_config', [ + 'redirect' => 'admin.exchange_rates.index' + ])->name('admin.exchange_rates.update'); + + + // Inventory Source Routes + Route::get('/inventory_sources', 'Webkul\Inventory\Http\Controllers\InventorySourceController@index')->defaults('_config', [ + 'view' => 'admin::settings.inventory_sources.index' + ])->name('admin.inventory_sources.index'); + + Route::get('/inventory_sources/create', 'Webkul\Inventory\Http\Controllers\InventorySourceController@create')->defaults('_config', [ + 'view' => 'admin::settings.inventory_sources.create' + ])->name('admin.inventory_sources.create'); + + Route::post('/inventory_sources/create', 'Webkul\Inventory\Http\Controllers\InventorySourceController@store')->defaults('_config', [ + 'redirect' => 'admin.inventory_sources.index' + ])->name('admin.inventory_sources.store'); + + Route::get('/inventory_sources/edit/{id}', 'Webkul\Inventory\Http\Controllers\InventorySourceController@edit')->defaults('_config', [ + 'view' => 'admin::settings.inventory_sources.edit' + ])->name('admin.inventory_sources.edit'); + + Route::put('/inventory_sources/edit/{id}', 'Webkul\Inventory\Http\Controllers\InventorySourceController@update')->defaults('_config', [ + 'redirect' => 'admin.inventory_sources.index' + ])->name('admin.inventory_sources.update'); + + + // Channel Routes + Route::get('/channels', 'Webkul\Channel\Http\Controllers\ChannelController@index')->defaults('_config', [ + 'view' => 'admin::settings.channels.index' + ])->name('admin.channels.index'); + + Route::get('/channels/create', 'Webkul\Channel\Http\Controllers\ChannelController@create')->defaults('_config', [ + 'view' => 'admin::settings.channels.create' + ])->name('admin.channels.create'); + + Route::post('/channels/create', 'Webkul\Channel\Http\Controllers\ChannelController@store')->defaults('_config', [ + 'redirect' => 'admin.channels.index' + ])->name('admin.channels.store'); + + Route::get('/channels/edit/{id}', 'Webkul\Channel\Http\Controllers\ChannelController@edit')->defaults('_config', [ + 'view' => 'admin::settings.channels.edit' + ])->name('admin.channels.edit'); + + Route::put('/channels/edit/{id}', 'Webkul\Channel\Http\Controllers\ChannelController@update')->defaults('_config', [ + 'redirect' => 'admin.channels.index' + ])->name('admin.channels.update'); + + + // Admin Profile route Route::get('/account', 'Webkul\User\Http\Controllers\AccountController@edit')->defaults('_config', [ 'view' => 'admin::account.edit' diff --git a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php index df2639d7a..414c24d50 100644 --- a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php +++ b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php @@ -39,23 +39,39 @@ class EventServiceProvider extends ServiceProvider Event::listen('admin.menu.build', function($menu) { $menu->add('dashboard', 'Dashboard', 'admin.dashboard.index', 1, 'dashboard-icon'); - $menu->add('catalog', 'Catalog', 'admin.catalog.attributes.index', 3, 'catalog-icon'); + $menu->add('catalog', 'Catalog', 'admin.catalog.products.index', 3, 'catalog-icon'); + + $menu->add('catalog.products', 'Products', 'admin.catalog.products.index', 1); + + $menu->add('catalog.categories', 'Categories', 'admin.catalog.categories.index', 2); $menu->add('catalog.attributes', 'Attributes', 'admin.catalog.attributes.index', 3); + $menu->add('catalog.families', 'Families', 'admin.catalog.families.index', 4); + $menu->add('configuration', 'Configure', 'admin.account.edit', 6, 'configuration-icon'); $menu->add('configuration.account', 'My Account', 'admin.account.edit', 1); - $menu->add('settings', 'Settings', 'admin.users.index', 6, 'settings-icon'); + $menu->add('settings', 'Settings', 'admin.countries.index', 6, 'settings-icon'); - $menu->add('settings.users', 'Users', 'admin.users.index', 1, ''); + $menu->add('settings.countries', 'Countries', 'admin.countries.index', 1, ''); + + $menu->add('settings.locales', 'Locales', 'admin.locales.index', 2, ''); + + $menu->add('settings.currencies', 'Currencies', 'admin.currencies.index', 3, ''); + + $menu->add('settings.exchange_rates', 'Exchange Rates', 'admin.exchange_rates.index', 4, ''); + + $menu->add('settings.inventory_sources', 'Inventory Sources', 'admin.inventory_sources.index', 5, ''); + + $menu->add('settings.channels', 'Channels', 'admin.channels.index', 5, ''); + + $menu->add('settings.users', 'Users', 'admin.users.index', 7, ''); $menu->add('settings.users.users', 'Users', 'admin.users.index', 1, ''); $menu->add('settings.users.roles', 'Roles', 'admin.roles.index', 2, ''); - - $menu->add('settings.locales', 'Locales', 'admin.locales.index', 2, ''); }); } diff --git a/packages/Webkul/Admin/src/Resources/assets/js/app.js b/packages/Webkul/Admin/src/Resources/assets/js/app.js index f3e1859af..633173b3a 100644 --- a/packages/Webkul/Admin/src/Resources/assets/js/app.js +++ b/packages/Webkul/Admin/src/Resources/assets/js/app.js @@ -23,23 +23,51 @@ $(document).ready(function() { methods: { onSubmit: function(e) { this.$validator.validateAll().then(result => { +$(document).ready(function () { + Vue.config.ignoredElements = [ + 'option-wrapper', + 'group-form', + 'group-list' + ]; + + var app = new Vue({ + el: '#app', + + data: { + modalIds: {} + }, + + mounted () { + this.addServerErrors() + this.addFlashMessages() + }, + + methods: { + onSubmit (e) { + this.$validator.validateAll().then((result) => { if (result) { e.target.submit(); } }); }, - addServerErrors: function() { + addServerErrors () { var scope = null; for (var key in serverErrors) { const field = this.$validator.fields.find({ name: key, scope: scope }); + var inputName = key; + if(key.indexOf('.') !== -1) { + inputName = key.replace(".", "[") + ']'; + } + + const field = this.$validator.fields.find({ name: inputName, scope: scope }); if (field) { this.$validator.errors.add({ id: field.id, - field: key, + field: inputName, msg: serverErrors[key][0], scope: scope }); @@ -53,6 +81,10 @@ $(document).ready(function() { flashMessages.forEach(function(flash) { flashes.addFlash(flash); }, this); + }, + + showModal (id) { + this.$set(this.modalIds, id, true); } } }); diff --git a/packages/Webkul/Admin/src/Resources/assets/sass/app.scss b/packages/Webkul/Admin/src/Resources/assets/sass/app.scss index 3023aca16..5c2dde827 100644 --- a/packages/Webkul/Admin/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Admin/src/Resources/assets/sass/app.scss @@ -118,7 +118,6 @@ body { right: 0; left: 0; bottom: 0px; - z-index: 1; overflow-x: hidden; overflow-y: auto; @@ -154,7 +153,7 @@ body { .content-wrapper { padding: 25px 25px 25px 305px; - overflow-y: auto; + // overflow-y: auto; } .content { @@ -165,15 +164,35 @@ body { } .page-header { - display: block; + display: inline-block; + margin-bottom: 20px; + width: 100%; .page-title { float: left; + + h1 { + margin-bottom: 0; + vertical-align: middle; + display: inline-block; + } } .page-action { float: right; } + + .control-group { + width: 180px; + display: inline-block; + margin-bottom: 0; + margin-left: 20px; + } + + .control { + width: 100%; + margin: 0; + } } .page-content { diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php new file mode 100644 index 000000000..dde011089 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -0,0 +1,229 @@ + [ + 'header-title' => 'My Account', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'name' => 'Name', + 'email' => 'Email', + 'password' => 'Password', + 'confirm-password' => 'Confirm Password' + ], + 'users' => [ + 'forget-password' => [ + 'title' => 'Forget Password', + 'header-title' => 'Recover Password', + 'email' => 'Registered Email', + 'password' => 'Password', + 'confirm-password' => 'Confirm Password', + 'back-link-title' => 'Back to Sign In', + 'submit-btn-title' => 'Email Password Reset Link' + ], + 'reset-password' => [ + 'title' => 'Reset Password', + 'title' => 'Reset Password', + 'email' => 'Registered Email', + 'back-link-title' => 'Back to Sign In', + 'submit-btn-title' => 'Reset Password' + ], + 'roles' => [ + 'add-role-title' => 'Add Role', + 'edit-role-title' => 'Edit Role', + 'save-btn-title' => 'Save Role', + 'general' => 'General', + 'name' => 'Name', + 'description' => 'Description', + 'access-control' => 'Access Control', + 'permissions' => 'Permissions', + 'custom' => 'Custom', + 'all' => 'All' + ], + 'users' => [ + 'add-user-title' => 'Add User', + 'edit-user-title' => 'Edit User', + 'save-btn-title' => 'Save User', + 'general' => 'General', + 'email' => 'Email', + 'name' => 'Name', + 'password' => 'Password', + 'confirm-password' => 'Confirm Password', + 'status-and-role' => 'Status and Role', + 'role' => 'Role', + 'status' => 'Status', + 'account-is-active' => 'Account is Active' + ], + 'sessions' => [ + 'title' => 'Sign In', + 'email' => 'Email', + 'password' => 'Password', + 'forget-password-link-title' => 'Forget Password ?', + 'remember-me' => 'Remember Me', + 'submit-btn-title' => 'Sign In' + ] + ], + 'catalog' => [ + 'products' => [ + 'products' => 'products', + 'add-product-btn-title' => 'Add Product', + 'add-title' => 'Add Product', + 'edit-title' => 'Edit Product', + 'save-btn-title' => 'Save Product', + ], + 'attributes' => [ + 'add-title' => 'Add Attribute', + 'edit-title' => 'Edit Attribute', + 'save-btn-title' => 'Save Attribute', + 'general' => 'General', + 'code' => 'Attribute Code', + 'type' => 'Attribute Type', + 'text' => 'Text', + 'textarea' => 'Textarea', + 'price' => 'Price', + 'boolean' => 'Boolean', + 'select' => 'Select', + 'multiselect' => 'Multiselect', + 'checkbox' => 'Checkbox', + 'datetime' => 'Datetime', + 'date' => 'Date', + 'label' => 'label', + 'admin' => 'Admin', + 'options' => 'Options', + 'position' => 'Position', + 'add-option-btn-title' => 'Add Option', + 'validations' => 'Validations', + 'input_validation' => 'Input Validation', + 'is_required' => 'Is Required', + 'is_unique' => 'Is Unique', + 'number' => 'Number', + 'decimal' => 'Decimal', + 'email' => 'Email', + 'url' => 'URL', + 'configuration' => 'Configuration', + 'status' => 'Status', + 'yes' => 'Yes', + 'no' => 'No', + 'value_per_locale' => 'Value Per Locale', + 'value_per_channel' => 'Value Per Channel', + 'value_per_channel' => 'Value Per Channel', + 'is_filterable' => 'Use in Layered Navigation', + 'is_configurable' => 'Use To Create Configurable Product' + ], + 'families' => [ + 'families' => 'Families', + 'add-family-btn-title' => 'Add Family', + 'add-title' => 'Add Family', + 'edit-title' => 'Edit Family', + 'save-btn-title' => 'Save Family', + 'general' => 'General', + 'code' => 'Family Code', + 'name' => 'Name', + 'groups' => 'Groups', + 'add-group-title' => 'Add Group', + 'position' => 'Position', + 'attribute-code' => 'Code', + 'type' => 'Type', + 'add-attribute-title' => 'Add Attributes', + 'search' => 'Search', + 'group-exist-error' => 'Group with same name already exists.' + ], + 'categories' => [ + 'categories' => 'Categories', + 'add-title' => 'Add Category', + 'edit-title' => 'Edit Category', + 'save-btn-title' => 'Save Category', + 'general' => 'General', + 'name' => 'Name', + 'visible-in-menu' => 'Visible In Menu', + 'yes' => 'Yes', + 'no' => 'No', + 'position' => 'Position', + 'description-and-images' => 'Description and Images', + 'description' => 'Description', + 'parent-category' => 'Parent Category', + 'seo' => 'Search Engine Optimization', + 'slug' => 'Slug', + 'meta_title' => 'Meta Title', + 'meta_description' => 'Meta Description', + 'meta_keywords' => 'Meta Keywords', + ] + ], + 'settings' => [ + 'locales' => [ + 'add-locale-title' => 'Add Locale', + 'edit-locale-title' => 'Edit Locale', + 'add-title' => 'Add Locale', + 'save-btn-title' => 'Save Locale', + 'general' => 'General', + 'code' => 'Code', + 'name' => 'Name' + ], + 'countries' => [ + 'add-title' => 'Add Counrty', + 'save-btn-title' => 'Save Counrty', + 'general' => 'General', + 'code' => 'Code', + 'name' => 'Name' + ], + 'currencies' => [ + 'add-title' => 'Add Currency', + 'edit-title' => 'Edit Currency', + 'save-btn-title' => 'Save Currency', + 'general' => 'General', + 'code' => 'Code', + 'name' => 'Name', + 'symbol' => 'Symbol' + ], + 'exchange_rates' => [ + 'title' => 'Exchange Rates', + 'add-title' => 'Add Exchange Rate', + 'edit-title' => 'Edit Exchange Rate', + 'save-btn-title' => 'Save Exchange Rate', + 'general' => 'General', + 'source_currency' => 'Source Currency', + 'target_currency' => 'Target Currency', + 'ratio' => 'Ratio' + ], + 'inventory_sources' => [ + 'title' => 'Inventory Sources', + 'add-title' => 'Add Inventory Source', + 'edit-title' => 'Edit Inventory Source', + 'save-btn-title' => 'Save Inventory Source', + 'general' => 'General', + 'code' => 'Code', + 'name' => 'Name', + 'description' => 'Description', + 'source-is-active' => 'Source is Active', + 'contact-info' => 'Contact Information', + 'contact_name' => 'Name', + 'contact_email' => 'Email', + 'contact_number' => 'Contact Number', + 'contact_fax' => 'Fax', + 'address' => 'Source Address', + 'country' => 'Country', + 'state' => 'State', + 'city' => 'City', + 'street' => 'Street', + 'postcode' => 'Postcode', + 'priority' => 'Priority', + 'latitude' => 'Latitude', + 'longitude' => 'Longitude', + 'status' => 'Status' + ], + 'channels' => [ + 'title' => 'Channels', + 'add-title' => 'Add Channel', + 'edit-title' => 'Edit Channel', + 'save-btn-title' => 'Save Channel', + 'general' => 'General', + 'code' => 'Code', + 'name' => 'Name', + 'description' => 'Description', + 'currencies-and-locales' => 'Currencies and Locales', + 'locales' => 'Locales', + 'default-locale' => 'Default Locale', + 'currencies' => 'Currencies', + 'base-currency' => 'Base Currency' + ] + ] +]; \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php index 464eab427..75f44f617 100644 --- a/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php @@ -6,13 +6,13 @@ @@ -24,32 +24,32 @@ - -
+ +
- + @{{ errors.first('name') }}
- + @{{ errors.first('email') }}
- -
+ +
- + @{{ errors.first('password') }}
- + @{{ errors.first('password_confirmation') }}
diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php index 853ddd80b..d00bee59f 100644 --- a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php @@ -1,17 +1,22 @@ @extends('admin::layouts.content') +@section('page_title') + {{ __('admin::app.catalog.attributes.add-title') }} +@stop + + @section('content')
-
+ @@ -20,44 +25,45 @@
@csrf() - -
+ +
- + @{{ errors.first('code') }}
- +
- -
+ +
-
- - - @{{ errors.first('name') }} +
+ + + @{{ errors.first('admin_name') }}
@foreach(Webkul\Core\Models\Locale::all() as $locale)
- +
@endforeach @@ -65,13 +71,93 @@
- +
+ +
+ + + +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
- - + +
- +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
@@ -81,5 +167,109 @@ @stop @section('javascript') + + + @stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php new file mode 100644 index 000000000..a5da9929a --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php @@ -0,0 +1,343 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.catalog.attributes.edit-title') }} +@stop + + +@section('content') +
+ + + + +
+
+ @csrf() + + + +
+
+ + + + @{{ errors.first('code') }} +
+ +
+ type ?> + + + +
+
+
+ + +
+ +
+ + + @{{ errors.first('admin_name') }} +
+ + @foreach(Webkul\Core\Models\Locale::all() as $locale) + +
+ + +
+ + @endforeach + +
+
+ +
+ +
+ + + +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ input_validation ?> + + +
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+
+
+ + +
+@stop + +@section('javascript') + + + +@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/categories/create.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/categories/create.blade.php new file mode 100644 index 000000000..e17a616f2 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/catalog/categories/create.blade.php @@ -0,0 +1,118 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.catalog.categories.add-title') }} +@stop + +@section('content') +
+ +
+ + + +
+
+ @csrf() + + + +
+ +
+ + + @{{ errors.first('name') }} +
+ +
+ + + @{{ errors.first('status') }} +
+ +
+ + + @{{ errors.first('position') }} +
+ +
+
+ + +
+ +
+ + + @{{ errors.first('description') }} +
+ +
+
+ + @if($categories->count()) + +
+ + + +
+
+ @endif + + +
+ +
+ + +
+ +
+ + + @{{ errors.first('slug') }} +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+
+ +
+
+@stop + +@section('javascript') + +@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php new file mode 100644 index 000000000..5dae79a94 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php @@ -0,0 +1,133 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.catalog.categories.edit-title') }} +@stop + +@section('content') +
+ get('channel_locale') ?: channel()->getDefaultChannelLocaleCode(); ?> + +
+ + + +
+
+ @csrf() + + + +
+ +
+ + + @{{ errors.first('{!!$locale!!}[name]') }} +
+ +
+ + + @{{ errors.first('status') }} +
+ +
+ + + @{{ errors.first('position') }} +
+ +
+
+ + +
+ +
+ + + @{{ errors.first('{!!$locale!!}[description]') }} +
+ +
+
+ + @if($categories->count()) + +
+ + + +
+
+ @endif + + +
+ +
+ + +
+ +
+ + + @{{ errors.first('{!!$locale!!}[slug]') }} +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+
+ +
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/categories/index.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/categories/index.blade.php new file mode 100644 index 000000000..54347e88e --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/catalog/categories/index.blade.php @@ -0,0 +1,21 @@ +@extends('admin::layouts.content') + +@section('content') +
+ + +
+ +
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/families/create.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/families/create.blade.php new file mode 100644 index 000000000..827009efa --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/catalog/families/create.blade.php @@ -0,0 +1,343 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.catalog.families.add-title') }} +@stop + +@section('content') +
+
+ + + +
+ +
+ @csrf() + + +
+ +
+ + + @{{ errors.first('code') }} +
+ +
+ + + @{{ errors.first('name') }} +
+ +
+
+ + +
+ + + + +
+
+
+
+ +
+
+ + +

{{ __('admin::app.catalog.families.add-group-title') }}

+ +
+ +
+
+@stop + +@section('javascript') + + + + + + + + +@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/families/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/families/edit.blade.php new file mode 100644 index 000000000..6cbfeceb0 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/catalog/families/edit.blade.php @@ -0,0 +1,345 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.catalog.families.edit-title') }} +@stop + +@section('content') +
+
+ + + +
+ +
+ @csrf() + + + +
+ +
+ + + @{{ errors.first('code') }} +
+ +
+ + + @{{ errors.first('name') }} +
+ +
+
+ + +
+ + + + +
+
+
+
+ +
+
+ + +

{{ __('admin::app.catalog.families.add-group-title') }}

+ +
+ +
+
+@stop + +@section('javascript') + + + + + + + + +@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/families/index.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/families/index.blade.php new file mode 100644 index 000000000..e9a0ec81e --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/catalog/families/index.blade.php @@ -0,0 +1,21 @@ +@extends('admin::layouts.content') + +@section('content') +
+ + +
+ +
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/products/index.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/products/index.blade.php new file mode 100644 index 000000000..5d968cba8 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/catalog/products/index.blade.php @@ -0,0 +1,21 @@ +@extends('admin::layouts.content') + +@section('content') +
+ + +
+ +
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/layouts/master.blade.php b/packages/Webkul/Admin/src/Resources/views/layouts/master.blade.php index 5965a9bc1..07f81e85b 100644 --- a/packages/Webkul/Admin/src/Resources/views/layouts/master.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/layouts/master.blade.php @@ -54,5 +54,6 @@ @yield('javascript') + \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/channels/create.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/channels/create.blade.php new file mode 100644 index 000000000..27020ecdc --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/channels/create.blade.php @@ -0,0 +1,109 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.settings.channels.add-title') }} +@stop + +@section('content') +
+ +
+ + +
+
+ @csrf() + + +
+ +
+ + + @{{ errors.first('code') }} +
+ +
+ + + @{{ errors.first('name') }} +
+ +
+ + + @{{ errors.first('description') }} +
+ +
+
+ + +
+ +
+ + + @{{ errors.first('locales[]') }} +
+ +
+ + + @{{ errors.first('default_locale') }} +
+ +
+ + + @{{ errors.first('currencies[]') }} +
+ +
+ + + @{{ errors.first('base_currency') }} +
+ +
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/channels/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/channels/edit.blade.php new file mode 100644 index 000000000..7f61fceb9 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/channels/edit.blade.php @@ -0,0 +1,114 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.settings.channels.edit-title') }} +@stop + +@section('content') +
+ +
+ + +
+
+ @csrf() + + + +
+ +
+ + + @{{ errors.first('code') }} +
+ +
+ + + @{{ errors.first('name') }} +
+ +
+ + + @{{ errors.first('description') }} +
+ +
+
+ + +
+ +
+ + locales->pluck('id')->toArray() ?> + + @{{ errors.first('locales[]') }} +
+ +
+ + default_locale ?> + + @{{ errors.first('default_locale') }} +
+ +
+ + currencies->pluck('id')->toArray() ?> + + @{{ errors.first('currencies[]') }} +
+ +
+ + base_currency ?> + + @{{ errors.first('base_currency') }} +
+ +
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/channels/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/channels/index.blade.php new file mode 100644 index 000000000..e07483858 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/channels/index.blade.php @@ -0,0 +1,21 @@ +@extends('admin::layouts.content') + +@section('content') + +@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/countries/create.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/countries/create.blade.php new file mode 100644 index 000000000..c9fc0483e --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/countries/create.blade.php @@ -0,0 +1,43 @@ +@extends('admin::layouts.content') + +@section('content') +
+ +
+ + +
+
+ @csrf() + + +
+
+ + + @{{ errors.first('code') }} +
+ +
+ + + @{{ errors.first('name') }} +
+
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/countries/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/countries/index.blade.php new file mode 100644 index 000000000..db2b18659 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/countries/index.blade.php @@ -0,0 +1,21 @@ +@extends('admin::layouts.content') + +@section('content') + +@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/currencies/create.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/currencies/create.blade.php new file mode 100644 index 000000000..6945ef0e1 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/currencies/create.blade.php @@ -0,0 +1,49 @@ +@extends('admin::layouts.content') + +@section('content') +
+ +
+ + +
+
+ @csrf() + + +
+
+ + + @{{ errors.first('code') }} +
+ +
+ + + @{{ errors.first('name') }} +
+ +
+ + + @{{ errors.first('symbol') }} +
+
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/currencies/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/currencies/edit.blade.php new file mode 100644 index 000000000..327009bfc --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/currencies/edit.blade.php @@ -0,0 +1,50 @@ +@extends('admin::layouts.content') + +@section('content') +
+ +
+ + +
+
+ @csrf() + + + +
+
+ + + @{{ errors.first('code') }} +
+ +
+ + + @{{ errors.first('name') }} +
+ +
+ + + @{{ errors.first('symbol') }} +
+
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/currencies/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/currencies/index.blade.php new file mode 100644 index 000000000..78af5b483 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/currencies/index.blade.php @@ -0,0 +1,21 @@ +@extends('admin::layouts.content') + +@section('content') + +@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/exchange_rates/create.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/exchange_rates/create.blade.php new file mode 100644 index 000000000..06b3e7185 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/exchange_rates/create.blade.php @@ -0,0 +1,61 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.settings.exchange_rates.add-title') }} +@stop + +@section('content') +
+ +
+ + +
+
+ @csrf() + + +
+
+ + + @{{ errors.first('source_currency') }} +
+ +
+ + + @{{ errors.first('target_currency') }} +
+ +
+ + + @{{ errors.first('ratio') }} +
+
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/exchange_rates/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/exchange_rates/edit.blade.php new file mode 100644 index 000000000..bef0243e8 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/exchange_rates/edit.blade.php @@ -0,0 +1,66 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.settings.exchange_rates.edit-title') }} +@stop + +@section('content') +
+ +
+ + +
+
+ @csrf() + + + +
+
+ + + @{{ errors.first('source_currency') }} +
+ +
+ + + @{{ errors.first('target_currency') }} +
+ +
+ + + @{{ errors.first('ratio') }} +
+
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/exchange_rates/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/exchange_rates/index.blade.php new file mode 100644 index 000000000..42f738f56 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/exchange_rates/index.blade.php @@ -0,0 +1,25 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.settings.exchange_rates.title') }} +@stop + +@section('content') + +@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/create.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/create.blade.php new file mode 100644 index 000000000..395c90e95 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/create.blade.php @@ -0,0 +1,141 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.settings.inventory_sources.add-title') }} +@stop + +@section('content') +
+ +
+ + +
+
+ @csrf() + + +
+ +
+ + + @{{ errors.first('code') }} +
+ +
+ + + @{{ errors.first('name') }} +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + + + {{ __('admin::app.settings.inventory_sources.source-is-active') }} + +
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/edit.blade.php new file mode 100644 index 000000000..cf156c46c --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/edit.blade.php @@ -0,0 +1,143 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.settings.inventory_sources.edit-title') }} +@stop + +@section('content') +
+ +
+ + +
+
+ @csrf() + + + +
+ +
+ + + @{{ errors.first('code') }} +
+ +
+ + + @{{ errors.first('name') }} +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + status ? 'checked' : '' }}> + + {{ __('admin::app.settings.inventory_sources.source-is-active') }} + +
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ + +
+ +
+ country ?> + + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/index.blade.php new file mode 100644 index 000000000..861ff89ee --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/index.blade.php @@ -0,0 +1,25 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.settings.inventory_sources.title') }} +@stop + +@section('content') + +@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/locales/create.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/locales/create.blade.php similarity index 70% rename from packages/Webkul/Admin/src/Resources/views/locales/create.blade.php rename to packages/Webkul/Admin/src/Resources/views/settings/locales/create.blade.php index 69c88bc72..13624feee 100644 --- a/packages/Webkul/Admin/src/Resources/views/locales/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/settings/locales/create.blade.php @@ -1,17 +1,21 @@ @extends('admin::layouts.content') +@section('page_title') + {{ __('admin::app.settings.locales.add-locale-title') }} +@stop + @section('content')
@@ -20,16 +24,16 @@
@csrf() - -
+ +
- + @{{ errors.first('code') }}
- + @{{ errors.first('name') }}
diff --git a/packages/Webkul/Admin/src/Resources/views/locales/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/locales/index.blade.php similarity index 85% rename from packages/Webkul/Admin/src/Resources/views/locales/index.blade.php rename to packages/Webkul/Admin/src/Resources/views/settings/locales/index.blade.php index f64f7016b..80addfaa3 100644 --- a/packages/Webkul/Admin/src/Resources/views/locales/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/settings/locales/index.blade.php @@ -9,7 +9,7 @@
diff --git a/packages/Webkul/Admin/src/Resources/views/users/forget-password/create.blade.php b/packages/Webkul/Admin/src/Resources/views/users/forget-password/create.blade.php index 0a71424e4..127a40a79 100644 --- a/packages/Webkul/Admin/src/Resources/views/users/forget-password/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/users/forget-password/create.blade.php @@ -1,7 +1,7 @@ @extends('admin::layouts.anonymous-master') @section('page_title') - {{ __('Forget Password') }} + {{ __('admin::app.users.forget-password.title') }} @stop @section('css') @@ -23,25 +23,25 @@
-

{{ __('Recover Password') }}

+

{{ __('admin::app.users.forget-password.header-title') }}

@csrf
- + @{{ errors.first('email') }}
- +
diff --git a/packages/Webkul/Admin/src/Resources/views/users/reset-password/create.blade.php b/packages/Webkul/Admin/src/Resources/views/users/reset-password/create.blade.php index 2103ff14b..f2ec8daa6 100644 --- a/packages/Webkul/Admin/src/Resources/views/users/reset-password/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/users/reset-password/create.blade.php @@ -1,7 +1,7 @@ @extends('admin::layouts.anonymous-master') @section('page_title') - {{ __('Reset Password') }} + {{ __('admin::app.users.reset-password.title') }} @stop @section('css') @@ -23,7 +23,7 @@
-

{{ __('Reset Password') }}

+

{{ __('admin::app.users.reset-password.title') }}

@csrf @@ -31,31 +31,31 @@
- + @{{ errors.first('email') }}
- + @{{ errors.first('password') }}
- + @{{ errors.first('password_confirmation') }}
- +
diff --git a/packages/Webkul/Admin/src/Resources/views/users/roles/create.blade.php b/packages/Webkul/Admin/src/Resources/views/users/roles/create.blade.php index c0d3d587e..b13b67d16 100644 --- a/packages/Webkul/Admin/src/Resources/views/users/roles/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/users/roles/create.blade.php @@ -1,17 +1,21 @@ @extends('admin::layouts.content') +@section('page_title') + {{ __('admin::app.users.roles.add-role-title') }} +@stop + @section('content')
@@ -20,28 +24,28 @@
@csrf() - -
+ +
- + @{{ errors.first('name') }}
- +
- -
+ +
- +
diff --git a/packages/Webkul/Admin/src/Resources/views/users/roles/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/users/roles/edit.blade.php index 08b79c1c5..4cba98c94 100644 --- a/packages/Webkul/Admin/src/Resources/views/users/roles/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/users/roles/edit.blade.php @@ -1,17 +1,21 @@ @extends('admin::layouts.content') +@section('page_title') + {{ __('admin::app.users.roles.edit-role-title') }} +@stop + @section('content')
@@ -22,28 +26,28 @@ - -
+ +
- + @{{ errors.first('name') }}
- +
- -
+ +
- +
diff --git a/packages/Webkul/Admin/src/Resources/views/users/sessions/create.blade.php b/packages/Webkul/Admin/src/Resources/views/users/sessions/create.blade.php index ba227c8a9..1e74d8019 100644 --- a/packages/Webkul/Admin/src/Resources/views/users/sessions/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/users/sessions/create.blade.php @@ -1,7 +1,7 @@ @extends('admin::layouts.anonymous-master') @section('page_title') - {{ __('Sign In') }} + {{ __('admin::app.users.sessions.title') }} @stop @section('content') @@ -12,37 +12,37 @@
-

{{ __('Sign In') }}

+

{{ __('admin::app.users.sessions.title') }}

@csrf
- + @{{ errors.first('email') }}
- + @{{ errors.first('password') }}
- {{ __('Remember me') }} + {{ __('admin::app.users.sessions.remember-me') }}
- +
diff --git a/packages/Webkul/Admin/src/Resources/views/users/users/create.blade.php b/packages/Webkul/Admin/src/Resources/views/users/users/create.blade.php index 460ffb4b2..146ee6cbb 100644 --- a/packages/Webkul/Admin/src/Resources/views/users/users/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/users/users/create.blade.php @@ -1,16 +1,20 @@ @extends('admin::layouts.content') +@section('page_title') + {{ __('admin::app.users.users.add-user-title') }} +@stop + @section('content')
@@ -19,16 +23,16 @@
@csrf() - -
+ +
- + @{{ errors.first('name') }}
- + @{{ errors.first('email') }}
@@ -36,25 +40,25 @@ -
+
- + @{{ errors.first('password') }}
- + @{{ errors.first('password_confirmation') }}
- -
+ +
- + - {{ __('Account is Active') }} + {{ __('admin::app.users.users.account-is-active') }}
diff --git a/packages/Webkul/Admin/src/Resources/views/users/users/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/users/users/edit.blade.php index 1a9e48884..1f087608a 100644 --- a/packages/Webkul/Admin/src/Resources/views/users/users/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/users/users/edit.blade.php @@ -1,16 +1,21 @@ @extends('admin::layouts.content') +@section('page_title') + {{ __('admin::app.users.users.edit-user-title') }} +@stop + + @section('content')
@@ -20,42 +25,42 @@ @csrf() - -
+ +
- + @{{ errors.first('name') }}
- + @{{ errors.first('email') }}
- -
+ +
- + @{{ errors.first('password') }}
- + @{{ errors.first('password_confirmation') }}
- -
+ +
- + status ? 'checked' : '' }}> - {{ __('Account is Active') }} + {{ __('admin::app.users.users.account-is-active') }}
diff --git a/packages/Webkul/Attribute/composer.json b/packages/Webkul/Attribute/composer.json index 8b6257ada..34c54ccbb 100644 --- a/packages/Webkul/Attribute/composer.json +++ b/packages/Webkul/Attribute/composer.json @@ -8,7 +8,8 @@ } ], "require": { - "nwidart/laravel-modules": "^3.2" + "nwidart/laravel-modules": "^3.2", + "webkul/laravel-core": "dev-master" }, "autoload": { "psr-4": { diff --git a/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_130148_create_attributes_table.php b/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_130148_create_attributes_table.php index 06744de37..e3db08efa 100644 --- a/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_130148_create_attributes_table.php +++ b/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_130148_create_attributes_table.php @@ -16,16 +16,16 @@ class CreateAttributesTable extends Migration Schema::create('attributes', function (Blueprint $table) { $table->increments('id'); $table->string('code')->unique(); - $table->string('name'); + $table->string('admin_name'); $table->string('type'); $table->string('validation')->nullable(); $table->integer('position')->nullable(); - $table->boolean('is_required'); - $table->boolean('is_unique'); - $table->boolean('value_per_locale'); - $table->boolean('value_per_channel'); - $table->boolean('is_filterable'); - $table->boolean('is_configurable'); + $table->boolean('is_required')->default(0); + $table->boolean('is_unique')->default(0); + $table->boolean('value_per_locale')->default(0); + $table->boolean('value_per_channel')->default(0); + $table->boolean('is_filterable')->default(0); + $table->boolean('is_configurable')->default(0); $table->boolean('is_user_defined')->default(1); $table->timestamps(); }); diff --git a/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_135200_create_attribute_families_table.php b/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_135150_create_attribute_families_table.php similarity index 77% rename from packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_135200_create_attribute_families_table.php rename to packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_135150_create_attribute_families_table.php index 13c0e6c25..d3ea2cba7 100644 --- a/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_135200_create_attribute_families_table.php +++ b/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_135150_create_attribute_families_table.php @@ -15,12 +15,10 @@ class CreateAttributeFamiliesTable extends Migration { Schema::create('attribute_families', function (Blueprint $table) { $table->increments('id'); + $table->string('code'); $table->string('name'); $table->boolean('status')->default(0); - }); - - Schema::table('attribute_groups', function($table) { - $table->foreign('attribute_family_id')->references('id')->on('attribute_families')->onDelete('cascade'); + $table->boolean('is_user_defined')->default(1); }); } diff --git a/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_135152_create_attribute_groups_table.php b/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_135152_create_attribute_groups_table.php index d657883d2..bfaca20b4 100644 --- a/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_135152_create_attribute_groups_table.php +++ b/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_135152_create_attribute_groups_table.php @@ -16,10 +16,20 @@ class CreateAttributeGroupsTable extends Migration Schema::create('attribute_groups', function (Blueprint $table) { $table->increments('id'); $table->string('name'); - $table->timestamps(); - $table->integer('sort_order'); + $table->integer('position'); + $table->boolean('is_user_defined')->default(1); $table->integer('attribute_family_id')->unsigned(); $table->unique(['attribute_family_id', 'name']); + $table->foreign('attribute_family_id')->references('id')->on('attribute_families')->onDelete('cascade'); + }); + + Schema::create('attribute_group_mappings', function (Blueprint $table) { + $table->integer('attribute_id')->unsigned(); + $table->integer('attribute_group_id')->unsigned(); + $table->integer('position')->nullable(); + $table->primary(['attribute_id', 'attribute_group_id']); + $table->foreign('attribute_id')->references('id')->on('attributes')->onDelete('cascade'); + $table->foreign('attribute_group_id')->references('id')->on('attribute_groups')->onDelete('cascade'); }); } @@ -31,5 +41,7 @@ class CreateAttributeGroupsTable extends Migration public function down() { Schema::dropIfExists('attribute_groups'); + + Schema::dropIfExists('attribute_group_mappings'); } } diff --git a/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_140832_create_attribute_options_table.php b/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_140832_create_attribute_options_table.php index 19e579faf..66883cd91 100644 --- a/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_140832_create_attribute_options_table.php +++ b/packages/Webkul/Attribute/src/Database/Migrations/2018_07_05_140832_create_attribute_options_table.php @@ -15,10 +15,8 @@ class CreateAttributeOptionsTable extends Migration { Schema::create('attribute_options', function (Blueprint $table) { $table->increments('id'); - $table->string('code'); - $table->integer('sort_order'); + $table->integer('sort_order')->nullable(); $table->integer('attribute_id')->unsigned(); - $table->unique(['attribute_id', 'code']); $table->foreign('attribute_id')->references('id')->on('attributes')->onDelete('cascade'); }); } diff --git a/packages/Webkul/Attribute/src/Database/Seeders/.gitkeep b/packages/Webkul/Attribute/src/Database/Seeders/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php new file mode 100644 index 000000000..5524ebae9 --- /dev/null +++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeFamilyTableSeeder.php @@ -0,0 +1,140 @@ + "default", + "name" => "Default", + "is_user_defined" => 0, + 'attribute_groups' => [ + [ + "name" => "General", + "is_user_defined" => 0, + "position" => 1, + "attributes" => [ + [ + 'code' => 'name', + 'position' => 1 + ], [ + 'code' => 'url_key', + 'position' => 2 + ], [ + 'code' => 'new_from', + 'position' => 3 + ], [ + 'code' => 'new_to', + 'position' => 4 + ], [ + 'code' => 'status', + 'position' => 5 + ] + ] + ], [ + "name" => "Description", + "is_user_defined" => 0, + "position" => 2, + "attributes" => [ + [ + 'code' => 'short_description', + 'position' => 1 + ], [ + 'code' => 'description', + 'position' => 2 + ] + ] + ], [ + "name" => "Meta Description", + "is_user_defined" => 0, + "position" => 3, + "attributes" => [ + [ + 'code' => 'meta_title', + 'position' => 1 + ], [ + 'code' => 'meta_keywords', + 'position' => 2 + ], [ + 'code' => 'meta_description', + 'position' => 3 + ] + ] + ], [ + "name" => "Price", + "is_user_defined" => 0, + "position" => 4, + "attributes" => [ + [ + 'code' => 'price', + 'position' => 1 + ], [ + 'code' => 'cost', + 'position' => 2 + ], [ + 'code' => 'special_price', + 'position' => 3 + ], [ + 'code' => 'special_price_from', + 'position' => 4 + ], [ + 'code' => 'special_price_to', + 'position' => 5 + ] + ] + ], [ + "name" => "Shipping", + "is_user_defined" => 0, + "position" => 5, + "attributes" => [ + [ + 'code' => 'width', + 'position' => 1 + ], [ + 'code' => 'height', + 'position' => 2 + ], [ + 'code' => 'depth', + 'position' => 3 + ], [ + 'code' => 'weight', + 'position' => 4 + ] + ] + ] + ] + ] + ]; + + /** + * AttributeFamilyRepository object + * + * @var array + */ + protected $attributeFamily; + + /** + * Create a new controller instance. + * + * @param Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamily + * @return void + */ + public function __construct(AttributeFamilyRepository $attributeFamily) + { + $this->attributeFamily = $attributeFamily; + } + + public function run() + { + foreach($this->rawData as $row) { + $this->attributeFamily->create($row); + } + } +} \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php new file mode 100644 index 000000000..9937f945a --- /dev/null +++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php @@ -0,0 +1,391 @@ + 'name', + 'admin_name' => 'Name', + 'en' => [ + 'name' => 'Name' + ], + 'type' => 'text', + 'position' => 1, + 'is_required' => 1, + 'value_per_locale' => 1, + 'value_per_channel' => 1, + 'is_filterable' => 1, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'url_key', + 'admin_name' => 'URL Key', + 'en' => [ + 'name' => 'URL Key' + ], + 'type' => 'text', + 'position' => 2, + 'is_unique' => 1, + 'is_required' => 1, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'new_from', + 'admin_name' => 'New From', + 'en' => [ + 'name' => 'New From' + ], + 'type' => 'datetime', + 'position' => 3, + 'is_required' => 0, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'new_to', + 'admin_name' => 'New To', + 'en' => [ + 'name' => 'New To' + ], + 'type' => 'datetime', + 'position' => 4, + 'is_required' => 0, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'status', + 'admin_name' => 'Status', + 'en' => [ + 'name' => 'Status' + ], + 'type' => 'boolean', + 'position' => 5, + 'is_required' => 1, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'short_description', + 'admin_name' => 'Short Description', + 'en' => [ + 'name' => 'Short Description' + ], + 'type' => 'textarea', + 'position' => 6, + 'is_required' => 1, + 'value_per_locale' => 1, + 'value_per_channel' => 1, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'description', + 'admin_name' => 'Description', + 'en' => [ + 'name' => 'Description' + ], + 'type' => 'textarea', + 'position' => 7, + 'is_required' => 1, + 'value_per_locale' => 1, + 'value_per_channel' => 1, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'price', + 'admin_name' => 'Price', + 'en' => [ + 'name' => 'Price' + ], + 'type' => 'price', + 'position' => 8, + 'is_required' => 1, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 1, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'cost', + 'admin_name' => 'Cost', + 'en' => [ + 'name' => 'Cost' + ], + 'type' => 'price', + 'position' => 9, + 'is_required' => 0, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 1 + ], [ + 'code' => 'special_price', + 'admin_name' => 'Special Price', + 'en' => [ + 'name' => 'Special Price' + ], + 'type' => 'price', + 'position' => 10, + 'is_required' => 0, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'special_price_from', + 'admin_name' => 'Special Price From', + 'en' => [ + 'name' => 'Special Price From' + ], + 'type' => 'datetime', + 'position' => 11, + 'is_required' => 0, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'special_price_to', + 'admin_name' => 'Special Price To', + 'en' => [ + 'name' => 'Special Price To' + ], + 'type' => 'datetime', + 'position' => 12, + 'is_required' => 0, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'meta_title', + 'admin_name' => 'Meta Title', + 'en' => [ + 'name' => 'Meta Description' + ], + 'type' => 'textarea', + 'position' => 13, + 'is_required' => 0, + 'value_per_locale' => 1, + 'value_per_channel' => 1, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'meta_keywords', + 'admin_name' => 'Meta Keywords', + 'en' => [ + 'name' => 'Meta Keywords' + ], + 'type' => 'textarea', + 'position' => 14, + 'is_required' => 0, + 'value_per_locale' => 1, + 'value_per_channel' => 1, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'meta_description', + 'admin_name' => 'Meta Description', + 'en' => [ + 'name' => 'Meta Description' + ], + 'type' => 'textarea', + 'position' => 15, + 'is_required' => 0, + 'value_per_locale' => 1, + 'value_per_channel' => 1, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 1 + ], [ + 'code' => 'width', + 'admin_name' => 'Width', + 'en' => [ + 'name' => 'Width' + ], + 'type' => 'text', + 'validation' => 'number', + 'position' => 16, + 'is_required' => 0, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 1 + ], [ + 'code' => 'height', + 'admin_name' => 'Height', + 'en' => [ + 'name' => 'Height' + ], + 'type' => 'text', + 'validation' => 'number', + 'position' => 17, + 'is_required' => 0, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 1 + ], [ + 'code' => 'depth', + 'admin_name' => 'Depth', + 'en' => [ + 'name' => 'Depth' + ], + 'type' => 'text', + 'validation' => 'number', + 'position' => 18, + 'is_required' => 0, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 1 + ], [ + 'code' => 'weight', + 'admin_name' => 'Weight', + 'en' => [ + 'name' => 'Weight' + ], + 'type' => 'text', + 'validation' => 'number', + 'position' => 19, + 'is_required' => 1, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 0, + 'is_configurable' => 0, + 'is_user_defined' => 0 + ], [ + 'code' => 'color', + 'admin_name' => 'Color', + 'en' => [ + 'name' => 'Color' + ], + 'type' => 'select', + 'position' => 20, + 'is_required' => 0, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 1, + 'is_configurable' => 1, + 'is_user_defined' => 1, + 'options' => [ + [ + 'en' => [ + 'label' => 'Red' + ], + 'sort_order' => 1 + ], [ + 'en' => [ + 'label' => 'Green' + ], + 'sort_order' => 2 + ], [ + 'en' => [ + 'label' => 'Yellow' + ], + 'sort_order' => 3 + ], [ + 'en' => [ + 'label' => 'Black' + ], + 'sort_order' => 4 + ], [ + 'en' => [ + 'label' => 'White' + ], + 'sort_order' => 5 + ] + ] + ], [ + 'code' => 'size', + 'admin_name' => 'Size', + 'en' => [ + 'name' => 'Size' + ], + 'type' => 'select', + 'position' => 21, + 'is_required' => 0, + 'value_per_locale' => 0, + 'value_per_channel' => 0, + 'is_filterable' => 1, + 'is_configurable' => 1, + 'is_user_defined' => 1, + 'options' => [ + [ + 'en' => [ + 'label' => 'S' + ], + 'sort_order' => 1 + ], [ + 'en' => [ + 'label' => 'M' + ], + 'sort_order' => 2 + ], [ + 'en' => [ + 'label' => 'L' + ], + 'sort_order' => 3 + ], [ + 'en' => [ + 'label' => 'XL' + ], + 'sort_order' => 4 + ] + ] + ] + ]; + + /** + * AttributeRepository object + * + * @var array + */ + protected $attribute; + + /** + * Create a new controller instance. + * + * @param Webkul\Attribute\Repositories\AttributeRepository $attribute + * @return void + */ + public function __construct(AttributeRepository $attribute) + { + $this->attribute = $attribute; + } + + public function run() + { + foreach($this->rawData as $row) { + $this->attribute->create($row); + } + } +} \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php new file mode 100644 index 000000000..6e3cff806 --- /dev/null +++ b/packages/Webkul/Attribute/src/Database/Seeders/DatabaseSeeder.php @@ -0,0 +1,19 @@ +call(AttributeTableSeeder::class); + $this->call(AttributeFamilyTableSeeder::class); + } +} diff --git a/packages/Webkul/Attribute/src/Http/Controllers/AttributeController.php b/packages/Webkul/Attribute/src/Http/Controllers/AttributeController.php index 59fa8e87d..b69307056 100644 --- a/packages/Webkul/Attribute/src/Http/Controllers/AttributeController.php +++ b/packages/Webkul/Attribute/src/Http/Controllers/AttributeController.php @@ -4,7 +4,9 @@ namespace Webkul\Attribute\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Http\Response; -use Webkul\Attribute\Models\Attribute; +use Webkul\Attribute\Repositories\AttributeRepository as Attribute; + + /** * Catalog attribute controller * @@ -19,14 +21,24 @@ class AttributeController extends Controller * @var array */ protected $_config; + + /** + * AttributeRepository object + * + * @var array + */ + protected $attribute; /** * Create a new controller instance. * + * @param Webkul\Attribute\Repositories\AttributeRepository $attribute * @return void */ - public function __construct() + public function __construct(Attribute $attribute) { + $this->attribute = $attribute; + $this->_config = request('_config'); } @@ -47,7 +59,7 @@ class AttributeController extends Controller */ public function create() { - return view($this->_config['view'], compact('roleItems')); + return view($this->_config['view']); } /** @@ -59,11 +71,11 @@ class AttributeController extends Controller { $this->validate(request(), [ 'code' => ['required', 'unique:attributes,code', new \Webkul\Core\Contracts\Validations\Slug], - 'name' => 'required', + 'admin_name' => 'required', 'type' => 'required' ]); - Attribute::create(request()->all()); + $this->attribute->create(request()->all()); session()->flash('success', 'Attribute created successfully.'); @@ -78,9 +90,9 @@ class AttributeController extends Controller */ public function edit($id) { - $role = Role::findOrFail($id); + $attribute = $this->attribute->findOrFail($id); - return view($this->_config['view'], compact('role')); + return view($this->_config['view'], compact('attribute')); } /** @@ -93,15 +105,14 @@ class AttributeController extends Controller public function update(Request $request, $id) { $this->validate(request(), [ - 'name' => 'required', - 'permission_type' => 'required', + 'code' => ['required', 'unique:attributes,code,' . $id, new \Webkul\Core\Contracts\Validations\Slug], + 'admin_name' => 'required', + 'type' => 'required' ]); - $role = Role::findOrFail($id); + $this->attribute->update(request()->all(), $id); - $role->update(request()->all()); - - session()->flash('success', 'Role updated successfully.'); + session()->flash('success', 'Attribute updated successfully.'); return redirect()->route($this->_config['redirect']); } diff --git a/packages/Webkul/Attribute/src/Http/Controllers/AttributeFamilyController.php b/packages/Webkul/Attribute/src/Http/Controllers/AttributeFamilyController.php new file mode 100644 index 000000000..f9e0e87a6 --- /dev/null +++ b/packages/Webkul/Attribute/src/Http/Controllers/AttributeFamilyController.php @@ -0,0 +1,138 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class AttributeFamilyController extends Controller +{ + /** + * Contains route related configuration + * + * @var array + */ + protected $_config; + + /** + * AttributeFamilyRepository object + * + * @var array + */ + protected $attributeFamily; + + /** + * Create a new controller instance. + * + * @param Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamily + * @return void + */ + public function __construct(AttributeFamily $attributeFamily) + { + $this->attributeFamily = $attributeFamily; + + $this->_config = request('_config'); + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for creating a new resource. + * + * @param Webkul\Attribute\Repositories\AttributeRepository $attribute + * @return \Illuminate\Http\Response + */ + public function create(Attribute $attribute) + { + $attributeFamily = $this->attributeFamily->findBy('code', 'default', ['*'], ['attribute_groups.attributes']); + + $attributes = $attribute->all(['id', 'code', 'admin_name', 'type']); + + return view($this->_config['view'], compact('attributes', 'attributeFamily')); + } + + /** + * Store a newly created resource in storage. + * + * @return \Illuminate\Http\Response + */ + public function store() + { + $this->validate(request(), [ + 'code' => ['required', 'unique:attribute_families,code', new \Webkul\Core\Contracts\Validations\Slug], + 'name' => 'required' + ]); + + $this->attributeFamily->create(request()->all()); + + session()->flash('success', 'Family created successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Show the form for editing the specified resource. + * + * @param Webkul\Attribute\Repositories\AttributeRepository $attribute + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit(Attribute $attribute, $id) + { + $attributeFamily = $this->attributeFamily->findOrFail($id, ['*'], ['attribute_groups.attributes']); + + $attributes = $attribute->all(['id', 'code', 'admin_name', 'type']); + + return view($this->_config['view'], compact('attributeFamily', 'attributes')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + $this->validate(request(), [ + 'code' => ['required', 'unique:attribute_families,code,' . $id, new \Webkul\Core\Contracts\Validations\Slug], + 'name' => 'required' + ]); + + + $this->attributeFamily->update(request()->all(), $id); + + session()->flash('success', 'Family updated successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + // + } +} \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Models/Attribute.php b/packages/Webkul/Attribute/src/Models/Attribute.php index 28fb33ab0..ead8d6c58 100644 --- a/packages/Webkul/Attribute/src/Models/Attribute.php +++ b/packages/Webkul/Attribute/src/Models/Attribute.php @@ -2,12 +2,20 @@ namespace Webkul\Attribute\Models; -use Illuminate\Database\Eloquent\Model; -use Dimsav\Translatable\Translatable; +use Webkul\Core\Eloquent\TranslatableModel; +use Webkul\Attribute\Models\AttributeOption; -class Attribute extends Model +class Attribute extends TranslatableModel { - use Translatable; - public $translatedAttributes = ['name']; + + protected $fillable = ['code', 'admin_name', 'type', 'position', 'is_required', 'is_unique', 'value_per_locale', 'value_per_channel', 'is_filterable', 'is_configurable']; + + /** + * Get the options. + */ + public function options() + { + return $this->hasMany(AttributeOption::class); + } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Models/AttributeFamily.php b/packages/Webkul/Attribute/src/Models/AttributeFamily.php index 3319ab5c5..7fea194eb 100644 --- a/packages/Webkul/Attribute/src/Models/AttributeFamily.php +++ b/packages/Webkul/Attribute/src/Models/AttributeFamily.php @@ -3,7 +3,28 @@ namespace Webkul\Attribute\Models; use Illuminate\Database\Eloquent\Model; +use Webkul\Attribute\Models\Attribute; +use Webkul\Attribute\Models\AttributeGroup; class AttributeFamily extends Model { + public $timestamps = false; + + protected $fillable = ['code', 'name']; + + /** + * Get all of the attributes for the attribute groups. + */ + public function attributes() + { + return $this->hasManyThrough(Attribute::class, AttributeGroup::class); + } + + /** + * Get all of the attribute groups. + */ + public function attribute_groups() + { + return $this->hasMany(AttributeGroup::class)->orderBy('position'); + } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Models/AttributeGroup.php b/packages/Webkul/Attribute/src/Models/AttributeGroup.php index 2b0749c84..089ad9956 100644 --- a/packages/Webkul/Attribute/src/Models/AttributeGroup.php +++ b/packages/Webkul/Attribute/src/Models/AttributeGroup.php @@ -3,7 +3,21 @@ namespace Webkul\Attribute\Models; use Illuminate\Database\Eloquent\Model; +use Webkul\Attribute\Models\Attribute; class AttributeGroup extends Model { + public $timestamps = false; + + protected $fillable = ['name', 'position', 'is_user_defined']; + + /** + * Get the attributes that owns the attribute group. + */ + public function attributes() + { + return $this->belongsToMany(Attribute::class, 'attribute_group_mappings') + ->withPivot('position') + ->orderBy('pivot_position', 'asc'); + } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Models/AttributeOption.php b/packages/Webkul/Attribute/src/Models/AttributeOption.php index 3cd69a3f4..f2683d76e 100644 --- a/packages/Webkul/Attribute/src/Models/AttributeOption.php +++ b/packages/Webkul/Attribute/src/Models/AttributeOption.php @@ -2,12 +2,23 @@ namespace Webkul\Attribute\Models; -use Illuminate\Database\Eloquent\Model; +use Webkul\Core\Eloquent\TranslatableModel; use Dimsav\Translatable\Translatable; +use Webkul\Attribute\Models\Attribute; -class AttributeOption extends Model +class AttributeOption extends TranslatableModel { - use Translatable; + public $timestamps = false; public $translatedAttributes = ['label']; + + protected $fillable = ['sort_order']; + + /** + * Get the attribute that owns the attribute option. + */ + public function attribute() + { + return $this->belongsTo(Attribute::class); + } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Providers/AttributeServiceProvider.php b/packages/Webkul/Attribute/src/Providers/AttributeServiceProvider.php index 51a8ea23e..b7f1ee95b 100644 --- a/packages/Webkul/Attribute/src/Providers/AttributeServiceProvider.php +++ b/packages/Webkul/Attribute/src/Providers/AttributeServiceProvider.php @@ -3,7 +3,6 @@ namespace Webkul\Attribute\Providers; use Illuminate\Support\ServiceProvider; -use Illuminate\Foundation\AliasLoader; use Illuminate\Routing\Router; class AttributeServiceProvider extends ServiceProvider diff --git a/packages/Webkul/Attribute/src/Repositories/AttributeFamilyRepository.php b/packages/Webkul/Attribute/src/Repositories/AttributeFamilyRepository.php new file mode 100644 index 000000000..337845ae5 --- /dev/null +++ b/packages/Webkul/Attribute/src/Repositories/AttributeFamilyRepository.php @@ -0,0 +1,143 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class AttributeFamilyRepository extends Repository +{ + /** + * AttributeRepository object + * + * @var array + */ + protected $attribute; + + /** + * AttributeGroupRepository object + * + * @var array + */ + protected $attributeGroup; + + /** + * Create a new controller instance. + * + * @param Webkul\Attribute\Repositories\AttributeRepository $attribute + * @param Webkul\Attribute\Repositories\AttributeGroupRepository $attributeGroup + * @return void + */ + public function __construct(AttributeRepository $attribute, AttributeGroupRepository $attributeGroup, App $app) + { + $this->attribute = $attribute; + + $this->attributeGroup = $attributeGroup; + + parent::__construct($app); + } + + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\Attribute\Models\AttributeFamily'; + } + + /** + * @param array $data + * @return mixed + */ + public function create(array $data) + { + $attributeGroups = isset($data['attribute_groups']) ? $data['attribute_groups'] : []; + unset($data['attribute_groups']); + $family = $this->model->create($data); + + foreach ($attributeGroups as $group) { + $attributes = isset($group['attributes']) ? $group['attributes'] : []; + unset($group['attributes']); + $attributeGroup = $family->attribute_groups()->create($group); + + foreach ($attributes as $attribute) { + if(isset($attribute['id'])) { + $attributeGroup->attributes()->attach($attribute['id']); + } else { + $attributeModel = $this->attribute->findBy('code', $attribute['code']); + $attributeGroup->attributes()->save($attributeModel, ['position' => $attribute['position']]); + } + } + } + + return $family; + } + + /** + * @param array $data + * @param $id + * @param string $attribute + * @return mixed + */ + public function update(array $data, $id, $attribute = "id") + { + $family = $this->findOrFail($id); + + $family->update($data); + + $previousAttributeGroupIds = $family->attribute_groups()->pluck('id'); + + if(isset($data['attribute_groups'])) { + foreach ($data['attribute_groups'] as $attributeGroupId => $attributeGroupInputs) { + if (str_contains($attributeGroupId, 'group_')) { + $attributeGroup = $family->attribute_groups()->create($attributeGroupInputs); + + if(isset($attributeGroupInputs['attributes'])) { + foreach ($attributeGroupInputs['attributes'] as $attribute) { + $attributeGroup->attributes()->attach($attribute['id']); + } + } + } else { + if(is_numeric($index = $previousAttributeGroupIds->search($attributeGroupId))) { + $previousAttributeGroupIds->forget($index); + } + + $attributeGroup = $this->attributeGroup->findOrFail($attributeGroupId); + $attributeGroup->update($attributeGroupInputs); + + $attributeIds = $attributeGroup->attributes()->get()->pluck('id'); + + if(isset($attributeGroupInputs['attributes'])) { + foreach ($attributeGroupInputs['attributes'] as $attribute) { + if(is_numeric($index = $attributeIds->search($attribute['id']))) { + $attributeIds->forget($index); + } else { + $attributeGroup->attributes()->attach($attribute['id']); + } + } + } + + if($attributeIds->count()) { + $attributeGroup->detach($attributeIds); + } + } + } + } + + foreach ($previousAttributeGroupIds as $attributeGroupId) { + $this->attributeGroup->delete($attributeGroupId); + } + + return $family; + } +} \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Repositories/AttributeGroupRepository.php b/packages/Webkul/Attribute/src/Repositories/AttributeGroupRepository.php new file mode 100644 index 000000000..414a897ad --- /dev/null +++ b/packages/Webkul/Attribute/src/Repositories/AttributeGroupRepository.php @@ -0,0 +1,25 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class AttributeGroupRepository extends Repository +{ + + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\Attribute\Models\AttributeGroup'; + } +} \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Repositories/AttributeOptionRepository.php b/packages/Webkul/Attribute/src/Repositories/AttributeOptionRepository.php new file mode 100644 index 000000000..4fe90a524 --- /dev/null +++ b/packages/Webkul/Attribute/src/Repositories/AttributeOptionRepository.php @@ -0,0 +1,25 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class AttributeOptionRepository extends Repository +{ + + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\Attribute\Models\AttributeOption'; + } +} \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Repositories/AttributeRepository.php b/packages/Webkul/Attribute/src/Repositories/AttributeRepository.php new file mode 100644 index 000000000..69abd8747 --- /dev/null +++ b/packages/Webkul/Attribute/src/Repositories/AttributeRepository.php @@ -0,0 +1,102 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class AttributeRepository extends Repository +{ + /** + * AttributeOptionRepository object + * + * @var array + */ + protected $attributeOption; + + /** + * Create a new controller instance. + * + * @param Webkul\Attribute\Repositories\AttributeOptionRepository $attributeOption + * @return void + */ + public function __construct(AttributeOptionRepository $attributeOption, App $app) + { + $this->attributeOption = $attributeOption; + + parent::__construct($app); + } + + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\Attribute\Models\Attribute'; + } + + /** + * @param array $data + * @return mixed + */ + public function create(array $data) + { + $options = isset($data['options']) ? $data['options'] : []; + unset($data['options']); + $attribute = $this->model->create($data); + + if(in_array($attribute->type, ['select', 'multiselect', 'checkbox']) && count($options)) { + foreach ($options as $option) { + $attribute->options()->create($option); + } + } + + return $attribute; + } + + /** + * @param array $data + * @param $id + * @param string $attribute + * @return mixed + */ + public function update(array $data, $id, $attribute = "id") + { + $attribute = $this->findOrFail($id); + + $attribute->update($data); + + $previousOptionIds = $attribute->options()->pluck('id'); + + if(in_array($attribute->code, ['select', 'multiselect', 'checkbox'])) { + if(isset($data['options'])) { + foreach ($data['options'] as $optionId => $optionInputs) { + if (str_contains($optionId, 'option_')) { + $attribute->options()->create($optionInputs); + } else { + if(is_numeric($index = $previousOptionIds->search($optionId))) { + $previousOptionIds->forget($index); + } + + $this->attributeOption->update($optionInputs, $optionId); + } + } + } + } + + foreach ($previousOptionIds as $optionId) { + $this->attributeOption->delete($optionId); + } + + return $attribute; + } +} \ No newline at end of file diff --git a/packages/Webkul/Category/composer.json b/packages/Webkul/Category/composer.json index 9f9bab1ce..d908fa123 100644 --- a/packages/Webkul/Category/composer.json +++ b/packages/Webkul/Category/composer.json @@ -7,16 +7,18 @@ "email": "jitendra@webkul.com" } ], - "require": {}, + "require": { + "baum/baum": "~1.1" + }, "autoload": { "psr-4": { - "Webkul\\Attribute\\": "src/" + "Webkul\\Category\\": "src/" } }, "extra": { "laravel": { "providers": [ - "Webkul\\Attribute\\Providers\\AttributeServiceProvider" + "Webkul\\Category\\Providers\\CategoryServiceProvider" ], "aliases": { } } diff --git a/packages/Webkul/Category/src/Database/Migrations/2018_07_05_142820_create_categories_table.php b/packages/Webkul/Category/src/Database/Migrations/2018_07_05_142820_create_categories_table.php index 7d4f5e200..d1bfafbe0 100644 --- a/packages/Webkul/Category/src/Database/Migrations/2018_07_05_142820_create_categories_table.php +++ b/packages/Webkul/Category/src/Database/Migrations/2018_07_05_142820_create_categories_table.php @@ -3,6 +3,7 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; +use Kalnoy\Nestedset\NestedSet; class CreateCategoriesTable extends Migration { @@ -15,10 +16,10 @@ class CreateCategoriesTable extends Migration { Schema::create('categories', function (Blueprint $table) { $table->increments('id'); - $table->string('code')->unique(); - $table->integer('position'); - $table->integer('parent_id')->unsigned()->nullable(); - $table->foreign('parent_id')->references('id')->on('categories')->onDelete('cascade'); + $table->integer('position')->default(0); + $table->string('image')->nullable(); + $table->boolean('status')->default(0); + NestedSet::columns($table); $table->timestamps(); }); } diff --git a/packages/Webkul/Category/src/Database/Migrations/2018_07_21_142836_create_category_translations_table.php b/packages/Webkul/Category/src/Database/Migrations/2018_07_21_142836_create_category_translations_table.php new file mode 100644 index 000000000..94a80774f --- /dev/null +++ b/packages/Webkul/Category/src/Database/Migrations/2018_07_21_142836_create_category_translations_table.php @@ -0,0 +1,40 @@ +increments('id'); + $table->text('name'); + $table->string('slug'); + $table->text('description')->nullable(); + $table->text('meta_title')->nullable(); + $table->text('meta_description')->nullable(); + $table->text('meta_keywords')->nullable(); + $table->integer('category_id')->unsigned(); + $table->string('locale'); + $table->unique(['category_id', 'slug', 'locale']); + $table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('category_translations'); + } +} \ No newline at end of file diff --git a/packages/Webkul/Category/src/Http/Controllers/CategoryController.php b/packages/Webkul/Category/src/Http/Controllers/CategoryController.php new file mode 100644 index 000000000..661c78df6 --- /dev/null +++ b/packages/Webkul/Category/src/Http/Controllers/CategoryController.php @@ -0,0 +1,136 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CategoryController extends Controller +{ + /** + * Contains route related configuration + * + * @var array + */ + protected $_config; + + /** + * CategoryRepository object + * + * @var array + */ + protected $category; + + /** + * Create a new controller instance. + * + * @param Webkul\Category\Repositories\CategoryRepository $category + * @return void + */ + public function __construct(Category $category) + { + $this->category = $category; + + $this->_config = request('_config'); + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + $categories = $this->category->getCategoryTree(null, ['id']); + + return view($this->_config['view'], compact('categories')); + } + + /** + * Store a newly created resource in storage. + * + * @return \Illuminate\Http\Response + */ + public function store() + { + $this->validate(request(), [ + 'slug' => ['required', 'unique:category_translations,slug', new \Webkul\Core\Contracts\Validations\Slug], + 'name' => 'required' + ]); + + $this->category->create(request()->all()); + + session()->flash('success', 'Category created successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + $categories = $this->category->getCategoryTree($id); + + $category = $this->category->findOrFail($id); + + return view($this->_config['view'], compact('category', 'categories')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + $locale = request()->get('channel_locale') ?: channel()->getDefaultChannelLocaleCode(); + $this->validate(request(), [ + $locale . '.slug' => ['required', new \Webkul\Core\Contracts\Validations\Slug, function ($attribute, $value, $fail) use ($id) { + if (!$this->category->isSlugUnique($id, $value)) { + $fail('The :attribute has already been taken.'); + } + }], + $locale . '.name' => 'required', + ]); + + $this->category->update(request()->all(), $id); + + session()->flash('success', 'Category updated successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + // + } +} \ No newline at end of file diff --git a/packages/Webkul/Category/src/Http/Controllers/Controller.php b/packages/Webkul/Category/src/Http/Controllers/Controller.php new file mode 100644 index 000000000..3b01976a2 --- /dev/null +++ b/packages/Webkul/Category/src/Http/Controllers/Controller.php @@ -0,0 +1,13 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CategoryRepository extends Repository +{ + /** + * Create a new controller instance. + * + * @return void + */ + public function __construct(App $app) + { + parent::__construct($app); + } + + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\Category\Models\Category'; + } + + /** + * @param array $data + * @return mixed + */ + public function create(array $data) + { + if(isset($data['locale']) && $data['locale'] == 'all') { + $model = app()->make($this->model()); + + $channels = channel()->getChannelWithLocales(); + + foreach($channels as $channel) { + foreach($channel->locales as $locale) { + foreach ($model->translatedAttributes as $attribute) { + if(isset($data[$attribute])) { + $data[$channel->code . '.' . $locale->code][$attribute] = $data[$attribute]; + } + } + } + } + } + + return $this->model->create($data); + } + + /** + * Specify category tree + * + * @return mixed + */ + public function getCategoryTree($id = null) { + return $id + ? Category::orderBy('position', 'ASC')->where('id', '!=', $id)->get()->toTree() + : Category::orderBy('position', 'ASC')->get()->toTree(); + } + + /** + * Checks slug is unique or not based on locale + * + * @return boolean + */ + public function isSlugUnique($id, $slug) { + return CategoryTranslation::where('category_id', '!=', $id)->where('slug', '=', $slug)->first() ? false : true; + } +} \ No newline at end of file diff --git a/packages/Webkul/Channel/.gitignore b/packages/Webkul/Channel/.gitignore new file mode 100644 index 000000000..30bc16279 --- /dev/null +++ b/packages/Webkul/Channel/.gitignore @@ -0,0 +1 @@ +/node_modules \ No newline at end of file diff --git a/packages/Webkul/Channel/composer.json b/packages/Webkul/Channel/composer.json new file mode 100644 index 000000000..a3dce6314 --- /dev/null +++ b/packages/Webkul/Channel/composer.json @@ -0,0 +1,27 @@ +{ + "name": "webkul/laravel-channel", + "license": "MIT", + "authors": [ + { + "name": "Jitendra Singh", + "email": "jitendra@webkul.com" + } + ], + "require": { + "baum/baum": "~1.1" + }, + "autoload": { + "psr-4": { + "Webkul\\Channel\\": "src/" + } + }, + "extra": { + "laravel": { + "providers": [ + "Webkul\\Channel\\Providers\\ChannelServiceProvider" + ], + "aliases": { } + } + }, + "minimum-stability": "dev" +} diff --git a/packages/Webkul/Channel/src/Channel.php b/packages/Webkul/Channel/src/Channel.php new file mode 100644 index 000000000..5d60ad63c --- /dev/null +++ b/packages/Webkul/Channel/src/Channel.php @@ -0,0 +1,27 @@ +locales()->count()) + return; + + return $channel->code . '-' . $channel->locales()->first()->code; + } + + public function getDefaultChannelLocale() { + $channel = ChannelModel::first(); + + return $channel->locales()->first(); + } + + public function getChannelWithLocales() { + return ChannelModel::with('locales')->get(); + } +} \ No newline at end of file diff --git a/packages/Webkul/Channel/src/Database/Migrations/2018_07_20_064849_create_channels_table.php b/packages/Webkul/Channel/src/Database/Migrations/2018_07_20_064849_create_channels_table.php new file mode 100644 index 000000000..fbce101a6 --- /dev/null +++ b/packages/Webkul/Channel/src/Database/Migrations/2018_07_20_064849_create_channels_table.php @@ -0,0 +1,56 @@ +increments('id'); + $table->string('code'); + $table->string('name'); + $table->text('description')->nullable(); + $table->integer('default_locale')->unsigned(); + $table->integer('base_currency')->unsigned(); + $table->foreign('default_locale')->references('id')->on('locales')->onDelete('cascade'); + $table->foreign('base_currency')->references('id')->on('currencies')->onDelete('cascade'); + $table->timestamps(); + }); + + Schema::create('channel_locales', function (Blueprint $table) { + $table->integer('channel_id')->unsigned(); + $table->integer('locale_id')->unsigned(); + $table->primary(['channel_id', 'locale_id']); + $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade'); + $table->foreign('locale_id')->references('id')->on('locales')->onDelete('cascade'); + }); + + Schema::create('channel_currencies', function (Blueprint $table) { + $table->integer('channel_id')->unsigned(); + $table->integer('currency_id')->unsigned(); + $table->primary(['channel_id', 'currency_id']); + $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade'); + $table->foreign('currency_id')->references('id')->on('currencies')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('channels'); + + Schema::dropIfExists('channel_currencies'); + } +} diff --git a/packages/Webkul/Channel/src/Facades/Channel.php b/packages/Webkul/Channel/src/Facades/Channel.php new file mode 100644 index 000000000..e8e7ec817 --- /dev/null +++ b/packages/Webkul/Channel/src/Facades/Channel.php @@ -0,0 +1,18 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class ChannelController extends Controller +{ + /** + * Contains route related configuration + * + * @var array + */ + protected $_config; + + /** + * ChannelRepository object + * + * @var array + */ + protected $channel; + + /** + * Create a new controller instance. + * + * @param Webkul\Channel\Repositories\ChannelRepository $channel + * @return void + */ + public function __construct(Channel $channel) + { + $this->channel = $channel; + + $this->_config = request('_config'); + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view($this->_config['view']); + } + + /** + * Store a newly created resource in storage. + * + * @return \Illuminate\Http\Response + */ + public function store() + { + $this->validate(request(), [ + 'code' => ['required', 'unique:channels,code', new \Webkul\Core\Contracts\Validations\Code], + 'name' => 'required', + 'locales' => 'required|array|min:1', + 'default_locale' => 'required', + 'currencies' => 'required|array|min:1', + 'base_currency' => 'required' + ]); + + + $this->channel->create(request()->all()); + + session()->flash('success', 'Channel created successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + $channel = $this->channel->findOrFail($id, ['*'], ['locales', 'currencies']); + + return view($this->_config['view'], compact('channel')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + $this->validate(request(), [ + 'code' => ['required', 'unique:channels,code,' . $id, new \Webkul\Core\Contracts\Validations\Code], + 'name' => 'required', + 'locales' => 'required|array|min:1', + 'default_locale' => 'required', + 'currencies' => 'required|array|min:1', + 'base_currency' => 'required' + ]); + + $this->channel->update(request()->all(), $id); + + session()->flash('success', 'Channel updated successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + // + } +} \ No newline at end of file diff --git a/packages/Webkul/Channel/src/Http/Controllers/Controller.php b/packages/Webkul/Channel/src/Http/Controllers/Controller.php new file mode 100644 index 000000000..302f9bdce --- /dev/null +++ b/packages/Webkul/Channel/src/Http/Controllers/Controller.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/packages/Webkul/Channel/src/Models/Channel.php b/packages/Webkul/Channel/src/Models/Channel.php new file mode 100644 index 000000000..efe225855 --- /dev/null +++ b/packages/Webkul/Channel/src/Models/Channel.php @@ -0,0 +1,44 @@ +belongsToMany(Locale::class, 'channel_locales'); + } + + /** + * Get the default locale + */ + public function default_locale() + { + return $this->belongsTo(Locale::class); + } + + /** + * Get the channel locales. + */ + public function currencies() + { + return $this->belongsToMany(Currency::class, 'channel_currencies'); + } + + /** + * Get the base currency + */ + public function base_currency() + { + return $this->belongsTo(Currency::class); + } +} \ No newline at end of file diff --git a/packages/Webkul/Channel/src/Providers/ChannelServiceProvider.php b/packages/Webkul/Channel/src/Providers/ChannelServiceProvider.php new file mode 100644 index 000000000..64e78a74f --- /dev/null +++ b/packages/Webkul/Channel/src/Providers/ChannelServiceProvider.php @@ -0,0 +1,49 @@ +loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); + } + + /** + * Register services. + * + * @return void + */ + public function register() + { + $this->registerChannelFacade(); + } + + /** + * Register Bouncer as a singleton. + * + * @return void + */ + protected function registerChannelFacade() + { + $loader = AliasLoader::getInstance(); + $loader->alias('channel', ChannelFacade::class); + + $this->app->singleton('channel', function () { + return new Channel(); + }); + } +} \ No newline at end of file diff --git a/packages/Webkul/Channel/src/Repositories/ChannelRepository.php b/packages/Webkul/Channel/src/Repositories/ChannelRepository.php new file mode 100644 index 000000000..897109110 --- /dev/null +++ b/packages/Webkul/Channel/src/Repositories/ChannelRepository.php @@ -0,0 +1,85 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class ChannelRepository extends Repository +{ + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\Channel\Models\Channel'; + } + + /** + * @param array $data + * @return mixed + */ + public function create(array $data) + { + $channel = $this->model->create($data); + + foreach ($data['locales'] as $locale) { + $channel->locales()->attach($locale); + } + + foreach ($data['currencies'] as $currency) { + $channel->currencies()->attach($currency); + } + + return $channel; + } + + /** + * @param array $data + * @param $id + * @param string $attribute + * @return mixed + */ + public function update(array $data, $id, $attribute = "id") + { + $channel = $this->findOrFail($id); + + $channel->update($data); + + $previousLocaleIds = $channel->locales()->pluck('id'); + + foreach ($data['locales'] as $locale) { + if(is_numeric($index = $previousLocaleIds->search($locale))) { + $previousLocaleIds->forget($index); + } else { + $channel->locales()->attach($locale); + } + } + + if($previousLocaleIds->count()) { + $channel->locales()->detach($previousLocaleIds); + } + + $previousCurrencyIds = $channel->currencies()->pluck('id'); + foreach ($data['currencies'] as $currency) { + if(is_numeric($index = $previousCurrencyIds->search($currency))) { + $previousCurrencyIds->forget($index); + } else { + $channel->currencies()->attach($currency); + } + } + + if($previousCurrencyIds->count()) { + $channel->currencies()->detach($previousCurrencyIds); + } + + return $channel; + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Contracts/RepositoryInterface.php b/packages/Webkul/Core/src/Contracts/RepositoryInterface.php index a1b90aa4f..a9b283bee 100644 --- a/packages/Webkul/Core/src/Contracts/RepositoryInterface.php +++ b/packages/Webkul/Core/src/Contracts/RepositoryInterface.php @@ -21,6 +21,8 @@ interface RepositoryInterface { public function delete($id); public function find($id, $columns = ['*']); + + public function findOrFail($id, $columns = ['*']); public function findBy($field, $value, $columns = ['*']); diff --git a/packages/Webkul/Core/src/Contracts/Validations/Code.php b/packages/Webkul/Core/src/Contracts/Validations/Code.php new file mode 100644 index 000000000..1a232803b --- /dev/null +++ b/packages/Webkul/Core/src/Contracts/Validations/Code.php @@ -0,0 +1,30 @@ +increments('id'); + $table->string('code'); + $table->string('name'); + $table->boolean('status')->default(0); $table->timestamps(); }); } @@ -26,6 +29,6 @@ class CreateCategoryNameTranslationTable extends Migration */ public function down() { - Schema::dropIfExists('category_name_translation'); + Schema::dropIfExists('countries'); } } diff --git a/packages/Webkul/Category/src/Database/Migrations/2018_07_05_142851_create_category_description_translations_table.php b/packages/Webkul/Core/src/Database/Migrations/2018_07_20_054502_create_currencies_table.php similarity index 62% rename from packages/Webkul/Category/src/Database/Migrations/2018_07_05_142851_create_category_description_translations_table.php rename to packages/Webkul/Core/src/Database/Migrations/2018_07_20_054502_create_currencies_table.php index 521516390..010961fff 100644 --- a/packages/Webkul/Category/src/Database/Migrations/2018_07_05_142851_create_category_description_translations_table.php +++ b/packages/Webkul/Core/src/Database/Migrations/2018_07_20_054502_create_currencies_table.php @@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; -class CreateCategoryDescriptionTranslationsTable extends Migration +class CreateCurrenciesTable extends Migration { /** * Run the migrations. @@ -13,8 +13,11 @@ class CreateCategoryDescriptionTranslationsTable extends Migration */ public function up() { - Schema::create('category_description_translations', function (Blueprint $table) { + Schema::create('currencies', function (Blueprint $table) { $table->increments('id'); + $table->string('code'); + $table->string('symbol'); + $table->string('name'); $table->timestamps(); }); } @@ -26,6 +29,6 @@ class CreateCategoryDescriptionTranslationsTable extends Migration */ public function down() { - Schema::dropIfExists('category_description_translations'); + Schema::dropIfExists('currencies'); } } diff --git a/packages/Webkul/Core/src/Database/Migrations/2018_07_20_054542_create_currency_exchange_rates_table.php b/packages/Webkul/Core/src/Database/Migrations/2018_07_20_054542_create_currency_exchange_rates_table.php new file mode 100644 index 000000000..4dc944fc3 --- /dev/null +++ b/packages/Webkul/Core/src/Database/Migrations/2018_07_20_054542_create_currency_exchange_rates_table.php @@ -0,0 +1,36 @@ +increments('id'); + $table->integer('source_currency')->unsigned(); + $table->integer('target_currency')->unsigned(); + $table->decimal('ratio', 10, 5); + $table->foreign('source_currency')->references('id')->on('currencies')->onDelete('cascade'); + $table->foreign('target_currency')->references('id')->on('currencies')->onDelete('cascade'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('currency_exchange_rates'); + } +} diff --git a/packages/Webkul/Core/src/Database/Seeders/LocalesTableSeeder.php b/packages/Webkul/Core/src/Database/Seeders/LocalesTableSeeder.php index fa33dcc31..f4f0d4e90 100644 --- a/packages/Webkul/Core/src/Database/Seeders/LocalesTableSeeder.php +++ b/packages/Webkul/Core/src/Database/Seeders/LocalesTableSeeder.php @@ -13,5 +13,10 @@ class LocalesTableSeeder extends Seeder $locale->code = 'en'; $locale->name = 'English'; $locale->save(); + + $locale = new Locale(); + $locale->code = 'fr'; + $locale->name = 'French'; + $locale->save(); } } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Eloquent/Repository.php b/packages/Webkul/Core/src/Eloquent/Repository.php index d3eabc4a2..3b82486cf 100644 --- a/packages/Webkul/Core/src/Eloquent/Repository.php +++ b/packages/Webkul/Core/src/Eloquent/Repository.php @@ -30,7 +30,8 @@ abstract class Repository implements RepositoryInterface { * @param App $app * @throws \Webkul\Core\Exceptions\RepositoryException */ - public function __construct(App $app) { + public function __construct(App $app) + { $this->app = $app; $this->makeModel(); @@ -47,25 +48,28 @@ abstract class Repository implements RepositoryInterface { * @param array $columns * @return mixed */ - public function all($columns = ['*']) { - return $this->model->get($columns); + public function all($columns = ['*'], $with = []) + { + return $this->resetScope()->model->with($with)->get($columns); } - + /** * @param int $perPage * @param array $columns * @return mixed */ - public function paginate($perPage = 1, $columns = ['*']) { - return $this->model->paginate($perPage, $columns); + public function paginate($perPage = 1, $columns = ['*']) + { + return $this->resetScope()->model->paginate($perPage, $columns); } /** * @param array $data * @return mixed */ - public function create(array $data) { - return $this->model->create($data); + public function create(array $data) + { + return $this->resetScope()->model->create($data); } /** @@ -74,16 +78,28 @@ abstract class Repository implements RepositoryInterface { * @param string $attribute * @return mixed */ - public function update(array $data, $id, $attribute="id") { - return $this->model->where($attribute, '=', $id)->update($data); + public function update(array $data, $id, $attribute = "id") + { + return $this->resetScope()->model->where($attribute, '=', $id)->first()->update($data); } /** * @param $id * @return mixed */ - public function delete($id) { - return $this->model->destroy($id); + public function delete($id) + { + return $this->resetScope()->find($id)->delete(); + } + + /** + * @param $id + * @param array $columns->with($with) + * @return mixed + */ + public function find($id, $columns = ['*'], $with = []) + { + return $this->resetScope()->model->with($with)->find($id, $columns); } /** @@ -91,8 +107,9 @@ abstract class Repository implements RepositoryInterface { * @param array $columns * @return mixed */ - public function find($id, $columns = ['*']) { - return $this->model->find($id, $columns); + public function findOrFail($id, $columns = ['*'], $with = []) + { + return $this->resetScope()->model->with($with)->findOrFail($id, $columns); } /** @@ -101,15 +118,17 @@ abstract class Repository implements RepositoryInterface { * @param array $columns * @return mixed */ - public function findBy($attribute, $value, $columns = ['*']) { - return $this->model->where($attribute, '=', $value)->first($columns); + public function findBy($attribute, $value, $columns = ['*'], $with = []) + { + return $this->resetScope()->model->with($with)->where($attribute, '=', $value)->first($columns); } /** * @return \Illuminate\Database\Eloquent\Builder * @throws RepositoryException */ - public function makeModel() { + public function makeModel() + { $model = $this->app->make($this->model()); if (!$model instanceof Model) @@ -117,4 +136,13 @@ abstract class Repository implements RepositoryInterface { return $this->model = $model->newQuery(); } + + /** + * @return $this + */ + public function resetScope() { + $this->makeModel(); + + return $this; + } } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Eloquent/TranslatableModel.php b/packages/Webkul/Core/src/Eloquent/TranslatableModel.php new file mode 100644 index 000000000..76536e397 --- /dev/null +++ b/packages/Webkul/Core/src/Eloquent/TranslatableModel.php @@ -0,0 +1,63 @@ + 1) { + if(Locale::where('code', '=', end($chunks))->first()) + return true; + } elseif(Locale::where('code', '=', $key)->first()) { + return true; + } + + return false; + } + + /** + * @return string + */ + protected function locale() + { + if($this->isChannelBased()) { + return channel()->getDefaultChannelLocaleCode(); + } else { + if ($this->defaultLocale) { + return $this->defaultLocale; + } + + return config('translatable.locale') + ?: app()->make('translator')->getLocale(); + } + } + + /** + * @return boolean + */ + protected function isChannelBased() + { + return false; + } + + /** + * @return string + */ + protected function getLocaleSeparator() + { + return config('translatable.locale_separator', '%'); + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Facades/Core.php b/packages/Webkul/Core/src/Facades/Core.php new file mode 100644 index 000000000..b1ae6af34 --- /dev/null +++ b/packages/Webkul/Core/src/Facades/Core.php @@ -0,0 +1,18 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CountryController extends Controller +{ + /** + * Contains route related configuration + * + * @var array + */ + protected $_config; + + /** + * Create a new controller instance. + * + * @return void + */ + public function __construct() + { + $this->_config = request('_config'); + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view($this->_config['view']); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request) + { + $this->validate(request(), [ + 'code' => 'required|unique:countries,code', + 'name' => 'required' + ]); + + Country::create(request(['code','name'])); + + session()->flash('success', 'Country created successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + // + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Http/Controllers/CurrencyController.php b/packages/Webkul/Core/src/Http/Controllers/CurrencyController.php new file mode 100644 index 000000000..688ddcae6 --- /dev/null +++ b/packages/Webkul/Core/src/Http/Controllers/CurrencyController.php @@ -0,0 +1,95 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CurrencyController extends Controller +{ + /** + * Contains route related configuration + * + * @var array + */ + protected $_config; + + /** + * CurrencyRepository object + * + * @var array + */ + protected $currency; + + /** + * Create a new controller instance. + * + * @param Webkul\Core\Repositories\CurrencyRepository $currency + * @return void + */ + public function __construct(Currency $currency) + { + $this->currency = $currency; + + $this->_config = request('_config'); + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view($this->_config['view']); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request) + { + $this->validate(request(), [ + 'code' => 'required|unique:countries,code', + 'name' => 'required', + 'symbol' => 'required' + ]); + + $this->currency->create(request()->all()); + + session()->flash('success', 'Currency created successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + // + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Http/Controllers/ExchangeRateController.php b/packages/Webkul/Core/src/Http/Controllers/ExchangeRateController.php new file mode 100644 index 000000000..26680de50 --- /dev/null +++ b/packages/Webkul/Core/src/Http/Controllers/ExchangeRateController.php @@ -0,0 +1,150 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class ExchangeRateController extends Controller +{ + /** + * Contains route related configuration + * + * @var array + */ + protected $_config; + + /** + * ExchangeRateRepository object + * + * @var array + */ + protected $exchangeRate; + + /** + * CurrencyRepository object + * + * @var array + */ + protected $currency; + + /** + * Create a new controller instance. + * + * @param Webkul\Core\Repositories\ExchangeRateRepository $exchangeRate + * @param Webkul\Core\Repositories\CurrencyRepository $currency + * @return void + */ + public function __construct(ExchangeRate $exchangeRate, Currency $currency) + { + $this->exchangeRate = $exchangeRate; + + $this->currency = $currency; + + $this->_config = request('_config'); + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + $currencies = $this->currency->all(); + + return view($this->_config['view'], compact('currencies')); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request) + { + $sourceCurrency = request()->get('source_currency'); + $this->validate(request(), [ + 'source_currency' => 'required', + 'target_currency' => ['required', function ($attribute, $value, $fail) use ($sourceCurrency) { + if ($value == $sourceCurrency) { + $fail('The :attribute value should be different from source currency.'); + } + }], + 'ratio' => 'required|numeric' + ]); + + $this->exchangeRate->create(request()->all()); + + session()->flash('success', 'Exchange rate created successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + $currencies = $this->currency->all(); + + $exchangeRate = $this->exchangeRate->findOrFail($id); + + return view($this->_config['view'], compact('currencies', 'exchangeRate')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + $this->validate(request(), [ + 'source_currency' => 'required', + 'target_currency' => 'required', + 'ratio' => 'required|numeric' + ]); + + $this->exchangeRate->update(request()->all(), $id); + + session()->flash('success', 'Exchange rate updated successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + // + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Http/Middleware/Locale.php b/packages/Webkul/Core/src/Http/Middleware/Locale.php new file mode 100644 index 000000000..b01e175b5 --- /dev/null +++ b/packages/Webkul/Core/src/Http/Middleware/Locale.php @@ -0,0 +1,41 @@ +locale = $locale; + } + + /** + * Handle an incoming request. + * + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @return mixed + */ + public function handle($request, Closure $next) + { + if($locale = $request->get('locale')) { + if($this->locale->findBy('code', $locale)) { + // app()->setLocale($locale); + } + } + + return $next($request); + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Http/helpers.php b/packages/Webkul/Core/src/Http/helpers.php new file mode 100644 index 000000000..1f8f52fb4 --- /dev/null +++ b/packages/Webkul/Core/src/Http/helpers.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/packages/Webkul/Core/src/Models/Country.php b/packages/Webkul/Core/src/Models/Country.php new file mode 100644 index 000000000..02dfe326b --- /dev/null +++ b/packages/Webkul/Core/src/Models/Country.php @@ -0,0 +1,17 @@ +loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); $this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'core'); + $router->aliasMiddleware('locale', Locale::class); + $this->publishes([ __DIR__ . '/../../publishable/lang' => public_path('vendor/webkul/core/lang'), ], 'public'); Validator::extend('slug', 'Webkul\Core\Contracts\Validations\Slug@passes'); + + Validator::extend('code', 'Webkul\Core\Contracts\Validations\Code@passes'); } /** @@ -34,5 +43,21 @@ class CoreServiceProvider extends ServiceProvider */ public function register() { + $this->registerCoreFacade(); + } + + /** + * Register Bouncer as a singleton. + * + * @return void + */ + protected function registerCoreFacade() + { + $loader = AliasLoader::getInstance(); + $loader->alias('core', CoreFacade::class); + + $this->app->singleton('core', function () { + return new Core(); + }); } } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Repositories/CountryRepository.php b/packages/Webkul/Core/src/Repositories/CountryRepository.php new file mode 100644 index 000000000..fc6209aea --- /dev/null +++ b/packages/Webkul/Core/src/Repositories/CountryRepository.php @@ -0,0 +1,24 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CountryRepository extends Repository +{ + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\Core\Models\Country'; + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Repositories/CurrencyRepository.php b/packages/Webkul/Core/src/Repositories/CurrencyRepository.php new file mode 100644 index 000000000..a60a694bf --- /dev/null +++ b/packages/Webkul/Core/src/Repositories/CurrencyRepository.php @@ -0,0 +1,24 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CurrencyRepository extends Repository +{ + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\Core\Models\Currency'; + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Repositories/ExchangeRateRepository.php b/packages/Webkul/Core/src/Repositories/ExchangeRateRepository.php new file mode 100644 index 000000000..7b61f7745 --- /dev/null +++ b/packages/Webkul/Core/src/Repositories/ExchangeRateRepository.php @@ -0,0 +1,24 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class ExchangeRateRepository extends Repository +{ + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\Core\Models\CurrencyExchangeRate'; + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Repositories/LocaleRepository.php b/packages/Webkul/Core/src/Repositories/LocaleRepository.php new file mode 100644 index 000000000..4be975f5d --- /dev/null +++ b/packages/Webkul/Core/src/Repositories/LocaleRepository.php @@ -0,0 +1,24 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class LocaleRepository extends Repository +{ + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\Core\Models\Locale'; + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Resources/lang/en/validation.php b/packages/Webkul/Core/src/Resources/lang/en/validation.php index 12efc8886..afd198201 100644 --- a/packages/Webkul/Core/src/Resources/lang/en/validation.php +++ b/packages/Webkul/Core/src/Resources/lang/en/validation.php @@ -1,5 +1,6 @@ 'The :attribute must be valid slug.' + 'slug' => 'The :attribute must be valid slug.', + 'code' => 'The :attribute must be valid.' ]; \ No newline at end of file diff --git a/packages/Webkul/Customer/src/Database/migrations/2018_07_27_060133_add_remember_token_in_customers_table.php b/packages/Webkul/Customer/src/Database/migrations/2018_07_27_060133_add_remember_token_in_customers_table.php new file mode 100644 index 000000000..8e05749b0 --- /dev/null +++ b/packages/Webkul/Customer/src/Database/migrations/2018_07_27_060133_add_remember_token_in_customers_table.php @@ -0,0 +1,30 @@ +rememberToken(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} diff --git a/packages/Webkul/Customer/src/Http/routes.php b/packages/Webkul/Customer/src/Http/routes.php index f2cf0cab7..13e02d5cf 100644 --- a/packages/Webkul/Customer/src/Http/routes.php +++ b/packages/Webkul/Customer/src/Http/routes.php @@ -26,7 +26,7 @@ Route::group(['middleware' => ['web']], function () { Route::group(['middleware' => ['customer']], function () { //route for logout which will be under the auth guard of the customer by default - Route::get('/logout', 'Webkul\Customer\Http\Controllers\SessionController@logout')->defaults('_config', [ + Route::get('/logout', 'Webkul\Customer\Http\Controllers\SessionController@destroy')->defaults('_config', [ 'redirect' => 'customer.session.index' ])->name('customer.session.destroy'); diff --git a/packages/Webkul/Inventory/.gitignore b/packages/Webkul/Inventory/.gitignore new file mode 100644 index 000000000..30bc16279 --- /dev/null +++ b/packages/Webkul/Inventory/.gitignore @@ -0,0 +1 @@ +/node_modules \ No newline at end of file diff --git a/packages/Webkul/Inventory/composer.json b/packages/Webkul/Inventory/composer.json new file mode 100644 index 000000000..f1fc80177 --- /dev/null +++ b/packages/Webkul/Inventory/composer.json @@ -0,0 +1,27 @@ +{ + "name": "webkul/laravel-inventory", + "license": "MIT", + "authors": [ + { + "name": "Jitendra Singh", + "email": "jitendra@webkul.com" + } + ], + "require": { + "propaganistas/laravel-intl": "^2.0" + }, + "autoload": { + "psr-4": { + "Webkul\\Inventory\\": "src/" + } + }, + "extra": { + "laravel": { + "providers": [ + "Webkul\\Inventory\\InventoryServiceProvider" + ], + "aliases": {} + } + }, + "minimum-stability": "dev" +} diff --git a/packages/Webkul/Inventory/src/Database/Migrations/2018_07_23_110040_create_inventory_sources_table.php b/packages/Webkul/Inventory/src/Database/Migrations/2018_07_23_110040_create_inventory_sources_table.php new file mode 100644 index 000000000..b6110de49 --- /dev/null +++ b/packages/Webkul/Inventory/src/Database/Migrations/2018_07_23_110040_create_inventory_sources_table.php @@ -0,0 +1,47 @@ +increments('id'); + $table->string('code')->unique(); + $table->string('name'); + $table->text('description')->nullable(); + $table->string('contact_name')->nullable(); + $table->string('contact_email')->nullable(); + $table->string('contact_number')->nullable(); + $table->string('contact_fax')->nullable(); + $table->string('country')->nullable(); + $table->string('state')->nullable(); + $table->string('city')->nullable(); + $table->string('street')->nullable(); + $table->string('postcode'); + $table->integer('priority')->default(0); + $table->decimal('latitude', 10, 5); + $table->decimal('longitude', 10, 5); + $table->boolean('status')->default(0); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('inventory_sources'); + } +} diff --git a/packages/Webkul/Inventory/src/Http/Controllers/Controller.php b/packages/Webkul/Inventory/src/Http/Controllers/Controller.php new file mode 100644 index 000000000..cdfffe386 --- /dev/null +++ b/packages/Webkul/Inventory/src/Http/Controllers/Controller.php @@ -0,0 +1,13 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class InventorySourceController extends Controller +{ + /** + * Contains route related configuration + * + * @var array + */ + protected $_config; + + /** + * InventorySourceRepository object + * + * @var array + */ + protected $inventorySource; + + /** + * Create a new controller instance. + * + * @param Webkul\Inventory\Repositories\InventorySourceRepository $inventorySource + * @return void + */ + public function __construct(InventorySource $inventorySource) + { + $this->inventorySource = $inventorySource; + + $this->_config = request('_config'); + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view($this->_config['view']); + } + + /** + * Store a newly created resource in storage. + * + * @return \Illuminate\Http\Response + */ + public function store() + { + $this->validate(request(), [ + 'name' => 'required' + ]); + + $this->inventorySource->create(request()->all()); + + session()->flash('success', 'Inventory source created successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + $inventorySource = $this->inventorySource->findOrFail($id); + + return view($this->_config['view'], compact('inventorySource')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + $this->validate(request(), [ + 'name' => 'required', + ]); + + $this->inventorySource->update(request()->all(), $id); + + session()->flash('success', 'Inventory source updated successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + // + } +} \ No newline at end of file diff --git a/packages/Webkul/Inventory/src/Models/InventorySource.php b/packages/Webkul/Inventory/src/Models/InventorySource.php new file mode 100644 index 000000000..c7b066699 --- /dev/null +++ b/packages/Webkul/Inventory/src/Models/InventorySource.php @@ -0,0 +1,10 @@ +loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); + } + + /** + * Register services. + * + * @return void + */ + public function register() + { + } +} \ No newline at end of file diff --git a/packages/Webkul/Inventory/src/Repositories/InventorySourceRepository.php b/packages/Webkul/Inventory/src/Repositories/InventorySourceRepository.php new file mode 100644 index 000000000..519dd2e2d --- /dev/null +++ b/packages/Webkul/Inventory/src/Repositories/InventorySourceRepository.php @@ -0,0 +1,24 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class InventorySourceRepository extends Repository +{ + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\Inventory\Models\InventorySource'; + } +} \ No newline at end of file diff --git a/packages/Webkul/Product/.gitignore b/packages/Webkul/Product/.gitignore new file mode 100644 index 000000000..30bc16279 --- /dev/null +++ b/packages/Webkul/Product/.gitignore @@ -0,0 +1 @@ +/node_modules \ No newline at end of file diff --git a/packages/Webkul/Product/composer.json b/packages/Webkul/Product/composer.json new file mode 100644 index 000000000..079a713fe --- /dev/null +++ b/packages/Webkul/Product/composer.json @@ -0,0 +1,27 @@ +{ + "name": "webkul/laravel-product", + "license": "MIT", + "authors": [ + { + "name": "Jitendra Singh", + "email": "jitendra@webkul.com" + } + ], + "require": {}, + "autoload": { + "psr-4": { + "Webkul\\Product\\": "src/" + } + }, + "extra": { + "laravel": { + "providers": [ + "Webkul\\Product\\Providers\\ProductServiceProvider" + ], + "aliases": { + "Bouncer": "Webkul\\Product\\Facades\\Bouncer" + } + } + }, + "minimum-stability": "dev" +} diff --git a/packages/Webkul/Product/src/Http/Controllers/Controller.php b/packages/Webkul/Product/src/Http/Controllers/Controller.php new file mode 100644 index 000000000..59b522ad3 --- /dev/null +++ b/packages/Webkul/Product/src/Http/Controllers/Controller.php @@ -0,0 +1,13 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class ProductController extends Controller +{ + /** + * Contains route related configuration + * + * @var array + */ + protected $_config; + + /** + * ProductRepository object + * + * @var array + */ + protected $product; + + /** + * Create a new controller instance. + * + * @param Webkul\Product\Repositories\ProductRepository $product + * @return void + */ + public function __construct(Product $product) + { + $this->product = $product; + + $this->_config = request('_config'); + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view($this->_config['view']); + } + + /** + * Store a newly created resource in storage. + * + * @return \Illuminate\Http\Response + */ + public function store() + { + $this->validate(request(), [ + 'name' => 'required' + ]); + + $this->product->create(request()->all()); + + session()->flash('success', 'Product created successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + $product = $this->product->findOrFail($id); + + return view($this->_config['view'], compact('product')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + $this->validate(request(), [ + 'name' => 'required', + ]); + + $this->product->update(request()->all(), $id); + + session()->flash('success', 'Product updated successfully.'); + + return redirect()->route($this->_config['redirect']); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + // + } +} \ No newline at end of file diff --git a/packages/Webkul/Product/src/Models/Product.php b/packages/Webkul/Product/src/Models/Product.php new file mode 100644 index 000000000..4a0fd94a2 --- /dev/null +++ b/packages/Webkul/Product/src/Models/Product.php @@ -0,0 +1,10 @@ +loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); + } + + /** + * Register services. + * + * @return void + */ + public function register() + { + + } +} \ No newline at end of file diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php new file mode 100644 index 000000000..2da8dd92f --- /dev/null +++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php @@ -0,0 +1,24 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class ProductRepository extends Repository +{ + /** + * Specify Model class name + * + * @return mixed + */ + function model() + { + return 'Webkul\Product\Models\Product'; + } +} \ No newline at end of file diff --git a/packages/Webkul/Ui/src/DataGrid/DataGrid.php b/packages/Webkul/Ui/src/DataGrid/DataGrid.php index 842448aca..c0296aa32 100644 --- a/packages/Webkul/Ui/src/DataGrid/DataGrid.php +++ b/packages/Webkul/Ui/src/DataGrid/DataGrid.php @@ -547,7 +547,7 @@ class DataGrid private function getQueryWithFilters() { $parsed = $this->parse(); - // dd($parsed); + if ($this->aliased) { foreach ($parsed as $key=>$value) { if ($key=="sort") { @@ -615,7 +615,6 @@ class DataGrid { $parsed = $this->parse(); - if ($this->aliased==true) { //flags $table_alias = false; diff --git a/packages/Webkul/Ui/src/Resources/assets/images/Folder-Icon.svg b/packages/Webkul/Ui/src/Resources/assets/images/Folder-Icon.svg new file mode 100644 index 000000000..48717d78b --- /dev/null +++ b/packages/Webkul/Ui/src/Resources/assets/images/Folder-Icon.svg @@ -0,0 +1,10 @@ + + + + Folder-Icon + Created with Sketch. + + + + + \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/assets/images/icon-search-dark.svg b/packages/Webkul/Ui/src/Resources/assets/images/icon-search-dark.svg new file mode 100644 index 000000000..5bdeb0082 --- /dev/null +++ b/packages/Webkul/Ui/src/Resources/assets/images/icon-search-dark.svg @@ -0,0 +1,11 @@ + + + + icon-search + Created with Sketch. + + + + + + \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/assets/js/app.js b/packages/Webkul/Ui/src/Resources/assets/js/app.js index 62c2cb748..070c8caa3 100644 --- a/packages/Webkul/Ui/src/Resources/assets/js/app.js +++ b/packages/Webkul/Ui/src/Resources/assets/js/app.js @@ -4,4 +4,5 @@ Vue.component("accordian", require("./components/accordian")); Vue.component("tree-view", require("./components/tree-view/tree-view")); Vue.component("tree-item", require("./components/tree-view/tree-item")); Vue.component("tree-checkbox", require("./components/tree-view/tree-checkbox")); -// Vue.component("datetime", require("./components/datetime")); +Vue.component("tree-radio", require("./components/tree-view/tree-radio")); +Vue.component("modal", require("./components/modal")); diff --git a/packages/Webkul/Ui/src/Resources/assets/js/components/accordian.vue b/packages/Webkul/Ui/src/Resources/assets/js/components/accordian.vue index 847d463b4..7da741d3f 100644 --- a/packages/Webkul/Ui/src/Resources/assets/js/components/accordian.vue +++ b/packages/Webkul/Ui/src/Resources/assets/js/components/accordian.vue @@ -1,10 +1,16 @@ \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/assets/js/components/tree-view/tree-checkbox.vue b/packages/Webkul/Ui/src/Resources/assets/js/components/tree-view/tree-checkbox.vue index 3304fec27..92b556ef9 100644 --- a/packages/Webkul/Ui/src/Resources/assets/js/components/tree-view/tree-checkbox.vue +++ b/packages/Webkul/Ui/src/Resources/assets/js/components/tree-view/tree-checkbox.vue @@ -1,6 +1,6 @@