Commit to master
This commit is contained in:
parent
c9c090ea2b
commit
4fb084557d
|
|
@ -1,6 +1,9 @@
|
||||||
/node_modules
|
/node_modules
|
||||||
/public/hot
|
/public/hot
|
||||||
/public/storage
|
/public/storage
|
||||||
|
/public/css
|
||||||
|
/public/js
|
||||||
|
/public/vendor
|
||||||
/storage/*.key
|
/storage/*.key
|
||||||
/vendor
|
/vendor
|
||||||
/.idea
|
/.idea
|
||||||
|
|
@ -11,3 +14,4 @@ Homestead.yaml
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
.env
|
.env
|
||||||
|
/ignorables/*
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
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 db:seed --class=Webkul\\User\\Database\\Seeders\\DatabaseSeeder
|
||||||
|
|
||||||
|
php artisan route:cache
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Criteria;
|
||||||
|
|
||||||
|
use Prettus\Repository\Contracts\CriteriaInterface;
|
||||||
|
use Prettus\Repository\Contracts\RepositoryInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class MyCriteria.
|
||||||
|
*
|
||||||
|
* @package namespace App\Criteria;
|
||||||
|
*/
|
||||||
|
class MyCriteria implements CriteriaInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Apply criteria in query repository
|
||||||
|
*
|
||||||
|
* @param string $model
|
||||||
|
* @param RepositoryInterface $repository
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function apply($model, RepositoryInterface $repository)
|
||||||
|
{
|
||||||
|
return $model;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
|
|
@ -13,7 +14,7 @@ class AppServiceProvider extends ServiceProvider
|
||||||
*/
|
*/
|
||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
//
|
Schema::defaultStringLength(191);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,23 @@
|
||||||
{
|
{
|
||||||
"name": "jitendra-webkul/bagisto",
|
"name": "jitendra-webkul/bagisto",
|
||||||
"description": "The Laravel Framework.",
|
"description": "The Laravel Framework.",
|
||||||
"keywords": ["framework", "laravel"],
|
"keywords": [
|
||||||
|
"framework",
|
||||||
|
"laravel"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.1.3",
|
"php": "^7.1.3",
|
||||||
|
"dimsav/laravel-translatable": "^9.0",
|
||||||
"fideloper/proxy": "^4.0",
|
"fideloper/proxy": "^4.0",
|
||||||
|
"intervention/image": "^2.4",
|
||||||
|
"kalnoy/nestedset": "^4.3",
|
||||||
"laravel/framework": "5.6.*",
|
"laravel/framework": "5.6.*",
|
||||||
"laravel/tinker": "^1.0",
|
"laravel/tinker": "^1.0",
|
||||||
"nwidart/laravel-modules": "^3.2"
|
"nwidart/laravel-modules": "^3.2",
|
||||||
|
"prettus/l5-repository": "^2.6",
|
||||||
|
"propaganistas/laravel-intl": "^2.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"barryvdh/laravel-debugbar": "^3.1",
|
"barryvdh/laravel-debugbar": "^3.1",
|
||||||
|
|
@ -22,7 +30,14 @@
|
||||||
"replace": {
|
"replace": {
|
||||||
"webkul/laravel-user": "self.version",
|
"webkul/laravel-user": "self.version",
|
||||||
"webkul/laravel-admin": "self.version",
|
"webkul/laravel-admin": "self.version",
|
||||||
"webkul/laravel-ui": "self.version"
|
"webkul/laravel-ui": "self.version",
|
||||||
|
"webkul/laravel-core": "self.version",
|
||||||
|
"webkul/laravel-attribute": "self.version",
|
||||||
|
"webkul/laravel-customer": "self.version",
|
||||||
|
"webkul/laravel-category": "self.version",
|
||||||
|
"webkul/laravel-product": "self.version",
|
||||||
|
"webkul/laravel-shop": "self.version",
|
||||||
|
"webkul/laravel-theme": "self.version"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"classmap": [
|
"classmap": [
|
||||||
|
|
@ -33,7 +48,15 @@
|
||||||
"App\\": "app/",
|
"App\\": "app/",
|
||||||
"Webkul\\User\\": "packages/Webkul/User/src",
|
"Webkul\\User\\": "packages/Webkul/User/src",
|
||||||
"Webkul\\Admin\\": "packages/Webkul/Admin/src",
|
"Webkul\\Admin\\": "packages/Webkul/Admin/src",
|
||||||
"Webkul\\Ui\\": "packages/Webkul/Ui/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\\Inventory\\": "packages/Webkul/Inventory/src",
|
||||||
|
"Webkul\\Product\\": "packages/Webkul/Product/src",
|
||||||
|
"Webkul\\Theme\\": "packages/Webkul/Theme/src"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
|
|
@ -43,8 +66,7 @@
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"laravel": {
|
"laravel": {
|
||||||
"dont-discover": [
|
"dont-discover": []
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -13,7 +13,7 @@ return [
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'name' => env('APP_NAME', 'Laravel'),
|
'name' => env('APP_NAME', 'Bagisto'),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
@ -118,6 +118,13 @@ return [
|
||||||
| this array to grant expanded functionality to your applications.
|
| this array to grant expanded functionality to your applications.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
|
Code Editor
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'editor' =>'vscode',
|
||||||
|
|
||||||
|
|
||||||
'providers' => [
|
'providers' => [
|
||||||
|
|
||||||
|
|
@ -151,6 +158,9 @@ return [
|
||||||
* Package Service Providers...
|
* Package Service Providers...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Dimsav\Translatable\TranslatableServiceProvider::class,
|
||||||
|
Propaganistas\LaravelIntl\IntlServiceProvider::class,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Application Service Providers...
|
* Application Service Providers...
|
||||||
*/
|
*/
|
||||||
|
|
@ -160,10 +170,24 @@ return [
|
||||||
App\Providers\EventServiceProvider::class,
|
App\Providers\EventServiceProvider::class,
|
||||||
App\Providers\RouteServiceProvider::class,
|
App\Providers\RouteServiceProvider::class,
|
||||||
|
|
||||||
|
//Laravel Intervention
|
||||||
|
Intervention\Image\ImageServiceProvider::class,
|
||||||
|
Prettus\Repository\Providers\RepositoryServiceProvider::class,
|
||||||
|
|
||||||
|
//Webkul packages
|
||||||
Webkul\User\Providers\UserServiceProvider::class,
|
Webkul\User\Providers\UserServiceProvider::class,
|
||||||
Webkul\Admin\Providers\AdminServiceProvider::class,
|
Webkul\Admin\Providers\AdminServiceProvider::class,
|
||||||
Webkul\Ui\Providers\UiServiceProvider::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\Inventory\Providers\InventoryServiceProvider::class,
|
||||||
|
Webkul\Product\Providers\ProductServiceProvider::class,
|
||||||
|
Webkul\Shop\Providers\ShopServiceProvider::class,
|
||||||
|
Webkul\Customer\Providers\CustomerServiceProvider::class,
|
||||||
|
Webkul\Theme\Providers\ThemeServiceProvider::class
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -211,7 +235,10 @@ return [
|
||||||
'Storage' => Illuminate\Support\Facades\Storage::class,
|
'Storage' => Illuminate\Support\Facades\Storage::class,
|
||||||
'URL' => Illuminate\Support\Facades\URL::class,
|
'URL' => Illuminate\Support\Facades\URL::class,
|
||||||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||||
'View' => Illuminate\Support\Facades\View::class
|
'View' => Illuminate\Support\Facades\View::class,
|
||||||
|
'Datagrid' => Webkul\Ui\DataGrid\Facades\DataGrid::class,
|
||||||
|
'ProductGrid' => Webkul\Ui\DataGrid\Facades\ProductGrid::class,
|
||||||
|
'Image' => Intervention\Image\Facades\Image::class
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
||||||
106
config/auth.php
106
config/auth.php
|
|
@ -1,102 +1,60 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Authentication Defaults
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This option controls the default authentication "guard" and password
|
|
||||||
| reset options for your application. You may change these defaults
|
|
||||||
| as required, but they're a perfect start for most applications.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'defaults' => [
|
'defaults' => [
|
||||||
'guard' => 'web',
|
'guard' => 'web',
|
||||||
'passwords' => 'users',
|
'passwords' => 'admins',
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Authentication Guards
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Next, you may define every authentication guard for your application.
|
|
||||||
| Of course, a great default configuration has been defined for you
|
|
||||||
| here which uses session storage and the Eloquent user provider.
|
|
||||||
|
|
|
||||||
| All authentication drivers have a user provider. This defines how the
|
|
||||||
| users are actually retrieved out of your database or other storage
|
|
||||||
| mechanisms used by this application to persist your user's data.
|
|
||||||
|
|
|
||||||
| Supported: "session", "token"
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'guards' => [
|
'guards' => [
|
||||||
'web' => [
|
'web' => [
|
||||||
'driver' => 'session',
|
'driver' => 'session',
|
||||||
'provider' => 'users',
|
'provider' => 'admins',
|
||||||
],
|
],
|
||||||
|
|
||||||
'api' => [
|
'api' => [
|
||||||
'driver' => 'token',
|
'driver' => 'token',
|
||||||
'provider' => 'users',
|
'provider' => 'admins',
|
||||||
],
|
],
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
'customer' =>[
|
||||||
|--------------------------------------------------------------------------
|
'driver' => 'session',
|
||||||
| User Providers
|
'provider' => 'customers'
|
||||||
|--------------------------------------------------------------------------
|
],
|
||||||
|
|
|
||||||
| All authentication drivers have a user provider. This defines how the
|
'admin' => [
|
||||||
| users are actually retrieved out of your database or other storage
|
'driver' => 'session',
|
||||||
| mechanisms used by this application to persist your user's data.
|
'provider' => 'admins'
|
||||||
|
|
],
|
||||||
| If you have multiple user tables or models you may configure multiple
|
|
||||||
| sources which represent each model / table. These sources may then
|
'admin-api' => [
|
||||||
| be assigned to any extra authentication guards you have defined.
|
'driver' => 'token',
|
||||||
|
|
'provider' => 'admins',
|
||||||
| Supported: "database", "eloquent"
|
]
|
||||||
|
|
],
|
||||||
*/
|
|
||||||
|
|
||||||
'providers' => [
|
'providers' => [
|
||||||
'users' => [
|
'customers' => [
|
||||||
'driver' => 'eloquent',
|
'driver' => 'eloquent',
|
||||||
'model' => App\User::class,
|
'model' => Webkul\Customer\Models\Customer::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
// 'users' => [
|
'admins' => [
|
||||||
// 'driver' => 'database',
|
'driver' => 'eloquent',
|
||||||
// 'table' => 'users',
|
'model' => Webkul\User\Models\Admin::class,
|
||||||
// ],
|
]
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Resetting Passwords
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| You may specify multiple password reset configurations if you have more
|
|
||||||
| than one user table or model in the application and you want to have
|
|
||||||
| separate password reset settings based on the specific user types.
|
|
||||||
|
|
|
||||||
| The expire time is the number of minutes that the reset token should be
|
|
||||||
| considered valid. This security feature keeps tokens short-lived so
|
|
||||||
| they have less time to be guessed. You may change this as needed.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'passwords' => [
|
'passwords' => [
|
||||||
'users' => [
|
'admins' => [
|
||||||
'provider' => 'users',
|
'provider' => 'admins',
|
||||||
'table' => 'password_resets',
|
'table' => 'admin_password_resets',
|
||||||
|
'expire' => 60,
|
||||||
|
],
|
||||||
|
'customers' => [
|
||||||
|
'provider' => 'customers',
|
||||||
|
'table' => 'customers_password_resets',
|
||||||
'expire' => 60,
|
'expire' => 60,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
[
|
||||||
|
'code' => 'flatrate',
|
||||||
|
'name' => 'Flat Rate',
|
||||||
|
'class' => 'Webkul\Shipping\Calculators\FlatRate'
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
@ -13,7 +13,7 @@ return [
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'default' => env('FILESYSTEM_DRIVER', 'local'),
|
'default' => env('FILESYSTEM_DRIVER', 'public'),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
@ -51,7 +51,7 @@ return [
|
||||||
'public' => [
|
'public' => [
|
||||||
'driver' => 'local',
|
'driver' => 'local',
|
||||||
'root' => storage_path('app/public'),
|
'root' => storage_path('app/public'),
|
||||||
'url' => env('APP_URL').'/storage',
|
'url' => env('APP_URL').'/public/storage',
|
||||||
'visibility' => 'public',
|
'visibility' => 'public',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Image Driver
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Intervention Image supports "GD Library" and "Imagick" to process images
|
||||||
|
| internally. You may choose one of them according to your PHP
|
||||||
|
| configuration. By default PHP's "GD Library" implementation is used.
|
||||||
|
|
|
||||||
|
| Supported: "gd", "imagick"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'driver' => 'gd'
|
||||||
|
|
||||||
|
];
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'default' => 'bliss',
|
||||||
|
|
||||||
|
'themes' => [
|
||||||
|
'default' => [
|
||||||
|
'views_path' => 'resources/themes/default/views',
|
||||||
|
'assets_path' => 'public/themes/default/assets',
|
||||||
|
'name' => 'Dafault'
|
||||||
|
],
|
||||||
|
|
||||||
|
'bliss' => [
|
||||||
|
'views_path' => 'resources/themes/bliss/views',
|
||||||
|
'assets_path' => 'public/themes/bliss/assets',
|
||||||
|
'name' => 'Bliss',
|
||||||
|
'parent' => 'default'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
@ -0,0 +1,116 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Application Locales
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Contains an array with the applications available locales.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'locales' => [
|
||||||
|
'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,
|
||||||
|
];
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1 +1,3 @@
|
||||||
/node_modules
|
/node_modules
|
||||||
|
/package-lock.json
|
||||||
|
npm-debug.log
|
||||||
|
|
@ -8,8 +8,9 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"webkul/laravel-admin": "dev-master",
|
"webkul/laravel-user": "dev-master",
|
||||||
"webkul/laravel-ui": "dev-master"
|
"webkul/laravel-ui": "dev-master",
|
||||||
|
"webkul/laravel-core": "dev-master"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
"vue": "^2.1.10"
|
"vue": "^2.1.10"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vee-validate": "^2.1.0-beta.3"
|
"vee-validate": "2.0.0-rc.26",
|
||||||
|
"flatpickr": "^4.4.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'guards' => [
|
'guards' => [
|
||||||
'web' => [
|
'web' => [
|
||||||
'driver' => 'session',
|
'driver' => 'session',
|
||||||
|
|
@ -12,6 +13,11 @@ return [
|
||||||
'provider' => 'users',
|
'provider' => 'users',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'customer' =>[
|
||||||
|
'driver' => 'session',
|
||||||
|
'provider' => 'customers'
|
||||||
|
],
|
||||||
|
|
||||||
'admin' => [
|
'admin' => [
|
||||||
'driver' => 'session',
|
'driver' => 'session',
|
||||||
'provider' => 'admins'
|
'provider' => 'admins'
|
||||||
|
|
@ -27,11 +33,29 @@ return [
|
||||||
'users' => [
|
'users' => [
|
||||||
'driver' => 'eloquent',
|
'driver' => 'eloquent',
|
||||||
'model' => Webkul\User\Models\User::class,
|
'model' => Webkul\User\Models\User::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'customers' => [
|
||||||
|
'driver' => 'eloquent',
|
||||||
|
'model' => Webkul\Customer\Models\Customer::class,
|
||||||
|
],
|
||||||
|
|
||||||
'admins' => [
|
'admins' => [
|
||||||
'driver' => 'eloquent',
|
'driver' => 'eloquent',
|
||||||
'model' => Webkul\User\Models\Admin::class,
|
'model' => Webkul\User\Models\Admin::class,
|
||||||
]
|
]
|
||||||
]
|
],
|
||||||
];
|
|
||||||
|
'passwords' => [
|
||||||
|
'admins' => [
|
||||||
|
'provider' => 'admins',
|
||||||
|
'table' => 'admin_password_resets',
|
||||||
|
'expire' => 60,
|
||||||
|
],
|
||||||
|
'customers' => [
|
||||||
|
'provider' => 'customers',
|
||||||
|
'table' => 'customers_password_resets',
|
||||||
|
'expire' => 60,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,191 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\DataGrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attributes DataGrid
|
||||||
|
*
|
||||||
|
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
class AttributeDataGrid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Data Grid implementation.
|
||||||
|
*
|
||||||
|
* @var AttributeDataGrid
|
||||||
|
* for countries
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function createAttributeDataGrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
return DataGrid::make([
|
||||||
|
'name' => 'Attributes',
|
||||||
|
'table' => 'attributes',
|
||||||
|
'select' => 'id',
|
||||||
|
'perpage' => 10,
|
||||||
|
'aliased' => false, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' =>[
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
], [
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'join' => [
|
||||||
|
// [
|
||||||
|
// 'join' => 'leftjoin',
|
||||||
|
// 'table' => 'roles as r',
|
||||||
|
// 'primaryKey' => 'u.role_id',
|
||||||
|
// 'condition' => '=',
|
||||||
|
// 'secondaryKey' => 'r.id',
|
||||||
|
// ]
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
|
||||||
|
'columns' => [
|
||||||
|
|
||||||
|
[
|
||||||
|
'name' => 'id',
|
||||||
|
'alias' => 'attributeId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'code',
|
||||||
|
'alias' => 'attributeCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'admin_name',
|
||||||
|
'alias' => 'attributeAdminName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'AdminName',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'type',
|
||||||
|
'alias' => 'attributeType',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Type',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'is_required',
|
||||||
|
'alias' => 'attributeIsRequired',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Required',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'is_unique',
|
||||||
|
'alias' => 'attributeIsUnique',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Unique',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'value_per_locale',
|
||||||
|
'alias' => 'attributeValuePerLocale',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'ValuePerLocale',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'value_per_channel',
|
||||||
|
'alias' => 'attributeValuePerChannel',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'ValuePerChannel',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
'filterable' => [
|
||||||
|
// [
|
||||||
|
// 'column' => 'id',
|
||||||
|
// 'alias' => 'attribute_family_id',
|
||||||
|
// 'type' => 'number',
|
||||||
|
// 'label' => 'ID',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'column' => 'code',
|
||||||
|
// 'alias' => 'attribute_family_code',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Code',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'column' => 'name',
|
||||||
|
// 'alias' => 'attribute_family_name',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Name',
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
|
||||||
|
'searchable' => [
|
||||||
|
// [
|
||||||
|
// 'column' => 'name',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Name',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'column' => 'code',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Code',
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
//list of viable operators that will be used
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->createAttributeDataGrid()->render();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,155 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\DataGrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attributes Family DataGrid
|
||||||
|
*
|
||||||
|
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
class AttributeFamilyDataGrid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Data Grid implementation.
|
||||||
|
*
|
||||||
|
* @var CountryComposer
|
||||||
|
* for countries
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function createAttributeFamilyDataGrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
return DataGrid::make([
|
||||||
|
'name' => 'Attribute Family',
|
||||||
|
'table' => 'attribute_families',
|
||||||
|
'select' => 'id',
|
||||||
|
'perpage' => 10,
|
||||||
|
'aliased' => false, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' =>[
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
], [
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'join' => [
|
||||||
|
// [
|
||||||
|
// 'join' => 'leftjoin',
|
||||||
|
// 'table' => 'roles as r',
|
||||||
|
// 'primaryKey' => 'u.role_id',
|
||||||
|
// 'condition' => '=',
|
||||||
|
// 'secondaryKey' => 'r.id',
|
||||||
|
// ]
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
|
||||||
|
'columns' => [
|
||||||
|
|
||||||
|
[
|
||||||
|
'name' => 'id',
|
||||||
|
'alias' => 'attributeFamilyId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'code',
|
||||||
|
'alias' => 'attributeFamilyCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'alias' => 'attributeFamilyName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'filterable' => [
|
||||||
|
[
|
||||||
|
'column' => 'id',
|
||||||
|
'alias' => 'attributeFamilyId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'code',
|
||||||
|
'alias' => 'attributeFamilyCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'alias' => 'attributeFamilyName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
|
||||||
|
'searchable' => [
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'code',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//list of viable operators that will be used
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->createAttributeFamilyDataGrid()->render();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,172 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\DataGrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Category DataGrid
|
||||||
|
*
|
||||||
|
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
class CategoryDataGrid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Data Grid implementation.
|
||||||
|
*
|
||||||
|
* @var AttributeDataGrid
|
||||||
|
* for countries
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function createCategoryDataGrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
return DataGrid::make([
|
||||||
|
'name' => 'Categories',
|
||||||
|
'table' => 'categories as cat',
|
||||||
|
'select' => 'cat.id',
|
||||||
|
'perpage' => 10,
|
||||||
|
'aliased' => true, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' =>[
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
], [
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'join' => [
|
||||||
|
[
|
||||||
|
'join' => 'leftjoin',
|
||||||
|
'table' => 'category_translations as ct',
|
||||||
|
'primaryKey' => 'cat.id',
|
||||||
|
'condition' => '=',
|
||||||
|
'secondaryKey' => 'ct.category_id',
|
||||||
|
], [
|
||||||
|
'join' => 'leftjoin',
|
||||||
|
'table' => 'category_translations as cta',
|
||||||
|
'primaryKey' => 'cat.parent_id',
|
||||||
|
'condition' => '=',
|
||||||
|
'secondaryKey' => 'cta.category_id',
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
|
||||||
|
'columns' => [
|
||||||
|
[
|
||||||
|
'name' => 'cat.id',
|
||||||
|
'alias' => 'catID',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'Category ID',
|
||||||
|
'sortable' => true,
|
||||||
|
], [
|
||||||
|
'name' => 'ct.name',
|
||||||
|
'alias' => 'catName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Category Name',
|
||||||
|
'sortable' => false,
|
||||||
|
], [
|
||||||
|
'name' => 'cat.position',
|
||||||
|
'alias' => 'catPosition',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Category Position',
|
||||||
|
'sortable' => false,
|
||||||
|
], [
|
||||||
|
'name' => 'cta.name',
|
||||||
|
'alias' => 'parentName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Parent Name',
|
||||||
|
'sortable' => true,
|
||||||
|
], [
|
||||||
|
'name' => 'cat.status',
|
||||||
|
'alias' => 'catStatus',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Visible in Menu',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
'filterable' => [
|
||||||
|
// [
|
||||||
|
// 'column' => 'id',
|
||||||
|
// 'alias' => 'attribute_family_id',
|
||||||
|
// 'type' => 'number',
|
||||||
|
// 'label' => 'ID',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'column' => 'code',
|
||||||
|
// 'alias' => 'attribute_family_code',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Code',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'column' => 'name',
|
||||||
|
// 'alias' => 'attribute_family_name',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Name',
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
|
||||||
|
'searchable' => [
|
||||||
|
// [
|
||||||
|
// 'column' => 'name',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Name',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'column' => 'code',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Code',
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
//list of viable operators that will be used
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->createCategoryDataGrid()->render();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,156 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\DataGrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Channels DataGrid
|
||||||
|
*
|
||||||
|
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
class ChannelDataGrid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Data Grid implementation.
|
||||||
|
*
|
||||||
|
* @var CountryComposer
|
||||||
|
* for countries
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function createChannelsDataGrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
return DataGrid::make([
|
||||||
|
'name' => 'Channels',
|
||||||
|
'table' => 'channels',
|
||||||
|
'select' => 'id',
|
||||||
|
'perpage' => 5,
|
||||||
|
'aliased' => false, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' =>[
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really edit this record?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
], [
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to delete this record?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'join' => [
|
||||||
|
// [
|
||||||
|
// 'join' => 'leftjoin',
|
||||||
|
// 'table' => 'roles as r',
|
||||||
|
// 'primaryKey' => 'u.role_id',
|
||||||
|
// 'condition' => '=',
|
||||||
|
// 'secondaryKey' => 'r.id',
|
||||||
|
// ]
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
|
||||||
|
'columns' => [
|
||||||
|
|
||||||
|
[
|
||||||
|
'name' => 'id',
|
||||||
|
'alias' => 'channel_id',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'Channel ID',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'code',
|
||||||
|
'alias' => 'channel_code',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Channel Code',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'alias' => 'channel_name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Channel Name',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of filters
|
||||||
|
|
||||||
|
'filterable' => [
|
||||||
|
[
|
||||||
|
'column' => 'id',
|
||||||
|
'alias' => 'channelId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'Channel ID',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'code',
|
||||||
|
'alias' => 'channelCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Channel Code',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'alias' => 'channelName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Channel Name',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
|
||||||
|
'searchable' => [
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Channel Name',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'code',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Channel Code',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//list of viable operators that will be used
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return $this->createChannelsDataGrid()->render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,171 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\DataGrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Countries DataGrid
|
||||||
|
*
|
||||||
|
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
class CountryDataGrid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Data Grid implementation.
|
||||||
|
*
|
||||||
|
* @var CountryComposer
|
||||||
|
* for countries
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function createCountryDataGrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
return DataGrid::make([
|
||||||
|
'name' => 'Countries',
|
||||||
|
'table' => 'countries',
|
||||||
|
'select' => 'id',
|
||||||
|
'perpage' => 10,
|
||||||
|
'aliased' => false, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' =>[
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
], [
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'join' => [
|
||||||
|
// [
|
||||||
|
// 'join' => 'leftjoin',
|
||||||
|
// 'table' => 'roles as r',
|
||||||
|
// 'primaryKey' => 'u.role_id',
|
||||||
|
// 'condition' => '=',
|
||||||
|
// 'secondaryKey' => 'r.id',
|
||||||
|
// ]
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
|
||||||
|
'columns' => [
|
||||||
|
|
||||||
|
[
|
||||||
|
'name' => 'id',
|
||||||
|
'alias' => 'countryId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'code',
|
||||||
|
'alias' => 'countryCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'alias' => 'countryName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'status',
|
||||||
|
'alias' => 'countryStatus',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'Code',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of filters
|
||||||
|
|
||||||
|
'filterable' => [
|
||||||
|
[
|
||||||
|
'column' => 'id',
|
||||||
|
'alias' => 'countryId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'code',
|
||||||
|
'alias' => 'countryCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'alias' => 'countryName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'status',
|
||||||
|
'alias' => 'countryStatus',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'Code',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
|
||||||
|
'searchable' => [
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'code',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//list of viable operators that will be used
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->createCountryDataGrid()->render();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,155 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\DataGrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Currencies DataGrid
|
||||||
|
*
|
||||||
|
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
class CurrencyDataGrid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Data Grid implementation.
|
||||||
|
*
|
||||||
|
* @var CurrenciesDataGrid
|
||||||
|
* for countries
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function createCurrencyDataGrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
return DataGrid::make([
|
||||||
|
'name' => 'Currencies',
|
||||||
|
'table' => 'currencies',
|
||||||
|
'select' => 'id',
|
||||||
|
'perpage' => 5,
|
||||||
|
'aliased' => false, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' =>[
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really edit this record?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
], [
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to delete this record?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'join' => [
|
||||||
|
// [
|
||||||
|
// 'join' => 'leftjoin',
|
||||||
|
// 'table' => 'roles as r',
|
||||||
|
// 'primaryKey' => 'u.role_id',
|
||||||
|
// 'condition' => '=',
|
||||||
|
// 'secondaryKey' => 'r.id',
|
||||||
|
// ]
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
|
||||||
|
'columns' => [
|
||||||
|
|
||||||
|
[
|
||||||
|
'name' => 'id',
|
||||||
|
'alias' => 'currencyId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'code',
|
||||||
|
'alias' => 'currencyCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'alias' => 'currencyName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of filters
|
||||||
|
|
||||||
|
'filterable' => [
|
||||||
|
[
|
||||||
|
'column' => 'id',
|
||||||
|
'alias' => 'currencyId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'code',
|
||||||
|
'alias' => 'currencyCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'alias' => 'currencyName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
|
||||||
|
'searchable' => [
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'code',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//list of viable operators that will be used
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return $this->createCurrencyDataGrid()->render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,164 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\DataGrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exchange Rates DataGrid
|
||||||
|
*
|
||||||
|
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
class ExchangeRatesDataGrid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Data Grid implementation.
|
||||||
|
*
|
||||||
|
* @var ExchangeRatesDataGrid
|
||||||
|
* for Exchange Rates
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public function createExchangeRatesDataGrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
return DataGrid::make([
|
||||||
|
'name' => 'Exchange Rates',
|
||||||
|
'table' => 'currency_exchange_rates',
|
||||||
|
'select' => 'id',
|
||||||
|
'perpage' => 5,
|
||||||
|
'aliased' => false, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' =>[
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really edit this record?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
], [
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to delete this record?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'join' => [
|
||||||
|
// [
|
||||||
|
// 'join' => 'leftjoin',
|
||||||
|
// 'table' => 'roles as r',
|
||||||
|
// 'primaryKey' => 'u.role_id',
|
||||||
|
// 'condition' => '=',
|
||||||
|
// 'secondaryKey' => 'r.id',
|
||||||
|
// ]
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
|
||||||
|
'columns' => [
|
||||||
|
|
||||||
|
[
|
||||||
|
'name' => 'id',
|
||||||
|
'alias' => 'exchID',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'Rate ID',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'source_currency',
|
||||||
|
'alias' => 'exchSourceCurrency',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Source Currency',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'target_currency',
|
||||||
|
'alias' => 'exchTargetCurrency',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Target Currency',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'ratio',
|
||||||
|
'alias' => 'exchRatio',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Exchange Ratio',
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of filters
|
||||||
|
|
||||||
|
'filterable' => [
|
||||||
|
[
|
||||||
|
'column' => 'id',
|
||||||
|
'alias' => 'exchId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'Rate ID',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'source_currency',
|
||||||
|
'alias' => 'exchSourceCurrency',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Source Currency',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'target_currency',
|
||||||
|
'alias' => 'exchTargetCurrency',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Target Currency',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
|
||||||
|
'searchable' => [
|
||||||
|
[
|
||||||
|
'column' => 'source_currency',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Source Currency',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'target_currency',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Target Currency',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//list of viable operators that will be used
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return $this->createExchangeRatesDataGrid()->render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,167 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\DataGrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inventory Sources DataGrid
|
||||||
|
*
|
||||||
|
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
class InventorySourcesDataGrid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Data Grid implementation.
|
||||||
|
*
|
||||||
|
* @var InventorySourcesDataGrid
|
||||||
|
* for Inventory Sources
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function createInventorySourcesDataGrid()
|
||||||
|
{
|
||||||
|
return DataGrid::make([
|
||||||
|
'name' => 'Inventory Sources',
|
||||||
|
'table' => 'inventory_sources',
|
||||||
|
'select' => 'id',
|
||||||
|
'perpage' => 5,
|
||||||
|
'aliased' => false, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' =>[
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really edit this record?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
], [
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to delete this record?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'join' => [
|
||||||
|
// [
|
||||||
|
// 'join' => 'leftjoin',
|
||||||
|
// 'table' => 'roles as r',
|
||||||
|
// 'primaryKey' => 'u.role_id',
|
||||||
|
// 'condition' => '=',
|
||||||
|
// 'secondaryKey' => 'r.id',
|
||||||
|
// ]
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
|
||||||
|
'columns' => [
|
||||||
|
|
||||||
|
[
|
||||||
|
'name' => 'id',
|
||||||
|
'alias' => 'inventoryID',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'code',
|
||||||
|
'alias' => 'inventoryCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'alias' => 'inventoryName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'priority',
|
||||||
|
'alias' => 'inventoryPriority',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Priority',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'status',
|
||||||
|
'alias' => 'inventoryStatus',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Status',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of filters
|
||||||
|
|
||||||
|
'filterable' => [
|
||||||
|
[
|
||||||
|
'column' => 'id',
|
||||||
|
'alias' => 'inventoryId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'code',
|
||||||
|
'alias' => 'inventoryCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'alias' => 'inventoryName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
|
||||||
|
'searchable' => [
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'code',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//list of viable operators that will be used
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return $this->createInventorySourcesDataGrid()->render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,155 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\DataGrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Locales DataGrid
|
||||||
|
*
|
||||||
|
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
class LocalesDataGrid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Data Grid implementation.
|
||||||
|
*
|
||||||
|
* @var CountryDataGrid
|
||||||
|
* for countries
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function createCountryDataGrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
return DataGrid::make([
|
||||||
|
'name' => 'Locales',
|
||||||
|
'table' => 'locales',
|
||||||
|
'select' => 'id',
|
||||||
|
'perpage' => 5,
|
||||||
|
'aliased' => false, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' =>[
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really edit this record?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
], [
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to delete this record?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'join' => [
|
||||||
|
// [
|
||||||
|
// 'join' => 'leftjoin',
|
||||||
|
// 'table' => 'roles as r',
|
||||||
|
// 'primaryKey' => 'u.role_id',
|
||||||
|
// 'condition' => '=',
|
||||||
|
// 'secondaryKey' => 'r.id',
|
||||||
|
// ]
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
|
||||||
|
'columns' => [
|
||||||
|
|
||||||
|
[
|
||||||
|
'name' => 'id',
|
||||||
|
'alias' => 'localeId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'code',
|
||||||
|
'alias' => 'localeCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'alias' => 'localeName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of filters
|
||||||
|
|
||||||
|
'filterable' => [
|
||||||
|
[
|
||||||
|
'column' => 'id',
|
||||||
|
'alias' => 'localeId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'code',
|
||||||
|
'alias' => 'localeCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'alias' => 'localeName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
|
||||||
|
'searchable' => [
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'code',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Code',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//list of viable operators that will be used
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return $this->createCountryDataGrid()->render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,215 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\DataGrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\ProductGrid;
|
||||||
|
use Webkul\Channel\Repositories\ChannelRepository;
|
||||||
|
use Webkul\Product\Repositories\ProductRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Product DataGrid
|
||||||
|
*
|
||||||
|
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
class ProductDataGrid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Data Grid implementation.
|
||||||
|
* @var ProductDataGrid
|
||||||
|
* for Products
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function createProductDataGrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
return ProductGrid::make([
|
||||||
|
'name' => 'Products',
|
||||||
|
'table' => 'products as prods',
|
||||||
|
'select' => 'prods.id',
|
||||||
|
'perpage' => 10,
|
||||||
|
'aliased' => true, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' =>[
|
||||||
|
// [
|
||||||
|
// 'route' => route('admin.datagrid.delete'),
|
||||||
|
// 'method' => 'DELETE',
|
||||||
|
// 'label' => 'Delete',
|
||||||
|
// 'type' => 'button',
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
], [
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'attributeColumns' => [
|
||||||
|
'name', 'price'
|
||||||
|
],
|
||||||
|
|
||||||
|
'join' => [
|
||||||
|
|
||||||
|
//for getting name of attrib family.
|
||||||
|
[
|
||||||
|
'join' => 'leftjoin',
|
||||||
|
'table' => 'attribute_families as attfam',
|
||||||
|
'primaryKey' => 'prods.attribute_family_id',
|
||||||
|
'condition' => '=',
|
||||||
|
'secondaryKey' => 'attfam.id',
|
||||||
|
],
|
||||||
|
|
||||||
|
//for getting the attribute values.
|
||||||
|
[
|
||||||
|
'join' => 'leftjoin',
|
||||||
|
'table' => 'product_attribute_values as pav',
|
||||||
|
'primaryKey' => 'prods.id',
|
||||||
|
'condition' => '=',
|
||||||
|
'secondaryKey' => 'pav.product_id',
|
||||||
|
'withAttributes' => true
|
||||||
|
],
|
||||||
|
|
||||||
|
//for getting the inventory quantity of a product
|
||||||
|
[
|
||||||
|
'join' => 'leftjoin',
|
||||||
|
'table' => 'product_inventories as pi',
|
||||||
|
'primaryKey' => 'prods.id',
|
||||||
|
'condition' => '=',
|
||||||
|
'secondaryKey' => 'pi.product_id',
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
|
||||||
|
'columns' => [
|
||||||
|
//name, alias, type, label, sortable
|
||||||
|
[
|
||||||
|
'name' => 'prods.id',
|
||||||
|
'alias' => 'productID',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'prods.sku',
|
||||||
|
'alias' => 'productCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'SKU',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'attfam.name',
|
||||||
|
'alias' => 'FamilyName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Family Name',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'pi.qty',
|
||||||
|
'alias' => 'ProductQuantity',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Product Quatity',
|
||||||
|
'sortable' => false,
|
||||||
|
],
|
||||||
|
// [
|
||||||
|
// 'name' => 'pav.attribute_id',
|
||||||
|
// 'alias' => 'AttributeID',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Attribute ID',
|
||||||
|
// 'sortable' => false,
|
||||||
|
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
'filterable' => [
|
||||||
|
//column, type, and label
|
||||||
|
[
|
||||||
|
'name' => 'prods.id',
|
||||||
|
'alias' => 'productID',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'prods.sku',
|
||||||
|
'alias' => 'productCode',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'SKU',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'attfam.name',
|
||||||
|
'alias' => 'FamilyName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Family Name',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'pi.qty',
|
||||||
|
'alias' => 'ProductQuantity',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Product Quatity',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
|
||||||
|
'searchable' => [
|
||||||
|
//column, type and label
|
||||||
|
[
|
||||||
|
'column' => 'prods.id',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'prods.sku',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'SKU',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'attfam.name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Family Name',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'pi.qty',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Product Quatity',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//list of viable operators that will be used
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return $this->createProductDataGrid()->render();
|
||||||
|
// return $this->getProducts();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,156 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\DataGrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User Roles DataGrid
|
||||||
|
*
|
||||||
|
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
class RolesDataGrid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Data Grid implementation.
|
||||||
|
*
|
||||||
|
* @var RolesDataGrid
|
||||||
|
* for Roles
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public function createRolesDataGrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
return DataGrid::make([
|
||||||
|
'name' => 'Roles',
|
||||||
|
'table' => 'roles',
|
||||||
|
'select' => 'id',
|
||||||
|
'perpage' => 5,
|
||||||
|
'aliased' => false, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' =>[
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really edit this record?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
], [
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to delete this record?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'join' => [
|
||||||
|
// [
|
||||||
|
// 'join' => 'leftjoin',
|
||||||
|
// 'table' => 'roles as r',
|
||||||
|
// 'primaryKey' => 'u.role_id',
|
||||||
|
// 'condition' => '=',
|
||||||
|
// 'secondaryKey' => 'r.id',
|
||||||
|
// ]
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
|
||||||
|
'columns' => [
|
||||||
|
|
||||||
|
[
|
||||||
|
'name' => 'id',
|
||||||
|
'alias' => 'roleId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'name',
|
||||||
|
'alias' => 'roleName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'permission_type',
|
||||||
|
'alias' => 'rolePermissionType',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Permission Type',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of filters
|
||||||
|
|
||||||
|
'filterable' => [
|
||||||
|
[
|
||||||
|
'column' => 'id',
|
||||||
|
'alias' => 'roleId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'alias' => 'roleName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'permission_type',
|
||||||
|
'alias' => 'rolePermissionType',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Permission Type',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
|
||||||
|
'searchable' => [
|
||||||
|
[
|
||||||
|
'column' => 'name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'permission_type',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Permission Type',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//list of viable operators that will be used
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return $this->createRolesDataGrid()->render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,160 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\DataGrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sliders DataGrid
|
||||||
|
*
|
||||||
|
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
class SliderDataGrid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Data Grid implementation.
|
||||||
|
*
|
||||||
|
* @var SliderDataGrid
|
||||||
|
* for Sliders
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function createSliderDataGrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
return DataGrid::make([
|
||||||
|
'name' => 'Sliders',
|
||||||
|
'table' => 'sliders as s',
|
||||||
|
'select' => 's.id',
|
||||||
|
'perpage' => 5,
|
||||||
|
'aliased' => true, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' =>[
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really edit this record?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
], [
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to delete this record?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'join' => [
|
||||||
|
[
|
||||||
|
'join' => 'leftjoin',
|
||||||
|
'table' => 'channels as c',
|
||||||
|
'primaryKey' => 's.channel_id',
|
||||||
|
'condition' => '=',
|
||||||
|
'secondaryKey' => 'c.id',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
|
||||||
|
'columns' => [
|
||||||
|
|
||||||
|
[
|
||||||
|
'name' => 's.id',
|
||||||
|
'alias' => 'sliderId',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'ID',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 's.title',
|
||||||
|
'alias' => 'sliderTitle',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'title',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 's.channel_id',
|
||||||
|
'alias' => 'channelId',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Channel ID',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'c.name',
|
||||||
|
'alias' => 'channelName',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Channel Name',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of filters
|
||||||
|
|
||||||
|
'filterable' => [
|
||||||
|
// [
|
||||||
|
// 'column' => 'id',
|
||||||
|
// 'alias' => 'locale_id',
|
||||||
|
// 'type' => 'number',
|
||||||
|
// 'label' => 'ID',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'column' => 'code',
|
||||||
|
// 'alias' => 'locale_code',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Code',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'column' => 'name',
|
||||||
|
// 'alias' => 'locale_name',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Name',
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
|
||||||
|
'searchable' => [
|
||||||
|
// [
|
||||||
|
// 'column' => 'name',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Name',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'column' => 'code',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Code',
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
|
||||||
|
//list of viable operators that will be used
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return $this->createSliderDataGrid()->render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,198 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\DataGrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Users DataGrid
|
||||||
|
*
|
||||||
|
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
class UserDataGrid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Data Grid implementation.
|
||||||
|
*
|
||||||
|
* @var UserDataGrid
|
||||||
|
* for admin users
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function createUserDataGrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
return DataGrid::make([
|
||||||
|
'name' => 'Admins',
|
||||||
|
'table' => 'admins as u',
|
||||||
|
'select' => 'u.id',
|
||||||
|
'perpage' => 5,
|
||||||
|
'aliased' => true, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' =>[
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
],
|
||||||
|
// [
|
||||||
|
// 'route' => route('admin.datagrid.index'),
|
||||||
|
// 'method' => 'POST',
|
||||||
|
// 'label' => 'View Grid',
|
||||||
|
// 'type' => 'select',
|
||||||
|
// 'options' =>[
|
||||||
|
// 1 => 'Edit',
|
||||||
|
// 2 => 'Set',
|
||||||
|
// 3 => 'Change Status'
|
||||||
|
// ]
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'join' => [
|
||||||
|
[
|
||||||
|
'join' => 'leftjoin',
|
||||||
|
'table' => 'roles as r',
|
||||||
|
'primaryKey' => 'u.role_id',
|
||||||
|
'condition' => '=',
|
||||||
|
'secondaryKey' => 'r.id',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
'columns' => [
|
||||||
|
[
|
||||||
|
'name' => 'u.id',
|
||||||
|
'alias' => 'ID',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Admin ID',
|
||||||
|
'sortable' => true,
|
||||||
|
'wrapper' => function ($value, $object) {
|
||||||
|
return '<a class="color-red">' . $object->ID . '</a>';
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'u.name',
|
||||||
|
'alias' => 'Name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
'sortable' => true,
|
||||||
|
'wrapper' => function ($value, $object) {
|
||||||
|
return '<a class="color-red">' . $object->Name . '</a>';
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'u.email',
|
||||||
|
'alias' => 'Email',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'E-Mail',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'r.name',
|
||||||
|
'alias' => 'xa',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Role Name',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'r.id',
|
||||||
|
'alias' => 'xc',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Role ID',
|
||||||
|
'sortable' => true,
|
||||||
|
],
|
||||||
|
// [
|
||||||
|
// 'name' => 'a.first_name',
|
||||||
|
// 'type' => 'string',
|
||||||
|
// 'label' => 'Admin Name',
|
||||||
|
// 'sortable' => true,
|
||||||
|
// 'filterable' => true,
|
||||||
|
// // will create on run time query
|
||||||
|
// // 'filter' => [
|
||||||
|
// // 'function' => 'where', // orwhere
|
||||||
|
// // 'condition' => ['name', '=', 'Admin'] // multiarray
|
||||||
|
// // ],
|
||||||
|
// 'attributes' => [
|
||||||
|
// 'class' => 'class-a class-b',
|
||||||
|
// 'data-attr' => 'whatever you want',
|
||||||
|
// 'onclick' => "window.alert('alert from datagrid column')"
|
||||||
|
// ],
|
||||||
|
// 'wrapper' => function ($value, $object) {
|
||||||
|
// return '<a href="'.$value.'">' . $object->first_name . '</a>';
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
|
||||||
|
],
|
||||||
|
//don't use aliasing in case of filters
|
||||||
|
'filterable' => [
|
||||||
|
[
|
||||||
|
'column' => 'u.name',
|
||||||
|
'alias' => 'Name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'u.id',
|
||||||
|
'alias' => 'ID',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'Admin ID'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'r.id',
|
||||||
|
'alias' => 'xc',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'Role ID'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
'searchable' => [
|
||||||
|
[
|
||||||
|
'column' => 'u.email',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'E-Mail'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'column' => 'u.name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render() {
|
||||||
|
|
||||||
|
return $this->createUserDataGrid()->render();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,151 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\Datagrids;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
class User
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create datagrid.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function createDatagrid()
|
||||||
|
{
|
||||||
|
|
||||||
|
return DataGrid::make([
|
||||||
|
'name' => 'Admins',
|
||||||
|
'table' => 'admins as u',
|
||||||
|
'select' => 'u.id',
|
||||||
|
'perpage' => 5,
|
||||||
|
'aliased' => true, //use this with false as default and true in case of joins
|
||||||
|
|
||||||
|
'massoperations' => [
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'actions' => [
|
||||||
|
[
|
||||||
|
'type' => 'Edit',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
], [
|
||||||
|
'type' => 'Delete',
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'confirm_text' => 'Do you really want to do this?',
|
||||||
|
'icon' => 'icon trash-icon',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'join' => [
|
||||||
|
[
|
||||||
|
'join' => 'leftjoin',
|
||||||
|
'table' => 'roles as r',
|
||||||
|
'primaryKey' => 'u.role_id',
|
||||||
|
'condition' => '=',
|
||||||
|
'secondaryKey' => 'r.id',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
|
||||||
|
//use aliasing on secodary columns if join is performed
|
||||||
|
'columns' => [
|
||||||
|
[
|
||||||
|
'name' => 'u.id',
|
||||||
|
'alias' => 'ID',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Admin ID',
|
||||||
|
'sortable' => true,
|
||||||
|
'wrapper' => function ($value, $object) {
|
||||||
|
return '<a class="color-red">' . $object->ID . '</a>';
|
||||||
|
},
|
||||||
|
], [
|
||||||
|
'name' => 'u.name',
|
||||||
|
'alias' => 'Name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name',
|
||||||
|
'sortable' => true,
|
||||||
|
'wrapper' => function ($value, $object) {
|
||||||
|
return '<a class="color-red">' . $object->Name . '</a>';
|
||||||
|
},
|
||||||
|
], [
|
||||||
|
'name' => 'u.email',
|
||||||
|
'alias' => 'Email',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'E-Mail',
|
||||||
|
'sortable' => true,
|
||||||
|
], [
|
||||||
|
'name' => 'r.name',
|
||||||
|
'alias' => 'xa',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Role Name',
|
||||||
|
'sortable' => true,
|
||||||
|
], [
|
||||||
|
'name' => 'r.id',
|
||||||
|
'alias' => 'xc',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Role ID',
|
||||||
|
'sortable' => true,
|
||||||
|
]
|
||||||
|
],
|
||||||
|
//don't use aliasing in case of filters
|
||||||
|
'filterable' => [
|
||||||
|
[
|
||||||
|
'column' => 'u.name',
|
||||||
|
'alias' => 'Name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name'
|
||||||
|
], [
|
||||||
|
'column' => 'u.email',
|
||||||
|
'alias' => 'Email',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Email'
|
||||||
|
], [
|
||||||
|
'column' => 'u.id',
|
||||||
|
'alias' => 'ID',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'Admin ID'
|
||||||
|
], [
|
||||||
|
'column' => 'r.id',
|
||||||
|
'alias' => 'Role_ID',
|
||||||
|
'type' => 'number',
|
||||||
|
'label' => 'Role ID'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
//don't use aliasing in case of searchables
|
||||||
|
'searchable' => [
|
||||||
|
[
|
||||||
|
'column' => 'u.email',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'E-Mail'
|
||||||
|
], [
|
||||||
|
'column' => 'u.name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Name'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqs' => "<>",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return $this->createDatagrid()->render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -19,8 +19,14 @@ class DashboardController extends Controller
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
|
protected $_config;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->_config = request('_config');
|
||||||
|
}
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return view('admin::dashboard.index');
|
return view('admin::dashboard.index');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,181 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
use Illuminate\Routing\Controller;
|
||||||
|
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DataGrid controller
|
||||||
|
*
|
||||||
|
* @author Nikhil Malik <nikhil@webkul.com> @ysmnikhil
|
||||||
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||||
|
*/
|
||||||
|
class DataGridController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
DataGrid::make([
|
||||||
|
'name' => 'Admin Datagrid',
|
||||||
|
'table' => 'admins as u',
|
||||||
|
'select' => 'u.id',
|
||||||
|
'aliased' => true , //boolean to validate aliasing on the basis of this.
|
||||||
|
'perpage' => 2,
|
||||||
|
'filterable' => [
|
||||||
|
[
|
||||||
|
'column' => 'u.id',
|
||||||
|
'type' => 'integer',
|
||||||
|
'label' => 'Admin ID'
|
||||||
|
], [
|
||||||
|
'column' => 'u.email',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Admin E-Mail',
|
||||||
|
], [
|
||||||
|
'column' => 'u.name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Admin Name',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'searchables' =>[
|
||||||
|
[
|
||||||
|
'name' => 'u.id',
|
||||||
|
'label' => 'ID',
|
||||||
|
'label' => 'Admin ID',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'u.name',
|
||||||
|
'label' => 'Name',
|
||||||
|
'label' => 'Admin Name',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'join' => [
|
||||||
|
[
|
||||||
|
'join' => 'leftjoin',
|
||||||
|
'table' => 'roles as r',
|
||||||
|
'primaryKey' => 'u.role_id',
|
||||||
|
'condition' => '=',
|
||||||
|
'secondaryKey' => 'r.id',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'columns' => [
|
||||||
|
[
|
||||||
|
'name' => 'u.id',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Admin ID',
|
||||||
|
'sortable' => true,
|
||||||
|
'filterable' => true
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'u.email',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Admin E-Mail',
|
||||||
|
'sortable' => true,
|
||||||
|
'filterable' => true
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'u.name',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Admin Name',
|
||||||
|
'sortable' => true,
|
||||||
|
'filterable' => true,
|
||||||
|
// will create on run time query
|
||||||
|
// 'filter' => [
|
||||||
|
// 'function' => 'orwhere', // orwhere
|
||||||
|
// 'condition' => ['name', 'like', 'u'] // multiarray
|
||||||
|
// ],
|
||||||
|
'attributes' => [
|
||||||
|
'class' => 'class-a class-b',
|
||||||
|
'data-attr' => 'whatever you want',
|
||||||
|
'onclick' => "window.alert('alert from datagrid column')"
|
||||||
|
],
|
||||||
|
'wrapper' => function ($value, $object) {
|
||||||
|
return '<a href="'.$value.'">' . $object->name . '</a>';
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'r.name as x',
|
||||||
|
'type' => 'string',
|
||||||
|
'label' => 'Admin\'s Role',
|
||||||
|
'sortable' => true,
|
||||||
|
'filterable' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'r.id as xx',
|
||||||
|
'type' => 'integer',
|
||||||
|
'label' => 'Role ID',
|
||||||
|
'sortable' => false,
|
||||||
|
'filterable' => false
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'operators' => [
|
||||||
|
'eq' => "=",
|
||||||
|
'lt' => "<",
|
||||||
|
'gt' => ">",
|
||||||
|
'lte' => "<=",
|
||||||
|
'gte' => ">=",
|
||||||
|
'neqn' => "!=",
|
||||||
|
'ceq' => "<=>",
|
||||||
|
'like' => "like",
|
||||||
|
'nlike' => "not like",
|
||||||
|
],
|
||||||
|
'mass_operations' =>[
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button',
|
||||||
|
|
||||||
|
]
|
||||||
|
],
|
||||||
|
// 'css' => []
|
||||||
|
|
||||||
|
]);
|
||||||
|
$result = DataGrid::render();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//for performing mass actions
|
||||||
|
public function massAction()
|
||||||
|
{
|
||||||
|
$make = [
|
||||||
|
'operations' =>[
|
||||||
|
// [
|
||||||
|
// 'route' => 'datagrid/update',
|
||||||
|
// 'method' => 'post',
|
||||||
|
// 'label' => 'Update',
|
||||||
|
// 'type' => 'select',
|
||||||
|
// 'name' => 'status',
|
||||||
|
// 'values' => [
|
||||||
|
// [
|
||||||
|
// 'label' => 'Enable',
|
||||||
|
// 'value' => 1
|
||||||
|
// ], [
|
||||||
|
// 'label' => 'Disable',
|
||||||
|
// 'value' => 0
|
||||||
|
// ]
|
||||||
|
// ],
|
||||||
|
// ],
|
||||||
|
[
|
||||||
|
'route' => route('admin.datagrid.delete'),
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'label' => 'Delete',
|
||||||
|
'type' => 'button'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
];
|
||||||
|
$result = DataGrid::makeMassAction($make);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function massDelete(Request $r)
|
||||||
|
{
|
||||||
|
return $r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,36 +1,318 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
Route::group(['middleware' => ['web']], function () {
|
Route::group(['middleware' => ['web']], function () {
|
||||||
|
|
||||||
Route::prefix('admin')->group(function () {
|
Route::prefix('admin')->group(function () {
|
||||||
Route::get('/login', 'Webkul\User\Http\Controllers\SeesionController@create')->defaults('_config', [
|
// Login Routes
|
||||||
'view' => 'admin::sessions.create'
|
Route::get('/login', 'Webkul\User\Http\Controllers\SessionController@create')->defaults('_config', [
|
||||||
|
'view' => 'admin::users.sessions.create'
|
||||||
])->name('admin.session.create');
|
])->name('admin.session.create');
|
||||||
|
|
||||||
Route::post('/login', 'Webkul\User\Http\Controllers\SeesionController@store')->defaults('_config', [
|
Route::post('/login', 'Webkul\User\Http\Controllers\SessionController@store')->defaults('_config', [
|
||||||
'redirect' => 'admin/dashboard'
|
'redirect' => 'admin.dashboard.index'
|
||||||
])->name('admin.session.store');
|
])->name('admin.forget-password.store');
|
||||||
|
|
||||||
Route::group(['middleware' => ['admin']], function () {
|
|
||||||
Route::get('/logout', 'Webkul\User\Http\Controllers\SeesionController@destroy')->defaults('_config', [
|
// Forget Password Routes
|
||||||
'redirect' => 'admin/login'
|
Route::get('/forget-password', 'Webkul\User\Http\Controllers\ForgetPasswordController@create')->defaults('_config', [
|
||||||
|
'view' => 'admin::users.forget-password.create'
|
||||||
|
])->name('admin.forget-password.create');
|
||||||
|
|
||||||
|
Route::post('/forget-password', 'Webkul\User\Http\Controllers\ForgetPasswordController@store')->name('admin.forget-password.store');
|
||||||
|
|
||||||
|
|
||||||
|
// Reset Password Routes
|
||||||
|
Route::get('/reset-password/{token}', 'Webkul\User\Http\Controllers\ResetPasswordController@create')->defaults('_config', [
|
||||||
|
'view' => 'admin::users.reset-password.create'
|
||||||
|
])->name('admin.reset-password.create');
|
||||||
|
|
||||||
|
Route::post('/reset-password', 'Webkul\User\Http\Controllers\ResetPasswordController@store')->defaults('_config', [
|
||||||
|
'redirect' => 'admin.dashboard.index'
|
||||||
|
])->name('admin.reset-password.store');
|
||||||
|
|
||||||
|
|
||||||
|
// Admin Routes
|
||||||
|
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');
|
])->name('admin.session.destroy');
|
||||||
|
|
||||||
|
|
||||||
|
// Dashboard Route
|
||||||
Route::get('/dashboard', 'Webkul\Admin\Http\Controllers\DashboardController@index')->name('admin.dashboard.index');
|
Route::get('/dashboard', 'Webkul\Admin\Http\Controllers\DashboardController@index')->name('admin.dashboard.index');
|
||||||
|
|
||||||
|
|
||||||
|
// 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');
|
||||||
|
|
||||||
|
Route::post('/products/create', 'Webkul\Product\Http\Controllers\ProductController@store')->defaults('_config', [
|
||||||
|
'redirect' => 'admin.catalog.products.edit'
|
||||||
|
])->name('admin.catalog.products.store');
|
||||||
|
|
||||||
|
Route::get('/products/edit/{id}', 'Webkul\Product\Http\Controllers\ProductController@edit')->defaults('_config', [
|
||||||
|
'view' => 'admin::catalog.products.edit'
|
||||||
|
])->name('admin.catalog.products.edit');
|
||||||
|
|
||||||
|
Route::put('/products/edit/{id}', 'Webkul\Product\Http\Controllers\ProductController@update')->defaults('_config', [
|
||||||
|
'redirect' => 'admin.catalog.products.index'
|
||||||
|
])->name('admin.catalog.products.update');
|
||||||
|
|
||||||
|
|
||||||
|
// 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');
|
||||||
|
|
||||||
|
Route::get('/attributes/create', 'Webkul\Attribute\Http\Controllers\AttributeController@create')->defaults('_config', [
|
||||||
|
'view' => 'admin::catalog.attributes.create'
|
||||||
|
])->name('admin.catalog.attributes.create');
|
||||||
|
|
||||||
|
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');
|
||||||
|
|
||||||
|
Route::any('datagrid/massaction/delete', 'Webkul\Admin\Http\Controllers\DataGridController@massDelete')->name('admin.datagrid.delete');
|
||||||
|
|
||||||
|
// User Routes
|
||||||
Route::get('/users', 'Webkul\User\Http\Controllers\UserController@index')->defaults('_config', [
|
Route::get('/users', 'Webkul\User\Http\Controllers\UserController@index')->defaults('_config', [
|
||||||
'view' => 'admin::users.index'
|
'view' => 'admin::users.users.index'
|
||||||
])->name('admin.users.index');
|
])->name('admin.users.index');
|
||||||
|
|
||||||
|
Route::get('/users/create', 'Webkul\User\Http\Controllers\UserController@create')->defaults('_config', [
|
||||||
|
'view' => 'admin::users.users.create'
|
||||||
|
])->name('admin.users.create');
|
||||||
|
|
||||||
|
Route::post('/users/create', 'Webkul\User\Http\Controllers\UserController@store')->defaults('_config', [
|
||||||
|
'redirect' => 'admin.users.index'
|
||||||
|
])->name('admin.users.store');
|
||||||
|
|
||||||
|
Route::get('/users/edit/{id}', 'Webkul\User\Http\Controllers\UserController@edit')->defaults('_config', [
|
||||||
|
'view' => 'admin::users.users.edit'
|
||||||
|
])->name('admin.users.edit');
|
||||||
|
|
||||||
|
Route::put('/users/edit/{id}', 'Webkul\User\Http\Controllers\UserController@update')->defaults('_config', [
|
||||||
|
'redirect' => 'admin.users.index'
|
||||||
|
])->name('admin.users.update');
|
||||||
|
|
||||||
|
|
||||||
|
// User Role Routes
|
||||||
|
Route::get('/roles', 'Webkul\User\Http\Controllers\RoleController@index')->defaults('_config', [
|
||||||
|
'view' => 'admin::users.roles.index'
|
||||||
|
])->name('admin.roles.index');
|
||||||
|
|
||||||
|
Route::get('/roles/create', 'Webkul\User\Http\Controllers\RoleController@create')->defaults('_config', [
|
||||||
|
'view' => 'admin::users.roles.create'
|
||||||
|
])->name('admin.roles.create');
|
||||||
|
|
||||||
|
Route::post('/roles/create', 'Webkul\User\Http\Controllers\RoleController@store')->defaults('_config', [
|
||||||
|
'redirect' => 'admin.roles.index'
|
||||||
|
])->name('admin.roles.store');
|
||||||
|
|
||||||
|
Route::get('/roles/edit/{id}', 'Webkul\User\Http\Controllers\RoleController@edit')->defaults('_config', [
|
||||||
|
'view' => 'admin::users.roles.edit'
|
||||||
|
])->name('admin.roles.edit');
|
||||||
|
|
||||||
|
Route::put('/roles/edit/{id}', 'Webkul\User\Http\Controllers\RoleController@update')->defaults('_config', [
|
||||||
|
'redirect' => 'admin.roles.index'
|
||||||
|
])->name('admin.roles.update');
|
||||||
|
|
||||||
|
|
||||||
|
// Locale Routes
|
||||||
|
Route::get('/locales', 'Webkul\Core\Http\Controllers\LocaleController@index')->defaults('_config', [
|
||||||
|
'view' => 'admin::settings.locales.index'
|
||||||
|
])->name('admin.locales.index');
|
||||||
|
|
||||||
|
Route::get('/locales/create', 'Webkul\Core\Http\Controllers\LocaleController@create')->defaults('_config', [
|
||||||
|
'view' => 'admin::settings.locales.create'
|
||||||
|
])->name('admin.locales.create');
|
||||||
|
|
||||||
|
Route::post('/locales/create', 'Webkul\Core\Http\Controllers\LocaleController@store')->defaults('_config', [
|
||||||
|
'redirect' => 'admin.locales.index'
|
||||||
|
])->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');
|
||||||
|
|
||||||
|
|
||||||
|
// Currency 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');
|
||||||
|
|
||||||
|
|
||||||
|
// Exchange Rates 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\Core\Http\Controllers\ChannelController@index')->defaults('_config', [
|
||||||
|
'view' => 'admin::settings.channels.index'
|
||||||
|
])->name('admin.channels.index');
|
||||||
|
|
||||||
|
Route::get('/channels/create', 'Webkul\Core\Http\Controllers\ChannelController@create')->defaults('_config', [
|
||||||
|
'view' => 'admin::settings.channels.create'
|
||||||
|
])->name('admin.channels.create');
|
||||||
|
|
||||||
|
Route::post('/channels/create', 'Webkul\Core\Http\Controllers\ChannelController@store')->defaults('_config', [
|
||||||
|
'redirect' => 'admin.channels.index'
|
||||||
|
])->name('admin.channels.store');
|
||||||
|
|
||||||
|
Route::get('/channels/edit/{id}', 'Webkul\Core\Http\Controllers\ChannelController@edit')->defaults('_config', [
|
||||||
|
'view' => 'admin::settings.channels.edit'
|
||||||
|
])->name('admin.channels.edit');
|
||||||
|
|
||||||
|
Route::put('/channels/edit/{id}', 'Webkul\Core\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', [
|
Route::get('/account', 'Webkul\User\Http\Controllers\AccountController@edit')->defaults('_config', [
|
||||||
'view' => 'admin::account.edit'
|
'view' => 'admin::account.edit'
|
||||||
])->name('admin.account.edit');
|
])->name('admin.account.edit');
|
||||||
|
|
||||||
Route::put('/account', 'Webkul\User\Http\Controllers\AccountController@update')->name('admin.account.update');
|
Route::put('/account', 'Webkul\User\Http\Controllers\AccountController@update')->name('admin.account.update');
|
||||||
|
|
||||||
Route::get('/permissions', 'Webkul\User\Http\Controllers\PermissionController@index')->defaults('_config', [
|
// Admin Store Front Settings Route
|
||||||
'view' => 'admin::permissions.index'
|
Route::get('/slider','Webkul\Shop\Http\Controllers\SliderController@index')->defaults('_config',[
|
||||||
])->name('admin.permissions.index');
|
'view' => 'admin::settings.sliders.index'
|
||||||
|
])->name('admin.sliders.index');
|
||||||
|
|
||||||
|
// Admin Store Front Settings Route
|
||||||
|
Route::get('/slider/create','Webkul\Shop\Http\Controllers\SliderController@create')->defaults('_config',[
|
||||||
|
'view' => 'admin::settings.sliders.create'
|
||||||
|
])->name('admin.sliders.create');
|
||||||
|
|
||||||
|
Route::post('/slider/create','Webkul\Shop\Http\Controllers\SliderController@store')->defaults('_config',[
|
||||||
|
'redirect' => 'admin::sliders.index'
|
||||||
|
])->name('admin.sliders.store');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin;
|
||||||
|
|
||||||
|
class ProductFormAccordian {
|
||||||
|
|
||||||
|
public $items = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shortcut method for create a Product Form Accordian with a callback.
|
||||||
|
* This will allow you to do things like fire an event on creation.
|
||||||
|
*
|
||||||
|
* @param callable $callback Callback to use after the accordian creation
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
|
public static function create($callback) {
|
||||||
|
$accordian = new ProductFormAccordian();
|
||||||
|
$callback($accordian);
|
||||||
|
$accordian->items = $accordian->sortItems($accordian->items);
|
||||||
|
|
||||||
|
return $accordian;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a accordian item to the item stack
|
||||||
|
*
|
||||||
|
* @param string $key Dot seperated heirarchy
|
||||||
|
* @param string $name Text for the anchor
|
||||||
|
* @param string $view Blade file for accordian
|
||||||
|
* @param integer $sort Sorting index for the items
|
||||||
|
*/
|
||||||
|
public function add($key, $name, $view, $sort = 0)
|
||||||
|
{
|
||||||
|
array_push($this->items, [
|
||||||
|
'key' => $key,
|
||||||
|
'name' => $name,
|
||||||
|
'view' => $view,
|
||||||
|
'sort' => $sort
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to sort through the acl items and put them in order
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function sortItems($items) {
|
||||||
|
usort($items, function($a, $b) {
|
||||||
|
if ($a['sort'] == $b['sort']) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ($a['sort'] < $b['sort']) ? -1 : 1;
|
||||||
|
});
|
||||||
|
|
||||||
|
return $items;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -5,7 +5,7 @@ namespace Webkul\Admin\Providers;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Illuminate\Support\Facades\Event;
|
use Illuminate\Support\Facades\Event;
|
||||||
use Illuminate\Support\Facades\Blade;
|
use Illuminate\Support\Facades\Blade;
|
||||||
use Webkul\Ui\Menu;
|
use Webkul\Admin\Providers\EventServiceProvider;
|
||||||
|
|
||||||
class AdminServiceProvider extends ServiceProvider
|
class AdminServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
|
|
@ -18,49 +18,17 @@ class AdminServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
include __DIR__ . '/../Http/routes.php';
|
include __DIR__ . '/../Http/routes.php';
|
||||||
|
|
||||||
|
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'admin');
|
||||||
|
|
||||||
$this->publishes([
|
$this->publishes([
|
||||||
__DIR__ . '/../../publishable/assets' => public_path('vendor/webkul/admin/assets'),
|
__DIR__ . '/../../publishable/assets' => public_path('vendor/webkul/admin/assets'),
|
||||||
], 'public');
|
], 'public');
|
||||||
|
|
||||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/migrations');
|
|
||||||
|
|
||||||
$this->loadViewsFrom(__DIR__ . '/../Resources/views', 'admin');
|
$this->loadViewsFrom(__DIR__ . '/../Resources/views', 'admin');
|
||||||
|
|
||||||
$this->createAdminMenu();
|
|
||||||
|
|
||||||
$this->composeView();
|
$this->composeView();
|
||||||
|
|
||||||
Blade::directive('continue', function() { return "<?php continue; ?>"; });
|
$this->app->register(EventServiceProvider::class);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method fires an event for menu creation, any package can add their menu item by listening to the admin.menu.build event
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function createAdminMenu()
|
|
||||||
{
|
|
||||||
Event::listen('admin.menu.create', function() {
|
|
||||||
return Menu::create(function($menu) {
|
|
||||||
Event::fire('admin.menu.build', $menu);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
Event::listen('admin.menu.build', function($menu) {
|
|
||||||
$menu->add('dashboard', 'Dashboard', route('admin.dashboard.index'), 1, 'icon-dashboard');
|
|
||||||
|
|
||||||
$menu->add('configuration', 'Configure', route('admin.account.edit'), 6, 'icon-configuration');
|
|
||||||
|
|
||||||
$menu->add('configuration.account', 'My Account', route('admin.account.edit'), 1, '');
|
|
||||||
|
|
||||||
$menu->add('settings', 'Settings', '', 6, 'icon-settings');
|
|
||||||
|
|
||||||
$menu->add('settings.users', 'Users', route('admin.users.index'), 1, '');
|
|
||||||
|
|
||||||
$menu->add('settings.roles', 'Roles', route('admin.permissions.index'), 2, '');
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -70,27 +38,34 @@ class AdminServiceProvider extends ServiceProvider
|
||||||
*/
|
*/
|
||||||
protected function composeView()
|
protected function composeView()
|
||||||
{
|
{
|
||||||
view()->composer('admin::layouts.nav-left', function($view) {
|
view()->composer(['admin::catalog.products.create', 'admin::catalog.products.edit'], function ($view) {
|
||||||
$menu = current(Event::fire('admin.menu.create'));
|
$accordians = current(Event::fire('admin.catalog.products.accordian.create'));
|
||||||
$view->with('menu', $menu);
|
|
||||||
|
$view->with('form_accordians', $accordians);
|
||||||
});
|
});
|
||||||
|
|
||||||
view()->composer('admin::layouts.nav-aside', function($view) {
|
view()->composer(['admin::layouts.nav-left', 'admin::layouts.nav-aside', 'admin::layouts.tabs'], function ($view) {
|
||||||
$parentMenu = current(Event::fire('admin.menu.create'));
|
$menu = current(Event::fire('admin.menu.create'));
|
||||||
$menu = [];
|
|
||||||
foreach ($parentMenu->items as $item) {
|
|
||||||
$currentKey = current(explode('.', $parentMenu->currentKey));
|
|
||||||
if($item['key'] != $currentKey)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
$menu = [
|
$keys = explode('.', $menu->currentKey);
|
||||||
'items' => $parentMenu->sortItems($item['children']),
|
$subMenus = $tabs = [];
|
||||||
'current' => $parentMenu->current,
|
if (count($keys) > 1) {
|
||||||
'currentKey' => $parentMenu->currentKey
|
$subMenus = [
|
||||||
];
|
'items' => $menu->sortItems(array_get($menu->items, current($keys) . '.children')),
|
||||||
|
'current' => $menu->current,
|
||||||
|
'currentKey' => $menu->currentKey
|
||||||
|
];
|
||||||
|
|
||||||
|
if (count($keys) > 2) {
|
||||||
|
$tabs = [
|
||||||
|
'items' => $menu->sortItems(array_get($menu->items, implode('.children.', array_slice($keys, 0, 2)) . '.children')),
|
||||||
|
'current' => $menu->current,
|
||||||
|
'currentKey' => $menu->currentKey
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$view->with('menu', $menu);
|
$view->with('menu', $menu)->with('subMenus', $subMenus)->with('tabs', $tabs);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -101,9 +76,10 @@ class AdminServiceProvider extends ServiceProvider
|
||||||
*/
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->mergeConfigFrom(
|
// $this->mergeConfigFrom(
|
||||||
__DIR__ . '/../Config/auth.php', 'auth'
|
// __DIR__ . '/../Config/auth.php',
|
||||||
);
|
// 'auth'
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,142 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Webkul\Admin\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Illuminate\Support\Facades\Event;
|
||||||
|
use Illuminate\Support\Facades\View;
|
||||||
|
use Webkul\Ui\Menu;
|
||||||
|
use Webkul\Admin\ProductFormAccordian;
|
||||||
|
|
||||||
|
class EventServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Bootstrap services.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function boot()
|
||||||
|
{
|
||||||
|
$this->createAdminMenu();
|
||||||
|
|
||||||
|
$this->buildACL();
|
||||||
|
|
||||||
|
$this->registerACL();
|
||||||
|
|
||||||
|
$this->createProductFormAccordian();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method fires an event for menu creation, any package can add their menu item by listening to the admin.menu.build event
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function createAdminMenu()
|
||||||
|
{
|
||||||
|
Event::listen('admin.menu.create', function () {
|
||||||
|
return Menu::create(function ($menu) {
|
||||||
|
Event::fire('admin.menu.build', $menu);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
Event::listen('admin.menu.build', function ($menu) {
|
||||||
|
$menu->add('dashboard', 'Dashboard', 'admin.dashboard.index', 1, 'dashboard-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.countries.index', 6, 'settings-icon');
|
||||||
|
|
||||||
|
$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.sliders', 'Create Sliders', 'admin.sliders.index', 8, '');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build route based ACL
|
||||||
|
*
|
||||||
|
* @return voidbuildACL
|
||||||
|
*/
|
||||||
|
public function buildACL()
|
||||||
|
{
|
||||||
|
Event::listen('admin.acl.build', function ($acl) {
|
||||||
|
$acl->add('dashboard', 'Dashboard', 'admin.dashboard.index', 1);
|
||||||
|
|
||||||
|
$acl->add('configuration', 'Configure', 'admin.account.edit', 5);
|
||||||
|
|
||||||
|
$acl->add('settings', 'Settings', 'admin.users.index', 6);
|
||||||
|
|
||||||
|
$acl->add('settings.users', 'Users', 'admin.users.index', 1);
|
||||||
|
|
||||||
|
$acl->add('settings.users.users', 'Users', 'admin.users.index', 1);
|
||||||
|
|
||||||
|
$acl->add('settings.users.roles', 'Roles', 'admin.roles.index', 2);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers acl to entire application
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function registerACL()
|
||||||
|
{
|
||||||
|
$this->app->singleton('acl', function () {
|
||||||
|
return current(Event::fire('admin.acl.create'));
|
||||||
|
});
|
||||||
|
|
||||||
|
View::share('acl', app('acl'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method fires an event for accordian creation, any package can add their accordian item by listening to the admin.catalog.products.accordian.build event
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function createProductFormAccordian()
|
||||||
|
{
|
||||||
|
Event::listen('admin.catalog.products.accordian.create', function() {
|
||||||
|
return ProductFormAccordian::create(function($accordian) {
|
||||||
|
Event::fire('admin.catalog.products.accordian.build', $accordian);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
Event::listen('admin.catalog.products.accordian.build', function($accordian) {
|
||||||
|
$accordian->add('inventories', 'Inventories', 'admin::catalog.products.accordians.inventories', 1);
|
||||||
|
|
||||||
|
$accordian->add('images', 'Images', 'admin::catalog.products.accordians.images', 2);
|
||||||
|
|
||||||
|
$accordian->add('categories', 'Categories', 'admin::catalog.products.accordians.categories', 3);
|
||||||
|
|
||||||
|
$accordian->add('variations', 'Variations', 'admin::catalog.products.accordians.variations', 4);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
|
|
@ -1,24 +1,81 @@
|
||||||
window.jQuery = window.$ = $ = require('jquery');
|
window.jQuery = window.$ = $ = require("jquery");
|
||||||
window.Vue = require('vue');
|
window.Vue = require("vue");
|
||||||
window.VeeValidate = require('vee-validate');
|
window.VeeValidate = require("vee-validate");
|
||||||
|
|
||||||
Vue.use(VeeValidate);
|
Vue.use(VeeValidate);
|
||||||
|
|
||||||
|
Vue.component("datetime", require("./components/datetime"));
|
||||||
|
Vue.component("date", require("./components/date"));
|
||||||
|
require('flatpickr/dist/flatpickr.css');
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
const form = new Vue({
|
Vue.config.ignoredElements = [
|
||||||
el: 'form',
|
'option-wrapper',
|
||||||
|
'group-form',
|
||||||
mounted: function() {
|
'group-list'
|
||||||
this.addServerErrors()
|
];
|
||||||
|
|
||||||
|
var app = new Vue({
|
||||||
|
el: "#app",
|
||||||
|
|
||||||
|
data: {
|
||||||
|
modalIds: {}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.addServerErrors();
|
||||||
|
this.addFlashMessages();
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
addServerErrors: function() {
|
onSubmit(e) {
|
||||||
// this.errors.add('email', "Hello")
|
this.$validator.validateAll().then(result => {
|
||||||
// for (var key in serverErrors) {
|
if (result) {
|
||||||
// this.errors.add(key, serverErrors[key][0])
|
e.target.submit();
|
||||||
// }
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
addServerErrors() {
|
||||||
|
var scope = null;
|
||||||
|
for (var key in serverErrors) {
|
||||||
|
var inputNames = [];
|
||||||
|
key.split('.').forEach(function(chunk, index) {
|
||||||
|
if(index) {
|
||||||
|
inputNames.push('[' + chunk + ']')
|
||||||
|
} else {
|
||||||
|
inputNames.push(chunk)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
var inputName = inputNames.join('');
|
||||||
|
|
||||||
|
const field = this.$validator.fields.find({
|
||||||
|
name: inputName,
|
||||||
|
scope: scope
|
||||||
|
});
|
||||||
|
if (field) {
|
||||||
|
this.$validator.errors.add({
|
||||||
|
id: field.id,
|
||||||
|
field: inputName,
|
||||||
|
msg: serverErrors[key][0],
|
||||||
|
scope: scope
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
addFlashMessages() {
|
||||||
|
const flashes = this.$refs.flashes;
|
||||||
|
|
||||||
|
flashMessages.forEach(function(flash) {
|
||||||
|
flashes.addFlash(flash);
|
||||||
|
}, this);
|
||||||
|
},
|
||||||
|
|
||||||
|
showModal(id) {
|
||||||
|
this.$set(this.modalIds, id, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
<template>
|
||||||
|
<span>
|
||||||
|
<slot>
|
||||||
|
<input type="text" :name="name" class="control" :value="value" data-input>
|
||||||
|
</slot>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Flatpickr from 'flatpickr';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
name: String,
|
||||||
|
value: String,
|
||||||
|
},
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
datepicker: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted () {
|
||||||
|
var element = this.$el.getElementsByTagName('input')[0];
|
||||||
|
this.datepicker = new Flatpickr(
|
||||||
|
element, {
|
||||||
|
allowInput: true,
|
||||||
|
altFormat: 'Y-m-d H:i:s',
|
||||||
|
dateFormat: 'Y-m-d H:i:s'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
<template>
|
||||||
|
<span>
|
||||||
|
<slot>
|
||||||
|
<input type="text" :name="name" class="control" :value="value" data-input>
|
||||||
|
</slot>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Flatpickr from "flatpickr";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
name: String,
|
||||||
|
value: String
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
datepicker: null
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
var element = this.$el.getElementsByTagName("input")[0];
|
||||||
|
this.datepicker = new Flatpickr(element, {
|
||||||
|
allowInput: true,
|
||||||
|
altFormat: "Y-m-d H:i:s",
|
||||||
|
dateFormat: "Y-m-d H:i:s",
|
||||||
|
enableTime: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -11,14 +11,20 @@ body {
|
||||||
font-family: $font-family;
|
font-family: $font-family;
|
||||||
font-size: $font-size-base;
|
font-size: $font-size-base;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
position: static;
|
||||||
|
min-height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar-top {
|
.navbar-top {
|
||||||
height: 60px;
|
height: 60px;
|
||||||
background: #FFFFFF;
|
background: #ffffff;
|
||||||
font-size: 0;
|
font-size: 0;
|
||||||
@include box-shadow(0 3px 6px 0 rgba(0,0,0,0.05));
|
@include box-shadow(0 3px 6px 0 rgba(0, 0, 0, 0.05));
|
||||||
border-bottom: 1px solid $border-color;
|
border-bottom: 1px solid $border-color;
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 5;
|
||||||
|
|
||||||
.navbar-top-left {
|
.navbar-top-left {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
|
@ -38,7 +44,7 @@ body {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
||||||
.profile-info {
|
.profile-info {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
@ -53,7 +59,7 @@ body {
|
||||||
.dropdown-list {
|
.dropdown-list {
|
||||||
top: 63px;
|
top: 63px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
color: #000311;
|
color: #000311;
|
||||||
display: block;
|
display: block;
|
||||||
|
|
@ -61,7 +67,7 @@ body {
|
||||||
}
|
}
|
||||||
.role {
|
.role {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #8E8E8E;
|
color: #8e8e8e;
|
||||||
display: block;
|
display: block;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
@ -70,7 +76,7 @@ body {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar-left {
|
.navbar-left {
|
||||||
|
|
@ -84,7 +90,6 @@ body {
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
|
||||||
ul.menubar {
|
ul.menubar {
|
||||||
|
|
||||||
li.menu-item {
|
li.menu-item {
|
||||||
height: 90px;
|
height: 90px;
|
||||||
padding: 10px 5px;
|
padding: 10px 5px;
|
||||||
|
|
@ -93,12 +98,12 @@ body {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: #A2A2A2;
|
color: #a2a2a2;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
a {
|
a {
|
||||||
color: #0041FF;
|
color: #0041ff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -107,22 +112,25 @@ body {
|
||||||
|
|
||||||
.content-container {
|
.content-container {
|
||||||
padding-left: 90px;
|
padding-left: 90px;
|
||||||
width: 100%;
|
|
||||||
display: inline-block;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin-top: 60px;
|
margin-top: 60px;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
z-index: 1;
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
.aside-nav {
|
.aside-nav {
|
||||||
width: 280px;
|
width: 280px;
|
||||||
position: absolute;
|
position: fixed;
|
||||||
top: 0;
|
top: 60px;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
border-right: 1px solid $border-color;
|
border-right: 1px solid $border-color;
|
||||||
background: #F8F9FA;
|
background: #f8f9fa;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
|
overflow-y: auto;
|
||||||
|
z-index: 4;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
|
@ -143,20 +151,48 @@ body {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content-wrapper {
|
||||||
|
padding: 25px 25px 25px 305px;
|
||||||
|
// overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
padding: 25px;
|
padding: 25px 0;
|
||||||
padding-left: 305px;
|
|
||||||
|
&.full-page {
|
||||||
|
padding: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
.page-header {
|
.page-header {
|
||||||
display: block;
|
display: inline-block;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
.page-title {
|
.page-title {
|
||||||
float: left;
|
float: left;
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin-bottom: 0;
|
||||||
|
vertical-align: middle;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-action {
|
.page-action {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.control-group {
|
||||||
|
width: 180px;
|
||||||
|
display: inline-block;
|
||||||
|
margin-bottom: 0;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.control {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-content {
|
.page-content {
|
||||||
|
|
@ -164,4 +200,52 @@ body {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.control-group {
|
||||||
|
label {
|
||||||
|
width: 70%;
|
||||||
|
|
||||||
|
.locale {
|
||||||
|
float: right;
|
||||||
|
color: #8E8E8E;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//style for dummy datagrid
|
||||||
|
// .page-content {
|
||||||
|
// .table-container {
|
||||||
|
// .search-filter-wrapper {
|
||||||
|
// display: inline-block;
|
||||||
|
// box-sizing: border-box;
|
||||||
|
|
||||||
|
// width: 100%;
|
||||||
|
// padding-top: 7px;
|
||||||
|
// padding-bottom: 7px;
|
||||||
|
|
||||||
|
// .search-products {
|
||||||
|
// width: 300px;
|
||||||
|
// border: 2px solid $border-color;
|
||||||
|
// border-radius: 3px;
|
||||||
|
// height: 30px;
|
||||||
|
// padding-left: 5px;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// .icon-wrapper {
|
||||||
|
// margin: 0px;
|
||||||
|
// display: inline-block;
|
||||||
|
// vertical-align: middle;
|
||||||
|
// border: 1px solid #c7c7c7;
|
||||||
|
// border-radius: 4px;
|
||||||
|
// padding-left: 5px;
|
||||||
|
// padding-right: 5px;
|
||||||
|
|
||||||
|
// .search-icon {
|
||||||
|
// height: 24px;
|
||||||
|
// width: 24px;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,269 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'account' => [
|
||||||
|
'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' => [
|
||||||
|
'title' => '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' => [
|
||||||
|
'title' => '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',
|
||||||
|
'general' => 'General',
|
||||||
|
'product-type' => 'Product Type',
|
||||||
|
'simple' => 'Simple',
|
||||||
|
'configurable' => 'Configurable',
|
||||||
|
'familiy' => 'Attribute Family',
|
||||||
|
'sku' => 'SKU',
|
||||||
|
'configurable-attributes' => 'Configurable Attributes',
|
||||||
|
'attribute-header' => 'Attribute(s)',
|
||||||
|
'attribute-option-header' => 'Attribute Option(s)',
|
||||||
|
'no' => 'No',
|
||||||
|
'yes' => 'Yes',
|
||||||
|
'disabled' => 'Disabled',
|
||||||
|
'enabled' => 'Enabled',
|
||||||
|
'add-variant-btn-title' => 'Add Variant',
|
||||||
|
'name' => 'Name',
|
||||||
|
'qty' => 'Qty',
|
||||||
|
'price' => 'Price',
|
||||||
|
'weight' => 'Weight',
|
||||||
|
'status' => 'Status',
|
||||||
|
'enabled' => 'Enabled',
|
||||||
|
'disabled' => 'Disabled',
|
||||||
|
'add-variant-title' => 'Add Variant',
|
||||||
|
'variant-already-exist-message' => 'Variant with same attribute options already exists.',
|
||||||
|
'add-image-btn-title' => 'Add Image'
|
||||||
|
],
|
||||||
|
'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',
|
||||||
|
'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',
|
||||||
|
'admin_name' => 'Admin Name',
|
||||||
|
'is_visible_on_front' => 'Visible on Product View Page on Front-end'
|
||||||
|
],
|
||||||
|
'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' => [
|
||||||
|
'title' => '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' => [
|
||||||
|
'title' => 'Countries',
|
||||||
|
'add-title' => 'Add Counrty',
|
||||||
|
'save-btn-title' => 'Save Counrty',
|
||||||
|
'general' => 'General',
|
||||||
|
'code' => 'Code',
|
||||||
|
'name' => 'Name'
|
||||||
|
],
|
||||||
|
'currencies' => [
|
||||||
|
'title' => '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'
|
||||||
|
],
|
||||||
|
|
||||||
|
'sliders' => [
|
||||||
|
'title' => 'Sliders',
|
||||||
|
'add-title' => 'Create Slider',
|
||||||
|
'save-btn-title' => 'Save Slider',
|
||||||
|
'general' => 'General',
|
||||||
|
'image' => 'Image',
|
||||||
|
'content' => 'Content',
|
||||||
|
'channels' => 'Channel'
|
||||||
|
],
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
@ -1,20 +1,18 @@
|
||||||
@extends('admin::layouts.master')
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@include ('admin::layouts.nav-aside')
|
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<form method="POST" action="">
|
<form method="POST" action="" @submit.prevent="onSubmit">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="page-title">
|
<div class="page-title">
|
||||||
<h1>
|
<h1>
|
||||||
{{ __('My Account') }}
|
{{ __('admin::app.account.header-title') }}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="page-action">
|
<div class="page-action">
|
||||||
<button type="submit" class="btn btn-lg btn-primary">
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
{{ __('Save') }}
|
{{ __('admin::app.account.save-btn-title') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -23,29 +21,40 @@
|
||||||
|
|
||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
@csrf()
|
@csrf()
|
||||||
|
|
||||||
<input name="_method" type="hidden" value="PUT">
|
<input name="_method" type="hidden" value="PUT">
|
||||||
|
|
||||||
<div class="control-group" :class="[errors.first('name') ? 'has-error' : '']">
|
<accordian :title="'{{ __('admin::app.account.general') }}'" :active="true">
|
||||||
<label for="">{{ __('Name') }}</label>
|
<div slot="body">
|
||||||
<input type="text" v-validate="'required'" class="control" name="name" value="{{ $user->name }}"/>
|
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||||
<span class="control-error" v-if="errors.first('name')">@{{ errors.first('name') }}</span>
|
<label for="name" class="required">{{ __('admin::app.account.name') }}</label>
|
||||||
</div>
|
<input type="text" v-validate="'required'" class="control" id="name" name="name" value="{{ $user->name }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="control-group" :class="[errors.first('email') ? 'has-error' : '']">
|
<div class="control-group" :class="[errors.has('email') ? 'has-error' : '']">
|
||||||
<label for="">{{ __('Email') }}</label>
|
<label for="email">{{ __('admin::app.account.email') }}</label>
|
||||||
<input type="text" v-validate="'required|email'" class="control" name="email" value="{{ $user->email }}"/>
|
<input type="text" v-validate="'required|email'" class="control" id="email" name="email" value="{{ $user->email }}"/>
|
||||||
<span class="control-error" v-if="errors.first('email')">@{{ errors.first('email') }}</span>
|
<span class="control-error" v-if="errors.has('email')">@{{ errors.first('email') }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
<div class="control-group">
|
<accordian :title="'{{ __('admin::app.account.password') }}'" :active="true">
|
||||||
<label for="">{{ __('Password') }}</label>
|
<div slot="body">
|
||||||
<input type="text" class="control" name="password"/>
|
<div class="control-group" :class="[errors.has('password') ? 'has-error' : '']">
|
||||||
</div>
|
<label for="password">{{ __('admin::app.account.password') }}</label>
|
||||||
|
<input type="password" v-validate="'min:6'" class="control" id="password" name="password"/>
|
||||||
|
<span class="control-error" v-if="errors.has('password')">@{{ errors.first('password') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group" :class="[errors.has('password_confirmation') ? 'has-error' : '']">
|
||||||
<label for="">{{ __('Confirm Password') }}</label>
|
<label for="password_confirmation">{{ __('admin::app.account.confirm-password') }}</label>
|
||||||
<input type="text" class="control" name="confirm_password"/>
|
<input type="password" v-validate="'min:6|confirmed:password'" class="control" id="password_confirmation" name="password_confirmation"/>
|
||||||
</div>
|
<span class="control-error" v-if="errors.has('password_confirmation')">@{{ errors.first('password_confirmation') }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,294 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.catalog.attributes.add-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<form method="POST" action="{{ route('admin.catalog.attributes.store') }}" @submit.prevent="onSubmit">
|
||||||
|
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.catalog.attributes.add-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.catalog.attributes.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.attributes.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
|
||||||
|
<label for="code">{{ __('admin::app.catalog.attributes.code') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="code" name="code" value="{{ old('code') }}" v-code/>
|
||||||
|
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="type" class="required">{{ __('admin::app.catalog.attributes.type') }}</label>
|
||||||
|
<select class="control" id="type" name="type">
|
||||||
|
<option value="text">{{ __('admin::app.catalog.attributes.text') }}</option>
|
||||||
|
<option value="textarea">{{ __('admin::app.catalog.attributes.textarea') }}</option>
|
||||||
|
<option value="price">{{ __('admin::app.catalog.attributes.price') }}</option>
|
||||||
|
<option value="boolean">{{ __('admin::app.catalog.attributes.boolean') }}</option>
|
||||||
|
<option value="select">{{ __('admin::app.catalog.attributes.select') }}</option>
|
||||||
|
<option value="multiselect">{{ __('admin::app.catalog.attributes.multiselect') }}</option>
|
||||||
|
<option value="datetime">{{ __('admin::app.catalog.attributes.datetime') }}</option>
|
||||||
|
<option value="date">{{ __('admin::app.catalog.attributes.date') }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.attributes.label') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('admin_name') ? 'has-error' : '']">
|
||||||
|
<label for="admin_name" class="required">{{ __('admin::app.catalog.attributes.admin') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="admin_name" name="admin_name" value="{{ old('admin_name') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('admin_name')">@{{ errors.first('admin_name') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="locale-{{ $locale->code }}">{{ $locale->name . ' (' . $locale->code . ')' }}</label>
|
||||||
|
<input type="text" class="control" id="locale-{{ $locale->code }}" name="<?php echo $locale->code; ?>[name]" value="{{ old($locale->code)['name'] }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<div class="hide">
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.attributes.options') }}'" :active="true" :id="'options'">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<option-wrapper></option-wrapper>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.attributes.validations') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="is_required">{{ __('admin::app.catalog.attributes.is_required') }}</label>
|
||||||
|
<select class="control" id="is_required" name="is_required">
|
||||||
|
<option value="0">{{ __('admin::app.catalog.attributes.no') }}</option>
|
||||||
|
<option value="1">{{ __('admin::app.catalog.attributes.yes') }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="is_unique">{{ __('admin::app.catalog.attributes.is_unique') }}</label>
|
||||||
|
<select class="control" id="is_unique" name="is_unique">
|
||||||
|
<option value="0">{{ __('admin::app.catalog.attributes.no') }}</option>
|
||||||
|
<option value="1">{{ __('admin::app.catalog.attributes.yes') }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="validation">{{ __('admin::app.catalog.attributes.input_validation') }}</label>
|
||||||
|
<select class="control" id="validation" name="validation">
|
||||||
|
<option value=""></option>
|
||||||
|
<option value="numeric">{{ __('admin::app.catalog.attributes.number') }}</option>
|
||||||
|
<option value="email">{{ __('admin::app.catalog.attributes.email') }}</option>
|
||||||
|
<option value="url">{{ __('admin::app.catalog.attributes.url') }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.attributes.configuration') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="status">{{ __('admin::app.catalog.attributes.status') }}</label>
|
||||||
|
<select class="control" id="status" name="status">
|
||||||
|
<option value="1">{{ __('admin::app.catalog.attributes.yes') }}</option>
|
||||||
|
<option value="0">{{ __('admin::app.catalog.attributes.no') }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="value_per_locale">{{ __('admin::app.catalog.attributes.value_per_locale') }}</label>
|
||||||
|
<select class="control" id="value_per_locale" name="value_per_locale">
|
||||||
|
<option value="0">{{ __('admin::app.catalog.attributes.no') }}</option>
|
||||||
|
<option value="1">{{ __('admin::app.catalog.attributes.yes') }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="value_per_channel">{{ __('admin::app.catalog.attributes.value_per_channel') }}</label>
|
||||||
|
<select class="control" id="value_per_channel" name="value_per_channel">
|
||||||
|
<option value="0">{{ __('admin::app.catalog.attributes.no') }}</option>
|
||||||
|
<option value="1">{{ __('admin::app.catalog.attributes.yes') }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="is_filterable">{{ __('admin::app.catalog.attributes.is_filterable') }}</label>
|
||||||
|
<select class="control" id="is_filterable" name="is_filterable">
|
||||||
|
<option value="0">{{ __('admin::app.catalog.attributes.no') }}</option>
|
||||||
|
<option value="1">{{ __('admin::app.catalog.attributes.yes') }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="is_configurable">{{ __('admin::app.catalog.attributes.is_configurable') }}</label>
|
||||||
|
<select class="control" id="is_configurable" name="is_configurable">
|
||||||
|
<option value="0">{{ __('admin::app.catalog.attributes.no') }}</option>
|
||||||
|
<option value="1">{{ __('admin::app.catalog.attributes.yes') }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="is_visible_on_front">{{ __('admin::app.catalog.attributes.is_visible_on_front') }}</label>
|
||||||
|
<select class="control" id="is_visible_on_front" name="is_visible_on_front">
|
||||||
|
<option value="0">{{ __('admin::app.catalog.attributes.no') }}</option>
|
||||||
|
<option value="1">{{ __('admin::app.catalog.attributes.yes') }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script type="text/x-template" id="options-template">
|
||||||
|
<div>
|
||||||
|
<div class="table">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{ __('admin::app.catalog.attributes.admin_name') }}</th>
|
||||||
|
|
||||||
|
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||||
|
|
||||||
|
<th>{{ $locale->name . ' (' . $locale->code . ')' }}</th>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
<th>{{ __('admin::app.catalog.attributes.position') }}</th>
|
||||||
|
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="row in optionRows">
|
||||||
|
<td>
|
||||||
|
<div class="control-group" :class="[errors.has(adminName(row)) ? 'has-error' : '']">
|
||||||
|
<input type="text" v-validate="'required'" v-model="row['admin_name']" :name="adminName(row)" class="control"/>
|
||||||
|
<span class="control-error" v-if="errors.has(adminName(row))">@{{ errors.first(adminName(row)) }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||||
|
<td>
|
||||||
|
<div class="control-group" :class="[errors.has(localeInputName(row, '{{ $locale->code }}')) ? 'has-error' : '']">
|
||||||
|
<input type="text" v-validate="'required'" v-model="row['{{ $locale->code }}']" :name="localeInputName(row, '{{ $locale->code }}')" class="control"/>
|
||||||
|
<span class="control-error" v-if="errors.has(localeInputName(row, '{{ $locale->code }}'))">@{{ errors.first(localeInputName(row, '{!! $locale->code !!}')) }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<div class="control-group" :class="[errors.has(sortOrderName(row)) ? 'has-error' : '']">
|
||||||
|
<input type="text" v-validate="'required|numeric'" :name="sortOrderName(row)" class="control"/>
|
||||||
|
<span class="control-error" v-if="errors.has(sortOrderName(row))">@{{ errors.first(sortOrderName(row)) }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="actions">
|
||||||
|
<i class="icon trash-icon" @click="removeRow(row)"></i>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-lg btn-primary" id="add-option-btn" style="margin-top: 20px" @click="addOptionRow()">
|
||||||
|
{{ __('admin::app.catalog.attributes.add-option-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#type').on('change', function (e) {
|
||||||
|
if(['select', 'multiselect', 'checkbox'].indexOf($(e.target).val()) === -1) {
|
||||||
|
$('#options').parent().addClass('hide')
|
||||||
|
} else {
|
||||||
|
$('#options').parent().removeClass('hide')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
var optionWrapper = Vue.component('option-wrapper', {
|
||||||
|
|
||||||
|
template: '#options-template',
|
||||||
|
|
||||||
|
data: () => ({
|
||||||
|
optionRowCount: 0,
|
||||||
|
optionRows: []
|
||||||
|
}),
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
addOptionRow () {
|
||||||
|
var rowCount = this.optionRowCount++;
|
||||||
|
var row = {'id': 'option_' + rowCount};
|
||||||
|
|
||||||
|
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||||
|
row['{{ $locale->code }}'] = '';
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
this.optionRows.push(row);
|
||||||
|
},
|
||||||
|
|
||||||
|
removeRow (row) {
|
||||||
|
var index = this.optionRows.indexOf(row)
|
||||||
|
Vue.delete(this.optionRows, index);
|
||||||
|
},
|
||||||
|
|
||||||
|
adminName (row) {
|
||||||
|
return 'options[' + row.id + '][admin_name]';
|
||||||
|
},
|
||||||
|
|
||||||
|
localeInputName (row, locale) {
|
||||||
|
return 'options[' + row.id + '][' + locale + '][label]';
|
||||||
|
},
|
||||||
|
|
||||||
|
sortOrderName (row) {
|
||||||
|
return 'options[' + row.id + '][sort_order]';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
el: '#options',
|
||||||
|
|
||||||
|
components: {
|
||||||
|
optionWrapper: optionWrapper
|
||||||
|
},
|
||||||
|
})
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|
@ -0,0 +1,367 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.catalog.attributes.edit-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<form method="POST" action="{{ route('admin.catalog.attributes.update', $attribute->id) }}" @submit.prevent="onSubmit">
|
||||||
|
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.catalog.attributes.edit-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.catalog.attributes.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
<input name="_method" type="hidden" value="PUT">
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.attributes.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
|
||||||
|
<label for="code" class="required">{{ __('admin::app.catalog.attributes.code') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="code" name="code" value="{{ $attribute->code }}" disabled="disabled" v-code/>
|
||||||
|
<input type="hidden" name="code" value="{{ $attribute->code }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<?php $selectedOption = old('type') ?: $attribute->type ?>
|
||||||
|
<label for="type">{{ __('admin::app.catalog.attributes.type') }}</label>
|
||||||
|
<select class="control" id="type" disabled="disabled">
|
||||||
|
<option value="text" {{ $selectedOption == 'text' ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.text') }}
|
||||||
|
</option>
|
||||||
|
<option value="textarea" {{ $selectedOption == 'textarea' ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.textarea') }}
|
||||||
|
</option>
|
||||||
|
<option value="price" {{ $selectedOption == 'price' ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.price') }}
|
||||||
|
</option>
|
||||||
|
<option value="boolean" {{ $selectedOption == 'boolean' ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.boolean') }}
|
||||||
|
</option>
|
||||||
|
<option value="select" {{ $selectedOption == 'select' ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.select') }}
|
||||||
|
</option>
|
||||||
|
<option value="multiselect" {{ $selectedOption == 'multiselect' ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.multiselect') }}
|
||||||
|
</option>
|
||||||
|
<option value="datetime" {{ $selectedOption == 'datetime' ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.datetime') }}
|
||||||
|
</option>
|
||||||
|
<option value="date" {{ $selectedOption == 'date' ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.date') }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<input type="hidden" name="type" value="{{ $attribute->type }}"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.attributes.label') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('admin_name') ? 'has-error' : '']">
|
||||||
|
<label for="admin_name" class="required">{{ __('admin::app.catalog.attributes.admin') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="admin_name" name="admin_name" value="{{ old('admin_name') ?: $attribute->admin_name }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('admin_name')">@{{ errors.first('admin_name') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="locale-{{ $locale->code }}">{{ $locale->name . ' (' . $locale->code . ')' }}</label>
|
||||||
|
<input type="text" class="control" id="locale-{{ $locale->code }}" name="<?php echo $locale->code; ?>[name]" value="{{ old($locale->code)['name'] ?: $attribute->translate($locale->code)['name'] }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<div class="{{ in_array($attribute->type, ['select', 'multiselect', 'checkbox']) ?: 'hide' }}">
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.attributes.options') }}'" :active="true" :id="'options'">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<option-wrapper></option-wrapper>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.attributes.validations') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="is_required">{{ __('admin::app.catalog.attributes.is_required') }}</label>
|
||||||
|
<select class="control" id="is_required" name="is_required">
|
||||||
|
<option value="0" {{ $attribute->is_required ? '' : 'selected' }}>{{ __('admin::app.catalog.attributes.no') }}</option>
|
||||||
|
<option value="1" {{ $attribute->is_required ? 'selected' : '' }}>{{ __('admin::app.catalog.attributes.yes') }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="is_unique">{{ __('admin::app.catalog.attributes.is_unique') }}</label>
|
||||||
|
<select class="control" id="is_unique" name="is_unique" disabled>
|
||||||
|
<option value="0" {{ $attribute->is_unique ? '' : 'selected' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.no') }}
|
||||||
|
</option>
|
||||||
|
<option value="1" {{ $attribute->is_unique ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.yes') }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<input type="hidden" name="is_unique" value="{{ $attribute->is_unique }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<?php $selectedValidation = old('input_validation') ?: $attribute->input_validation ?>
|
||||||
|
<label for="validation">{{ __('admin::app.catalog.attributes.input_validation') }}</label>
|
||||||
|
<select class="control" id="validation" name="validation">
|
||||||
|
<option value=""></option>
|
||||||
|
<option value="number" {{ $selectedValidation == 'number' ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.number') }}
|
||||||
|
</option>
|
||||||
|
<option value="decimal" {{ $selectedValidation == 'decimal' ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.decimal') }}
|
||||||
|
</option>
|
||||||
|
<option value="email" {{ $selectedValidation == 'email' ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.email') }}
|
||||||
|
</option>
|
||||||
|
<option value="url" {{ $selectedValidation == 'url' ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.url') }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.attributes.configuration') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="status">{{ __('admin::app.catalog.attributes.status') }}</label>
|
||||||
|
<select class="control" id="status" name="status">
|
||||||
|
<option value="1" {{ $attribute->status ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.yes') }}
|
||||||
|
</option>
|
||||||
|
<option value="0" {{ $attribute->status ? '' : 'selected' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.no') }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="value_per_locale">{{ __('admin::app.catalog.attributes.value_per_locale') }}</label>
|
||||||
|
<select class="control" id="value_per_locale" name="value_per_locale" disabled>
|
||||||
|
<option value="0" {{ $attribute->value_per_locale ? '' : 'selected' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.no') }}
|
||||||
|
</option>
|
||||||
|
<option value="1" {{ $attribute->value_per_locale ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.yes') }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<input type="hidden" name="value_per_locale" value="{{ $attribute->value_per_locale }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="value_per_channel">{{ __('admin::app.catalog.attributes.value_per_channel') }}</label>
|
||||||
|
<select class="control" id="value_per_channel" name="value_per_channel" disabled>
|
||||||
|
<option value="0" {{ $attribute->value_per_channel ? '' : 'selected' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.no') }}
|
||||||
|
</option>
|
||||||
|
<option value="1" {{ $attribute->value_per_channel ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.yes') }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<input type="hidden" name="value_per_channel" value="{{ $attribute->value_per_channel }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="is_filterable">{{ __('admin::app.catalog.attributes.is_filterable') }}</label>
|
||||||
|
<select class="control" id="is_filterable" name="is_filterable">
|
||||||
|
<option value="0" {{ $attribute->is_filterable ? '' : 'selected' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.no') }}
|
||||||
|
</option>
|
||||||
|
<option value="1" {{ $attribute->is_filterable ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.yes') }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="is_configurable">{{ __('admin::app.catalog.attributes.is_configurable') }}</label>
|
||||||
|
<select class="control" id="is_configurable" name="is_configurable">
|
||||||
|
<option value="0" {{ $attribute->is_configurable ? '' : 'selected' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.no') }}
|
||||||
|
</option>
|
||||||
|
<option value="1" {{ $attribute->is_configurable ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.yes') }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="is_visible_on_front">{{ __('admin::app.catalog.attributes.is_visible_on_front') }}</label>
|
||||||
|
<select class="control" id="is_visible_on_front" name="is_visible_on_front">
|
||||||
|
<option value="0" {{ $attribute->is_visible_on_front ? '' : 'selected' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.no') }}
|
||||||
|
</option>
|
||||||
|
<option value="1" {{ $attribute->is_visible_on_front ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.attributes.yes') }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script type="text/x-template" id="options-template">
|
||||||
|
<div>
|
||||||
|
<div class="table">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{ __('admin::app.catalog.attributes.admin_name') }}</th>
|
||||||
|
|
||||||
|
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||||
|
|
||||||
|
<th>{{ $locale->name . ' (' . $locale->code . ')' }}</th>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
<th>{{ __('admin::app.catalog.attributes.position') }}</th>
|
||||||
|
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="row in optionRows">
|
||||||
|
<td>
|
||||||
|
<div class="control-group" :class="[errors.has(adminName(row)) ? 'has-error' : '']">
|
||||||
|
<input type="text" v-validate="'required'" v-model="row['admin_name']" :name="adminName(row)" class="control"/>
|
||||||
|
<span class="control-error" v-if="errors.has(adminName(row))">@{{ errors.first(adminName(row)) }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||||
|
<td>
|
||||||
|
<div class="control-group" :class="[errors.has(localeInputName(row, '{{ $locale->code }}')) ? 'has-error' : '']">
|
||||||
|
<input type="text" v-validate="'required'" v-model="row['{{ $locale->code }}']" :name="localeInputName(row, '{{ $locale->code }}')" class="control"/>
|
||||||
|
<span class="control-error" v-if="errors.has(localeInputName(row, '{{ $locale->code }}'))">@{{ errors.first(localeInputName(row, '{!! $locale->code !!}')) }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<div class="control-group" :class="[errors.has(sortOrderName(row)) ? 'has-error' : '']">
|
||||||
|
<input type="text" v-validate="'required|numeric'" v-model="row['sort_order']" :name="sortOrderName(row)" class="control"/>
|
||||||
|
<span class="control-error" v-if="errors.has(sortOrderName(row))">@{{ errors.first(sortOrderName(row)) }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="actions">
|
||||||
|
<i class="icon trash-icon" @click="removeRow(row)"></i>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-lg btn-primary" id="add-option-btn" style="margin-top: 20px" @click="addOptionRow()">
|
||||||
|
{{ __('admin::app.catalog.attributes.add-option-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#type').on('change', function (e) {
|
||||||
|
if(['select', 'multiselect', 'checkbox'].indexOf($(e.target).val()) === -1) {
|
||||||
|
$('#options').parent().addClass('hide')
|
||||||
|
} else {
|
||||||
|
$('#options').parent().removeClass('hide')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
var optionWrapper = Vue.component('option-wrapper', {
|
||||||
|
|
||||||
|
template: '#options-template',
|
||||||
|
|
||||||
|
created () {
|
||||||
|
@foreach($attribute->options as $option)
|
||||||
|
this.optionRowCount++;
|
||||||
|
var row = {'id': '{{ $option->id }}', 'admin_name': '{{ $option->admin_name }}', 'sort_order': '{{ $option->sort_order }}'};
|
||||||
|
|
||||||
|
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||||
|
row['{{ $locale->code }}'] = "{{ $option->translate($locale->code)['label'] }}";
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
this.optionRows.push(row);
|
||||||
|
@endforeach
|
||||||
|
},
|
||||||
|
|
||||||
|
data: () => ({
|
||||||
|
optionRowCount: 0,
|
||||||
|
optionRows: []
|
||||||
|
}),
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
addOptionRow () {
|
||||||
|
var rowCount = this.optionRowCount++;
|
||||||
|
var row = {'id': 'option_' + rowCount};
|
||||||
|
|
||||||
|
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||||
|
row['{{ $locale->code }}'] = '';
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
this.optionRows.push(row);
|
||||||
|
},
|
||||||
|
|
||||||
|
removeRow (row) {
|
||||||
|
var index = this.optionRows.indexOf(row)
|
||||||
|
Vue.delete(this.optionRows, index);
|
||||||
|
},
|
||||||
|
|
||||||
|
adminName (row) {
|
||||||
|
return 'options[' + row.id + '][admin_name]';
|
||||||
|
},
|
||||||
|
|
||||||
|
localeInputName (row, locale) {
|
||||||
|
return 'options[' + row.id + '][' + locale + '][label]';
|
||||||
|
},
|
||||||
|
|
||||||
|
sortOrderName (row) {
|
||||||
|
return 'options[' + row.id + '][sort_order]';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
el: '#options',
|
||||||
|
|
||||||
|
components: {
|
||||||
|
optionWrapper: optionWrapper
|
||||||
|
},
|
||||||
|
})
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
Attributes
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<a href="{{ route('admin.catalog.attributes.create') }}" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('Add Attribute') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
@inject('attributes','Webkul\Admin\DataGrids\AttributeDataGrid')
|
||||||
|
{!! $attributes->render() !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,114 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.catalog.categories.add-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.catalog.categories.store') }}" @submit.prevent="onSubmit">
|
||||||
|
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.catalog.categories.add-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.catalog.categories.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
<input type="hidden" name="locale" value="all"/>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.categories.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||||
|
<label for="name" class="required">{{ __('admin::app.catalog.categories.name') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('status') ? 'has-error' : '']">
|
||||||
|
<label for="status" class="required">{{ __('admin::app.catalog.categories.visible-in-menu') }}</label>
|
||||||
|
<select class="control" v-validate="'required'" id="status" name="status">
|
||||||
|
<option value="1">
|
||||||
|
{{ __('admin::app.catalog.categories.yes') }}
|
||||||
|
</option>
|
||||||
|
<option value="0">
|
||||||
|
{{ __('admin::app.catalog.categories.no') }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('status')">@{{ errors.first('status') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('position') ? 'has-error' : '']">
|
||||||
|
<label for="position" class="required">{{ __('admin::app.catalog.categories.position') }}</label>
|
||||||
|
<input type="text" v-validate="'required|numeric'" class="control" id="position" name="position" value="{{ old('position') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('position')">@{{ errors.first('position') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.categories.description-and-images') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
|
||||||
|
<label for="description" class="required">{{ __('admin::app.catalog.categories.description') }}</label>
|
||||||
|
<textarea v-validate="'required'" class="control" id="description" name="description">{{ old('description') }}</textarea>
|
||||||
|
<span class="control-error" v-if="errors.has('description')">@{{ errors.first('description') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
@if($categories->count())
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.categories.parent-category') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<tree-view value-field="id" name-field="parent_id" input-type="radio" items='@json($categories)'></tree-view>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.categories.seo') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="meta_title">{{ __('admin::app.catalog.categories.meta_title') }}</label>
|
||||||
|
<input type="text" class="control" id="meta_title" name="meta_title" value="{{ old('meta_title') }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('slug') ? 'has-error' : '']">
|
||||||
|
<label for="slug" class="required">{{ __('admin::app.catalog.categories.slug') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="slug" name="slug" value="{{ old('slug') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('slug')">@{{ errors.first('slug') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="meta_description">{{ __('admin::app.catalog.categories.meta_description') }}</label>
|
||||||
|
<textarea class="control" id="meta_description" name="meta_description">{{ old('meta_description') }}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="meta_keywords">{{ __('admin::app.catalog.categories.meta_keywords') }}</label>
|
||||||
|
<textarea class="control" id="meta_keywords" name="meta_keywords">{{ old('meta_keywords') }}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,127 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.catalog.categories.edit-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<?php $locale = request()->get('locale') ?: app()->getLocale(); ?>
|
||||||
|
|
||||||
|
<form method="POST" action="" @submit.prevent="onSubmit">
|
||||||
|
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.catalog.categories.edit-title') }}</h1>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<select class="control" id="locale-switcher" onChange="window.location.href = this.value">
|
||||||
|
@foreach(core()->getAllLocales() as $localeModel)
|
||||||
|
|
||||||
|
<option value="{{ route('admin.catalog.categories.update', $category->id) . '?locale=' . $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}>
|
||||||
|
{{ $localeModel->name }}
|
||||||
|
</option>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.catalog.categories.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
<input name="_method" type="hidden" value="PUT">
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.categories.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('{{$locale}}[name]') ? 'has-error' : '']">
|
||||||
|
<label for="name" class="required">{{ __('admin::app.catalog.categories.name') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="name" name="{{$locale}}[name]" value="{{ old($locale)['name'] ?: $category->translate($locale)['name'] }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('{{$locale}}[name]')">@{{ errors.first('{!!$locale!!}[name]') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('status') ? 'has-error' : '']">
|
||||||
|
<label for="status" class="required">{{ __('admin::app.catalog.categories.visible-in-menu') }}</label>
|
||||||
|
<select class="control" v-validate="'required'" id="status" name="status">
|
||||||
|
<option value="1" {{ $category->status ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.catalog.categories.yes') }}
|
||||||
|
</option>
|
||||||
|
<option value="0" {{ $category->status ? '' : 'selected' }}>
|
||||||
|
{{ __('admin::app.catalog.categories.no') }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('status')">@{{ errors.first('status') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('position') ? 'has-error' : '']">
|
||||||
|
<label for="position">{{ __('admin::app.catalog.categories.position') }}</label>
|
||||||
|
<input type="text" v-validate="'required|numeric'" class="control" id="position" name="position" value="{{ old('position') ?: $category->position }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('position')">@{{ errors.first('position') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.categories.description-and-images') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('{{$locale}}[description]') ? 'has-error' : '']">
|
||||||
|
<label for="description" class="required">{{ __('admin::app.catalog.categories.description') }}</label>
|
||||||
|
<textarea v-validate="'required'" class="control" id="description" name="{{$locale}}[description]">{{ old($locale)['description'] ?: $category->translate($locale)['description'] }}</textarea>
|
||||||
|
<span class="control-error" v-if="errors.has('{{$locale}}[description]')">@{{ errors.first('{!!$locale!!}[description]') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
@if($categories->count())
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.categories.parent-category') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<tree-view value-field="id" name-field="parent_id" input-type="radio" items='@json($categories)' value='@json($category->parent_id)'></tree-view>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.categories.seo') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="meta_title">{{ __('admin::app.catalog.categories.meta_title') }}</label>
|
||||||
|
<input type="text" class="control" id="meta_title" name="{{$locale}}[meta_title]" value="{{ old($locale)['meta_title'] ?: $category->translate($locale)['meta_title'] }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('{{$locale}}[slug]') ? 'has-error' : '']">
|
||||||
|
<label for="slug" class="required">{{ __('admin::app.catalog.categories.slug') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="slug" name="{{$locale}}[slug]" value="{{ old($locale)['slug'] ?: $category->translate($locale)['slug'] }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('{{$locale}}[slug]')">@{{ errors.first('{!!$locale!!}[slug]') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="meta_description">{{ __('admin::app.catalog.categories.meta_description') }}</label>
|
||||||
|
<textarea class="control" id="meta_description" name="{{$locale}}[meta_description]">{{ old($locale)['meta_description'] ?: $category->translate($locale)['meta_description'] }}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="meta_keywords">{{ __('admin::app.catalog.categories.meta_keywords') }}</label>
|
||||||
|
<textarea class="control" id="meta_keywords" name="{{$locale}}[meta_keywords]">{{ old($locale)['meta_keywords'] ?: $category->translate($locale)['meta_keywords'] }}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
Categories
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<a href="{{ route('admin.catalog.categories.create') }}" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('Add Category') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
@inject('categories','Webkul\Admin\DataGrids\CategoryDataGrid')
|
||||||
|
{!! $categories->render() !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,343 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.catalog.families.add-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<form method="POST" action="{{ route('admin.catalog.families.store') }}" @submit.prevent="onSubmit">
|
||||||
|
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.catalog.families.add-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.catalog.families.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.families.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
|
||||||
|
<label for="code" class="required">{{ __('admin::app.catalog.families.code') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="code" name="code" value="{{ old('code') }}" v-code/>
|
||||||
|
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||||
|
<label for="name" class="required">{{ __('admin::app.catalog.families.name') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.families.groups') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-md btn-primary" @click="showModal('addGroup')">
|
||||||
|
{{ __('admin::app.catalog.families.add-group-title') }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<group-list></group-list>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<modal id="addGroup" :is-open="modalIds.addGroup">
|
||||||
|
<h3 slot="header">{{ __('admin::app.catalog.families.add-group-title') }}</h3>
|
||||||
|
|
||||||
|
<div slot="body">
|
||||||
|
<group-form></group-form>
|
||||||
|
</div>
|
||||||
|
</modal>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
|
||||||
|
<script type="text/x-template" id="group-form-template">
|
||||||
|
<form method="POST" action="{{ route('admin.catalog.families.store') }}" data-vv-scope="add-group-form" @submit.prevent="addGroup('add-group-form')">
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('add-group-form.groupName') ? 'has-error' : '']">
|
||||||
|
<label for="groupName" class="required">{{ __('admin::app.catalog.families.name') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" v-model="group.groupName" class="control" id="groupName" name="groupName"/>
|
||||||
|
<span class="control-error" v-if="errors.has('add-group-form.groupName')">@{{ errors.first('add-group-form.groupName') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('add-group-form.position') ? 'has-error' : '']">
|
||||||
|
<label for="position">{{ __('admin::app.catalog.families.position') }}</label>
|
||||||
|
<input type="text" v-validate="'required|numeric'" v-model="group.position" class="control" id="position" name="position"/>
|
||||||
|
<span class="control-error" v-if="errors.has('add-group-form.position')">@{{ errors.first('add-group-form.position') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.catalog.families.add-group-title') }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/x-template" id="group-list-template">
|
||||||
|
<div>
|
||||||
|
<group-item v-for='(group, index) in groups' :group="group" :custom_attributes="custom_attributes" :key="index" :index="index" @onRemoveGroup="removeGroup($event)" @onAttributeAdd="addAttributes(index, $event)" @onAttributeRemove="removeAttribute(index, $event)"></group-item>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/x-template" id="group-item-template">
|
||||||
|
<accordian :title="group.groupName" :active="true">
|
||||||
|
<div slot="header">
|
||||||
|
<i class="icon expand-icon left"></i>
|
||||||
|
<h1>@{{ group.name ? group.name : group.groupName }}</h1>
|
||||||
|
<i class="icon trash-icon" @click="removeGroup()" v-if="group.is_user_defined"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div slot="body">
|
||||||
|
<input type="hidden" :name="[groupInputName + '[name]']" :value="group.name ? group.name : group.groupName"/>
|
||||||
|
<input type="hidden" :name="[groupInputName + '[position]']" :value="group.position"/>
|
||||||
|
<input type="hidden" :name="[groupInputName + '[is_user_defined]']" :value="group.is_user_defined"/>
|
||||||
|
|
||||||
|
<div class="table" v-if="group.custom_attributes.length" style="margin-bottom: 20px;">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{ __('admin::app.catalog.families.attribute-code') }}</th>
|
||||||
|
<th>{{ __('admin::app.catalog.families.name') }}</th>
|
||||||
|
<th>{{ __('admin::app.catalog.families.type') }}</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<tr v-for='(attribute, index) in group.custom_attributes'>
|
||||||
|
<td>
|
||||||
|
<input type="hidden" :name="[groupInputName + '[custom_attributes][][id]']" :value="attribute.id"/>
|
||||||
|
@{{ attribute.code }}
|
||||||
|
</td>
|
||||||
|
<td>@{{ attribute.admin_name }}</td>
|
||||||
|
<td>@{{ attribute.type }}</td>
|
||||||
|
<td class="actions">
|
||||||
|
<i class="icon trash-icon" @click="removeAttribute(attribute)" v-if="attribute.is_user_defined"></i>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-md btn-primary dropdown-toggle">
|
||||||
|
{{ __('admin::app.catalog.families.add-attribute-title') }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="dropdown-list" style="width: 240px">
|
||||||
|
<div class="search-box">
|
||||||
|
<input type="text" class="control" placeholder="{{ __('admin::app.catalog.families.search') }}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="dropdown-container">
|
||||||
|
<ul>
|
||||||
|
<li v-for='(attribute, index) in custom_attributes' :data-id="attribute.id">
|
||||||
|
<span class="checkbox">
|
||||||
|
<input type="checkbox" :id="attribute.id" :value="attribute.id"/>
|
||||||
|
<label class="checkbox-view" :for="attribute.id"></label>
|
||||||
|
@{{ attribute.admin_name }}
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-lg btn-primary" @click="addAttributes($event)">
|
||||||
|
{{ __('admin::app.catalog.families.add-attribute-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var groups = @json($attributeFamily ? $attributeFamily->attribute_groups : []);
|
||||||
|
var custom_attributes = @json($custom_attributes);
|
||||||
|
|
||||||
|
Vue.component('group-form', {
|
||||||
|
|
||||||
|
data: () => ({
|
||||||
|
group: {
|
||||||
|
'groupName': '',
|
||||||
|
'position': '',
|
||||||
|
'is_user_defined': 1,
|
||||||
|
'custom_attributes': []
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
|
||||||
|
template: '#group-form-template',
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
addGroup (formScope) {
|
||||||
|
this.$validator.validateAll(formScope).then((result) => {
|
||||||
|
if (result) {
|
||||||
|
var this_this = this;
|
||||||
|
|
||||||
|
var filteredGroups = groups.filter(function(group) {
|
||||||
|
return this_this.group.groupName.trim() === (group.name ? group.name.trim() : group.groupName.trim())
|
||||||
|
})
|
||||||
|
|
||||||
|
if(filteredGroups.length) {
|
||||||
|
const field = this.$validator.fields.find({ name: 'groupName', scope: 'add-group-form' });
|
||||||
|
|
||||||
|
if (field) {
|
||||||
|
this.$validator.errors.add({
|
||||||
|
id: field.id,
|
||||||
|
field: 'groupName',
|
||||||
|
msg: "{{ __('admin::app.catalog.families.group-exist-error') }}",
|
||||||
|
scope: 'add-group-form',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
groups.push(this.group);
|
||||||
|
|
||||||
|
groups = this.sortGroups();
|
||||||
|
|
||||||
|
this.group = {'groupName': '', 'position': '', 'is_user_defined': 1, 'custom_attributes': []};
|
||||||
|
|
||||||
|
this.$parent.closeModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
sortGroups () {
|
||||||
|
return groups.sort(function(a, b) {
|
||||||
|
return a.position - b.position;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Vue.component('group-list', {
|
||||||
|
|
||||||
|
template: '#group-list-template',
|
||||||
|
|
||||||
|
data: () => ({
|
||||||
|
groups: groups,
|
||||||
|
custom_attributes: custom_attributes
|
||||||
|
}),
|
||||||
|
|
||||||
|
created () {
|
||||||
|
this.groups.forEach(function(group) {
|
||||||
|
group.custom_attributes.forEach(function(attribute) {
|
||||||
|
var attribute = this.custom_attributes.filter(attributeTemp => attributeTemp.id == attribute.id)
|
||||||
|
|
||||||
|
if(attribute.length) {
|
||||||
|
let index = this.custom_attributes.indexOf(attribute[0])
|
||||||
|
|
||||||
|
this.custom_attributes.splice(index, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
removeGroup (group) {
|
||||||
|
group.custom_attributes.forEach(function(attribute) {
|
||||||
|
this.custom_attributes.push(attribute);
|
||||||
|
})
|
||||||
|
|
||||||
|
this.custom_attributes = this.sortAttributes();
|
||||||
|
|
||||||
|
let index = groups.indexOf(group)
|
||||||
|
|
||||||
|
groups.splice(index, 1)
|
||||||
|
},
|
||||||
|
|
||||||
|
addAttributes (groupIndex, attributeIds) {
|
||||||
|
attributeIds.forEach(function(attributeId) {
|
||||||
|
var attribute = this.custom_attributes.filter(attribute => attribute.id == attributeId)
|
||||||
|
|
||||||
|
this.groups[groupIndex].custom_attributes.push(attribute[0]);
|
||||||
|
|
||||||
|
let index = this.custom_attributes.indexOf(attribute[0])
|
||||||
|
|
||||||
|
this.custom_attributes.splice(index, 1)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
removeAttribute (groupIndex, attribute) {
|
||||||
|
let index = this.groups[groupIndex].custom_attributes.indexOf(attribute)
|
||||||
|
|
||||||
|
this.groups[groupIndex].custom_attributes.splice(index, 1)
|
||||||
|
|
||||||
|
this.custom_attributes.push(attribute);
|
||||||
|
|
||||||
|
this.custom_attributes = this.sortAttributes();
|
||||||
|
},
|
||||||
|
|
||||||
|
sortAttributes () {
|
||||||
|
return this.custom_attributes.sort(function(a, b) {
|
||||||
|
return a.id - b.id;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
Vue.component('group-item', {
|
||||||
|
props: ['index', 'group', 'custom_attributes'],
|
||||||
|
|
||||||
|
template: "#group-item-template",
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
groupInputName () {
|
||||||
|
return "attribute_groups[group_" + this.index + "]";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
removeGroup () {
|
||||||
|
this.$emit('onRemoveGroup', this.group)
|
||||||
|
},
|
||||||
|
|
||||||
|
addAttributes (e) {
|
||||||
|
var attributeIds = [];
|
||||||
|
|
||||||
|
$(e.target).prev().find('li input').each(function() {
|
||||||
|
var attributeId = $(this).val();
|
||||||
|
|
||||||
|
if($(this).is(':checked')) {
|
||||||
|
attributeIds.push(attributeId);
|
||||||
|
|
||||||
|
$(this).prop('checked', false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').trigger('click')
|
||||||
|
|
||||||
|
this.$emit('onAttributeAdd', attributeIds)
|
||||||
|
},
|
||||||
|
|
||||||
|
removeAttribute (attribute) {
|
||||||
|
this.$emit('onAttributeRemove', attribute)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|
@ -0,0 +1,345 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.catalog.families.edit-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<form method="POST" action="{{ route('admin.catalog.families.update', $attributeFamily->id) }}" @submit.prevent="onSubmit">
|
||||||
|
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.catalog.families.edit-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.catalog.families.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
<input name="_method" type="hidden" value="PUT">
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.families.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
|
||||||
|
<input type="text" v-validate="'required'" name="code" class="control" id="code" value="{{ $attributeFamily->code }}" disabled="disabled" v-code/>
|
||||||
|
<input type="hidden" name="code" value="{{ $attributeFamily->code }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||||
|
<label for="name" class="required">{{ __('admin::app.catalog.families.name') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') ?: $attributeFamily->name }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.families.groups') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-md btn-primary" @click="showModal('addGroup')">
|
||||||
|
{{ __('admin::app.catalog.families.add-group-title') }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<group-list></group-list>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<modal id="addGroup" :is-open="modalIds.addGroup">
|
||||||
|
<h3 slot="header">{{ __('admin::app.catalog.families.add-group-title') }}</h3>
|
||||||
|
|
||||||
|
<div slot="body">
|
||||||
|
<group-form></group-form>
|
||||||
|
</div>
|
||||||
|
</modal>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
|
||||||
|
<script type="text/x-template" id="group-form-template">
|
||||||
|
<form method="POST" action="{{ route('admin.catalog.families.store') }}" data-vv-scope="add-group-form" @submit.prevent="addGroup('add-group-form')">
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('add-group-form.groupName') ? 'has-error' : '']">
|
||||||
|
<label for="groupName" class="required">{{ __('admin::app.catalog.families.name') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" v-model="group.groupName" class="control" id="groupName" name="groupName"/>
|
||||||
|
<span class="control-error" v-if="errors.has('add-group-form.groupName')">@{{ errors.first('add-group-form.groupName') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('add-group-form.position') ? 'has-error' : '']">
|
||||||
|
<label for="position">{{ __('admin::app.catalog.families.position') }}</label>
|
||||||
|
<input type="text" v-validate="'required|numeric'" v-model="group.position" class="control" id="position" name="position"/>
|
||||||
|
<span class="control-error" v-if="errors.has('add-group-form.position')">@{{ errors.first('add-group-form.position') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.catalog.families.add-group-title') }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/x-template" id="group-list-template">
|
||||||
|
<div style="margin-top: 20px">
|
||||||
|
<group-item v-for='(group, index) in groups' :group="group" :custom_attributes="custom_attributes" :key="index" :index="index" @onRemoveGroup="removeGroup($event)" @onAttributeAdd="addAttributes(index, $event)" @onAttributeRemove="removeAttribute(index, $event)"></group-item>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/x-template" id="group-item-template">
|
||||||
|
<accordian :title="group.groupName" :active="true">
|
||||||
|
<div slot="header">
|
||||||
|
<i class="icon expand-icon left"></i>
|
||||||
|
<h1>@{{ group.name ? group.name : group.groupName }}</h1>
|
||||||
|
<i class="icon trash-icon" @click="removeGroup()" v-if="group.is_user_defined"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div slot="body">
|
||||||
|
<input type="hidden" :name="[groupInputName + '[name]']" :value="group.name ? group.name : group.groupName"/>
|
||||||
|
<input type="hidden":name="[groupInputName + '[position]']" :value="group.position"/>
|
||||||
|
|
||||||
|
<div class="table" v-if="group.custom_attributes.length" style="margin-bottom: 20px;">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{ __('admin::app.catalog.families.attribute-code') }}</th>
|
||||||
|
<th>{{ __('admin::app.catalog.families.name') }}</th>
|
||||||
|
<th>{{ __('admin::app.catalog.families.type') }}</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<tr v-for='(attribute, index) in group.custom_attributes'>
|
||||||
|
<td>
|
||||||
|
<input type="hidden" :name="[groupInputName + '[custom_attributes][][id]']" :value="attribute.id"/>
|
||||||
|
@{{ attribute.code }}
|
||||||
|
</td>
|
||||||
|
<td>@{{ attribute.admin_name }}</td>
|
||||||
|
<td>@{{ attribute.type }}</td>
|
||||||
|
<td class="actions">
|
||||||
|
<i class="icon trash-icon" @click="removeAttribute(attribute)" v-if="attribute.is_user_defined"></i>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-md btn-primary dropdown-toggle">
|
||||||
|
{{ __('admin::app.catalog.families.add-attribute-title') }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="dropdown-list" style="width: 240px">
|
||||||
|
<div class="search-box">
|
||||||
|
<input type="text" class="control" placeholder="{{ __('admin::app.catalog.families.search') }}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="dropdown-container">
|
||||||
|
<ul>
|
||||||
|
<li v-for='(attribute, index) in custom_attributes' :data-id="attribute.id">
|
||||||
|
<span class="checkbox">
|
||||||
|
<input type="checkbox" :id="attribute.id" :value="attribute.id"/>
|
||||||
|
<label class="checkbox-view" :for="attribute.id"></label>
|
||||||
|
@{{ attribute.admin_name }}
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-lg btn-primary" @click="addAttributes($event)">
|
||||||
|
{{ __('admin::app.catalog.families.add-attribute-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var groups = @json($attributeFamily->attribute_groups);
|
||||||
|
var custom_attributes = @json($custom_attributes);
|
||||||
|
|
||||||
|
Vue.component('group-form', {
|
||||||
|
|
||||||
|
data: () => ({
|
||||||
|
group: {
|
||||||
|
'groupName': '',
|
||||||
|
'position': '',
|
||||||
|
'custom_attributes': []
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
|
||||||
|
template: '#group-form-template',
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
addGroup (formScope) {
|
||||||
|
this.$validator.validateAll(formScope).then((result) => {
|
||||||
|
if (result) {
|
||||||
|
var this_this = this;
|
||||||
|
|
||||||
|
var filteredGroups = groups.filter(function(group) {
|
||||||
|
return this_this.group.groupName.trim() === (group.name ? group.name.trim() : group.groupName.trim())
|
||||||
|
})
|
||||||
|
|
||||||
|
if(filteredGroups.length) {
|
||||||
|
const field = this.$validator.fields.find({ name: 'groupName', scope: 'add-group-form' });
|
||||||
|
|
||||||
|
if (field) {
|
||||||
|
this.$validator.errors.add({
|
||||||
|
id: field.id,
|
||||||
|
field: 'groupName',
|
||||||
|
msg: "{{ __('admin::app.catalog.families.group-exist-error') }}",
|
||||||
|
scope: 'add-group-form',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
groups.push(this.group);
|
||||||
|
|
||||||
|
groups = this.sortGroups();
|
||||||
|
|
||||||
|
this.group = {'groupName': '', 'position': '', 'custom_attributes': []};
|
||||||
|
|
||||||
|
this.$parent.closeModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
sortGroups () {
|
||||||
|
return groups.sort(function(a, b) {
|
||||||
|
return a.position - b.position;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Vue.component('group-list', {
|
||||||
|
|
||||||
|
template: '#group-list-template',
|
||||||
|
|
||||||
|
data: () => ({
|
||||||
|
groups: groups,
|
||||||
|
custom_attributes: custom_attributes
|
||||||
|
}),
|
||||||
|
|
||||||
|
created () {
|
||||||
|
this.groups.forEach(function(group) {
|
||||||
|
group.custom_attributes.forEach(function(attribute) {
|
||||||
|
var attribute = this.custom_attributes.filter(attributeTemp => attributeTemp.id == attribute.id)
|
||||||
|
|
||||||
|
if(attribute.length) {
|
||||||
|
let index = this.custom_attributes.indexOf(attribute[0])
|
||||||
|
|
||||||
|
this.custom_attributes.splice(index, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
removeGroup (group) {
|
||||||
|
group.custom_attributes.forEach(function(attribute) {
|
||||||
|
this.custom_attributes.push(attribute);
|
||||||
|
})
|
||||||
|
|
||||||
|
this.custom_attributes = this.sortAttributes();
|
||||||
|
|
||||||
|
let index = groups.indexOf(group)
|
||||||
|
|
||||||
|
groups.splice(index, 1)
|
||||||
|
},
|
||||||
|
|
||||||
|
addAttributes (groupIndex, attributeIds) {
|
||||||
|
attributeIds.forEach(function(attributeId) {
|
||||||
|
var attribute = this.custom_attributes.filter(attribute => attribute.id == attributeId)
|
||||||
|
|
||||||
|
this.groups[groupIndex].custom_attributes.push(attribute[0]);
|
||||||
|
|
||||||
|
let index = this.custom_attributes.indexOf(attribute[0])
|
||||||
|
|
||||||
|
this.custom_attributes.splice(index, 1)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
removeAttribute (groupIndex, attribute) {
|
||||||
|
let index = this.groups[groupIndex].custom_attributes.indexOf(attribute)
|
||||||
|
|
||||||
|
this.groups[groupIndex].custom_attributes.splice(index, 1)
|
||||||
|
|
||||||
|
this.custom_attributes.push(attribute);
|
||||||
|
|
||||||
|
this.custom_attributes = this.sortAttributes();
|
||||||
|
},
|
||||||
|
|
||||||
|
sortAttributes () {
|
||||||
|
return this.custom_attributes.sort(function(a, b) {
|
||||||
|
return a.id - b.id;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
Vue.component('group-item', {
|
||||||
|
props: ['index', 'group', 'custom_attributes'],
|
||||||
|
|
||||||
|
template: "#group-item-template",
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
groupInputName () {
|
||||||
|
if(this.group.id)
|
||||||
|
return "attribute_groups[" + this.group.id + "]";
|
||||||
|
|
||||||
|
return "attribute_groups[group_" + this.index + "]";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
removeGroup () {
|
||||||
|
this.$emit('onRemoveGroup', this.group)
|
||||||
|
},
|
||||||
|
|
||||||
|
addAttributes (e) {
|
||||||
|
var attributeIds = [];
|
||||||
|
|
||||||
|
$(e.target).prev().find('li input').each(function() {
|
||||||
|
var attributeId = $(this).val();
|
||||||
|
|
||||||
|
if($(this).is(':checked')) {
|
||||||
|
attributeIds.push(attributeId);
|
||||||
|
|
||||||
|
$(this).prop('checked', false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').trigger('click')
|
||||||
|
|
||||||
|
this.$emit('onAttributeAdd', attributeIds)
|
||||||
|
},
|
||||||
|
|
||||||
|
removeAttribute (attribute) {
|
||||||
|
this.$emit('onAttributeRemove', attribute)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
{{ __('admin::app.catalog.families.families') }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<a href="{{ route('admin.catalog.families.create') }}" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.catalog.families.add-family-btn-title') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
@inject('attributefamily','Webkul\Admin\DataGrids\AttributeFamilyDataGrid')
|
||||||
|
{!! $attributefamily->render() !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
@if($categories->count())
|
||||||
|
<accordian :title="'{{ __($accordian['name']) }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<tree-view behavior="normal" value-field="id" name-field="categories" input-type="checkbox" items='@json($categories)' value='@json($product->categories->pluck("id"))'></tree-view>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
@endif
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<accordian :title="'{{ __($accordian['name']) }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<image-wrapper :button-label="'{{ __('admin::app.catalog.products.add-image-btn-title') }}'" input-name="images" :images='@json($product->images)'></image-wrapper>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
@if ($product->type != 'configurable')
|
||||||
|
<accordian :title="'{{ __($accordian['name']) }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
@foreach ($inventorySources as $inventorySource)
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$qty = 0;
|
||||||
|
foreach ($product->inventories as $inventory) {
|
||||||
|
if($inventory->inventory_source_id == $inventorySource->id) {
|
||||||
|
$qty = $inventory->qty;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$qty = old('inventories[' . $inventorySource->id . ']') ?: $qty;
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="control-group" :class="[errors.has('inventories[{{ $inventorySource->id }}]') ? 'has-error' : '']">
|
||||||
|
<label>{{ $inventorySource->name }}</label>
|
||||||
|
<input type="text" v-validate="'numeric|min:0'" name="inventories[{{ $inventorySource->id }}]" class="control" value="{{ $qty }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('inventories[{{ $inventorySource->id }}]')">@{{ errors.first('inventories[{!! $inventorySource->id !!}]') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
@endif
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<accordian :title="'{{ __($accordian['name']) }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
@ -0,0 +1,348 @@
|
||||||
|
@if ($product->type == 'configurable')
|
||||||
|
|
||||||
|
@section('css')
|
||||||
|
@parent
|
||||||
|
<style>
|
||||||
|
.table th.price, .table th.weight {
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
.table th.actions {
|
||||||
|
width: 85px;
|
||||||
|
}
|
||||||
|
.table td.actions .icon {
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
.table td.actions .icon.pencil-lg-icon {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
<accordian :title="'{{ __($accordian['name']) }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-md btn-primary" @click="showModal('addVariant')">
|
||||||
|
{{ __('admin::app.catalog.products.add-variant-btn-title') }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<variant-list></variant-list>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<modal id="addVariant" :is-open="modalIds.addVariant">
|
||||||
|
<h3 slot="header">{{ __('admin::app.catalog.products.add-variant-title') }}</h3>
|
||||||
|
|
||||||
|
<div slot="body">
|
||||||
|
<variant-form></variant-form>
|
||||||
|
</div>
|
||||||
|
</modal>
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
@parent
|
||||||
|
|
||||||
|
<script type="text/x-template" id="variant-form-template">
|
||||||
|
<form method="POST" action="{{ route('admin.catalog.products.store') }}" data-vv-scope="add-variant-form" @submit.prevent="addVariant('add-variant-form')">
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
|
||||||
|
<div v-for='(attribute, index) in super_attributes' class="control-group" :class="[errors.has('add-variant-form.' + attribute.code) ? 'has-error' : '']">
|
||||||
|
<label :for="attribute.code" class="required">@{{ attribute.admin_name }}</label>
|
||||||
|
<select v-validate="'required'" v-model="variant[attribute.code]" class="control" :id="attribute.code" :name="attribute.code">
|
||||||
|
<option v-for='(option, index) in attribute.options' :value="option.id">@{{ option.admin_name }}</option>
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('add-variant-form.' + attribute.code)">@{{ errors.first('add-variant-form.' + attribute.code) }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.catalog.products.add-variant-title') }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/x-template" id="variant-list-template">
|
||||||
|
<div class="table" style="margin-top: 20px; overflow-x: unset;">
|
||||||
|
<table>
|
||||||
|
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="sku">{{ __('admin::app.catalog.products.sku') }}</th>
|
||||||
|
<th>{{ __('admin::app.catalog.products.name') }}</th>
|
||||||
|
|
||||||
|
@foreach ($product->super_attributes as $attribute)
|
||||||
|
<th class="{{ $attribute->code }}" style="width: 150px">{{ $attribute->admin_name }}</th>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
<th class="qty">{{ __('admin::app.catalog.products.qty') }}</th>
|
||||||
|
<th class="price">{{ __('admin::app.catalog.products.price') }}</th>
|
||||||
|
<th class="weight">{{ __('admin::app.catalog.products.weight') }}</th>
|
||||||
|
<th class="status">{{ __('admin::app.catalog.products.status') }}</th>
|
||||||
|
<th class="actions"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<variant-item v-for='(variant, index) in variants' :variant="variant" :key="index" :index="index" @onRemoveVariant="removeVariant($event)"></variant-item>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/x-template" id="variant-item-template">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div class="control-group" :class="[errors.has(variantInputName + '[sku]') ? 'has-error' : '']">
|
||||||
|
<input type="text" v-validate="'required'" v-model="variant.sku" :name="[variantInputName + '[sku]']" class="control" v-slugify/>
|
||||||
|
<span class="control-error" v-if="errors.has(variantInputName + '[sku]')">@{{ errors.first(variantInputName + '[sku]') }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<div class="control-group" :class="[errors.has(variantInputName + '[name]') ? 'has-error' : '']">
|
||||||
|
<input type="text" v-validate="'required'" v-model="variant.name" :name="[variantInputName + '[name]']" class="control"/>
|
||||||
|
<span class="control-error" v-if="errors.has(variantInputName + '[name]')">@{{ errors.first(variantInputName + '[name]') }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td v-for='(attribute, index) in superAttributes'>
|
||||||
|
<div class="control-group">
|
||||||
|
<input type="hidden" :name="[variantInputName + '[' + attribute.code + ']']" :value="variant[attribute.code]"/>
|
||||||
|
<input type="text" class="control" :value="optionName(variant[attribute.code])" readonly/>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<button style="width: 100%;" type="button" class="dropdown-btn dropdown-toggle">
|
||||||
|
@{{ totalQty }}
|
||||||
|
<i class="icon arrow-down-icon"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="dropdown-list">
|
||||||
|
<div class="dropdown-container">
|
||||||
|
<ul>
|
||||||
|
<li v-for='(inventorySource, index) in inventorySources'>
|
||||||
|
<div class="control-group" :class="[errors.has(variantInputName + '[inventories][' + inventorySource.id + ']') ? 'has-error' : '']">
|
||||||
|
<label>@{{ inventorySource.name }}</label>
|
||||||
|
<input type="text" v-validate="'numeric|min:0'" :name="[variantInputName + '[inventories][' + inventorySource.id + ']']" v-model="inventories[inventorySource.id]" class="control" v-on:keyup="updateTotalQty()"/>
|
||||||
|
<span class="control-error" v-if="errors.has(variantInputName + '[inventories][' + inventorySource.id + ']')">@{{ errors.first(variantInputName + '[inventories][' + inventorySource.id + ']') }}</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<div class="control-group" :class="[errors.has(variantInputName + '[price]') ? 'has-error' : '']">
|
||||||
|
<input type="text" v-validate="'required'" v-model="variant.price" :name="[variantInputName + '[price]']" class="control"/>
|
||||||
|
<span class="control-error" v-if="errors.has(variantInputName + '[price]')">@{{ errors.first(variantInputName + '[price]') }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<div class="control-group" :class="[errors.has(variantInputName + '[price]') ? 'has-error' : '']">
|
||||||
|
<input type="text" v-validate="'required'" v-model="variant.weight" :name="[variantInputName + '[weight]']" class="control"/>
|
||||||
|
<span class="control-error" v-if="errors.has(variantInputName + '[weight]')">@{{ errors.first(variantInputName + '[weight]') }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<div class="control-group">
|
||||||
|
<select type="text" v-model="variant.status" :name="[variantInputName + '[status]']" class="control">
|
||||||
|
<option value="1" :selected="variant.status">{{ __('admin::app.catalog.products.enabled') }}</option>
|
||||||
|
<option value="0" :selected="!variant.status">{{ __('admin::app.catalog.products.disabled') }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="actions">
|
||||||
|
<a :href="['{{ route('admin.catalog.products.index') }}/edit/' + variant.id]"><i class="icon pencil-lg-icon"></i></a>
|
||||||
|
<i class="icon remove-icon" @click="removeVariant()"></i>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
Vue.config.ignoredElements = [
|
||||||
|
'variant-form',
|
||||||
|
'variant-list',
|
||||||
|
'variant-item'
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
var super_attributes = @json($product->super_attributes);
|
||||||
|
var variants = @json($product->variants);
|
||||||
|
|
||||||
|
Vue.component('variant-form', {
|
||||||
|
|
||||||
|
data: () => ({
|
||||||
|
variant: {},
|
||||||
|
super_attributes: super_attributes
|
||||||
|
}),
|
||||||
|
|
||||||
|
template: '#variant-form-template',
|
||||||
|
|
||||||
|
created () {
|
||||||
|
this.resetModel();
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
addVariant (formScope) {
|
||||||
|
this.$validator.validateAll(formScope).then((result) => {
|
||||||
|
if (result) {
|
||||||
|
var this_this = this;
|
||||||
|
|
||||||
|
var filteredVariants = variants.filter(function(variant) {
|
||||||
|
var matchCount = 0;
|
||||||
|
|
||||||
|
for (var key in this_this.variant) {
|
||||||
|
if(variant[key] == this_this.variant[key]) {
|
||||||
|
matchCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return matchCount == this_this.super_attributes.length;
|
||||||
|
})
|
||||||
|
|
||||||
|
if(filteredVariants.length) {
|
||||||
|
this.$parent.closeModal();
|
||||||
|
|
||||||
|
window.flashMessages = [{'type': 'alert-error', 'message': "{{ __('admin::app.catalog.products.variant-already-exist-message') }}" }];
|
||||||
|
|
||||||
|
this.$root.addFlashMessages()
|
||||||
|
} else {
|
||||||
|
var optionIds = [];
|
||||||
|
for (var key in this_this.variant) {
|
||||||
|
optionIds.push(this_this.variant[key]);
|
||||||
|
}
|
||||||
|
|
||||||
|
variants.push(Object.assign({
|
||||||
|
sku: '{{ $product->sku }}' + '-variant-' + optionIds.join('-'),
|
||||||
|
name: '',
|
||||||
|
price: 0,
|
||||||
|
weight: 0,
|
||||||
|
status: 1
|
||||||
|
}, this.variant));
|
||||||
|
|
||||||
|
this.resetModel();
|
||||||
|
|
||||||
|
this.$parent.closeModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
resetModel () {
|
||||||
|
var this_this = this;
|
||||||
|
|
||||||
|
this.super_attributes.forEach(function(attribute) {
|
||||||
|
this_this.variant[attribute.code] = '';
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Vue.component('variant-list', {
|
||||||
|
|
||||||
|
template: '#variant-list-template',
|
||||||
|
|
||||||
|
inject: ['$validator'],
|
||||||
|
|
||||||
|
data: () => ({
|
||||||
|
variants: variants,
|
||||||
|
superAttributes: super_attributes
|
||||||
|
}),
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
removeVariant(variant) {
|
||||||
|
let index = this.variants.indexOf(variant)
|
||||||
|
|
||||||
|
this.variants.splice(index, 1)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
Vue.component('variant-item', {
|
||||||
|
|
||||||
|
template: '#variant-item-template',
|
||||||
|
|
||||||
|
props: ['index', 'variant'],
|
||||||
|
|
||||||
|
inject: ['$validator'],
|
||||||
|
|
||||||
|
data: () => ({
|
||||||
|
inventorySources: @json($inventorySources),
|
||||||
|
inventories: {},
|
||||||
|
totalQty: 0,
|
||||||
|
superAttributes: super_attributes
|
||||||
|
}),
|
||||||
|
|
||||||
|
created () {
|
||||||
|
var this_this = this;
|
||||||
|
this.inventorySources.forEach(function(inventorySource) {
|
||||||
|
this_this.inventories[inventorySource.id] = this_this.sourceInventoryQty(inventorySource.id)
|
||||||
|
this_this.totalQty += parseInt(this_this.inventories[inventorySource.id]);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
variantInputName () {
|
||||||
|
if(this.variant.id)
|
||||||
|
return "variants[" + this.variant.id + "]";
|
||||||
|
|
||||||
|
return "variants[variant_" + this.index + "]";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
removeVariant () {
|
||||||
|
this.$emit('onRemoveVariant', this.variant)
|
||||||
|
},
|
||||||
|
|
||||||
|
optionName (optionId) {
|
||||||
|
var optionName = '';
|
||||||
|
|
||||||
|
this.superAttributes.forEach(function(attribute) {
|
||||||
|
attribute.options.forEach(function(option) {
|
||||||
|
if(optionId == option.id) {
|
||||||
|
optionName = option.admin_name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
return optionName;
|
||||||
|
},
|
||||||
|
|
||||||
|
sourceInventoryQty (inventorySourceId) {
|
||||||
|
var inventories = this.variant.inventories.filter(function(inventory) {
|
||||||
|
return inventorySourceId === inventory.inventory_source_id;
|
||||||
|
})
|
||||||
|
|
||||||
|
if(inventories.length)
|
||||||
|
return inventories[0]['qty'];
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
updateTotalQty () {
|
||||||
|
this.totalQty = 0;
|
||||||
|
for (var key in this.inventories) {
|
||||||
|
this.totalQty += parseInt(this.inventories[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
@endif
|
||||||
|
|
@ -0,0 +1,146 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.catalog.products.add-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('css')
|
||||||
|
<style>
|
||||||
|
.table td .label {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
.table td .label:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
.table td .label .icon {
|
||||||
|
vertical-align: middle;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<form method="POST" action="" @submit.prevent="onSubmit">
|
||||||
|
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.catalog.products.add-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.catalog.products.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
@csrf()
|
||||||
|
|
||||||
|
<?php $familyId = app('request')->input('family') ?>
|
||||||
|
<?php $sku = app('request')->input('sku') ?>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.products.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('type') ? 'has-error' : '']">
|
||||||
|
<label for="type" class="required">{{ __('admin::app.catalog.products.product-type') }}</label>
|
||||||
|
<select class="control" v-validate="'required'" id="type" name="type" {{ $familyId ? 'disabled' : '' }}>
|
||||||
|
<option value="simple">{{ __('admin::app.catalog.products.simple') }}</option>
|
||||||
|
<option value="configurable" {{ $familyId ? 'selected' : '' }}>{{ __('admin::app.catalog.products.configurable') }}</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
@if($familyId)
|
||||||
|
<input type="hidden" name="type" value="configurable"/>
|
||||||
|
@endif
|
||||||
|
<span class="control-error" v-if="errors.has('type')">@{{ errors.first('type') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('attribute_family_id') ? 'has-error' : '']">
|
||||||
|
<label for="attribute_family_id" class="required">{{ __('admin::app.catalog.products.familiy') }}</label>
|
||||||
|
<select class="control" v-validate="'required'" id="attribute_family_id" name="attribute_family_id" {{ $familyId ? 'disabled' : '' }}>
|
||||||
|
<option value=""></option>
|
||||||
|
@foreach($families as $family)
|
||||||
|
<option value="{{ $family->id }}" {{ ($familyId == $family->id || old('attribute_family_id') == $family->id) ? 'selected' : '' }}>{{ $family->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
|
||||||
|
@if($familyId)
|
||||||
|
<input type="hidden" name="attribute_family_id" value="{{ $familyId }}"/>
|
||||||
|
@endif
|
||||||
|
<span class="control-error" v-if="errors.has('attribute_family_id')">@{{ errors.first('attribute_family_id') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('sku') ? 'has-error' : '']">
|
||||||
|
<label for="sku">{{ __('admin::app.catalog.products.sku') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="sku" name="sku" value="{{ $sku ?: old('sku') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('sku')">@{{ errors.first('sku') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
@if($familyId)
|
||||||
|
<accordian :title="'{{ __('admin::app.catalog.products.configurable-attributes') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="table">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{ __('admin::app.catalog.products.attribute-header') }}</th>
|
||||||
|
<th>{{ __('admin::app.catalog.products.attribute-option-header') }}</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
@foreach($configurableFamily->configurable_attributes as $attribute)
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{{ $attribute->name }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@foreach($attribute->options as $option)
|
||||||
|
<span class="label">
|
||||||
|
<input type="hidden" name="super_attributes[{{$attribute->code}}][]" value="{{ $option->id }}"/>
|
||||||
|
{{ $option->label }}
|
||||||
|
|
||||||
|
<i class="icon cross-icon"></i>
|
||||||
|
</span>
|
||||||
|
@endforeach
|
||||||
|
</td>
|
||||||
|
<td class="actions">
|
||||||
|
<i class="icon trash-icon"></i>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('.label .cross-icon').on('click', function(e) {
|
||||||
|
$(e.target).parent().remove();
|
||||||
|
})
|
||||||
|
|
||||||
|
$('.actions .trash-icon').on('click', function(e) {
|
||||||
|
$(e.target).parents('tr').remove();
|
||||||
|
})
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|
@ -0,0 +1,150 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.catalog.products.edit-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<?php $locale = request()->get('locale') ?: app()->getLocale(); ?>
|
||||||
|
<?php $channel = request()->get('channel') ?: core()->getCurrentChannelCode(); ?>
|
||||||
|
|
||||||
|
<form method="POST" action="" @submit.prevent="onSubmit" enctype="multipart/form-data">
|
||||||
|
|
||||||
|
<div class="page-header">
|
||||||
|
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.catalog.products.edit-title') }}</h1>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<select class="control" id="channel-switcher" name="channel">
|
||||||
|
@foreach(core()->getAllChannels() as $channelModel)
|
||||||
|
|
||||||
|
<option value="{{ $channelModel->code }}" {{ ($channelModel->code) == $channel ? 'selected' : '' }}>
|
||||||
|
{{ $channelModel->name }}
|
||||||
|
</option>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<select class="control" id="locale-switcher" name="locale">
|
||||||
|
@foreach(core()->getAllLocales() as $localeModel)
|
||||||
|
|
||||||
|
<option value="{{ $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}>
|
||||||
|
{{ $localeModel->name }}
|
||||||
|
</option>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.catalog.products.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
@csrf()
|
||||||
|
|
||||||
|
<input name="_method" type="hidden" value="PUT">
|
||||||
|
|
||||||
|
@foreach ($product->attribute_family->attribute_groups as $attributeGroup)
|
||||||
|
@if(count($attributeGroup->custom_attributes))
|
||||||
|
<accordian :title="'{{ __($attributeGroup->name) }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
@foreach($attributeGroup->custom_attributes as $attribute)
|
||||||
|
|
||||||
|
@if(!$product->super_attributes->contains($attribute))
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$validations = [];
|
||||||
|
$disabled = false;
|
||||||
|
if($product->type == 'configurable' && in_array($attribute->code, ['price', 'cost', 'special_price', 'special_price_from', 'special_price_to', 'width', 'height', 'depth', 'weight'])) {
|
||||||
|
if(!$attribute->is_required)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
$disabled = true;
|
||||||
|
} else {
|
||||||
|
if($attribute->is_required) {
|
||||||
|
array_push($validations, 'required');
|
||||||
|
}
|
||||||
|
|
||||||
|
array_push($validations, $attribute->validation);
|
||||||
|
}
|
||||||
|
|
||||||
|
$validations = implode('|', array_filter($validations));
|
||||||
|
?>
|
||||||
|
|
||||||
|
@if(view()->exists($typeView = 'admin::catalog.products.field-types.' . $attribute->type))
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']">
|
||||||
|
<label for="{{ $attribute->code }}" {{ $attribute->is_required ? 'class=required' : '' }}>
|
||||||
|
{{ $attribute->admin_name }}
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$channel_locale = [];
|
||||||
|
if($attribute->value_per_channel) {
|
||||||
|
array_push($channel_locale, $channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($attribute->value_per_locale) {
|
||||||
|
array_push($channel_locale, $locale);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
@if(count($channel_locale))
|
||||||
|
<span class="locale">[{{ implode(' - ', $channel_locale) }}]</span>
|
||||||
|
@endif
|
||||||
|
</label>
|
||||||
|
|
||||||
|
@include ($typeView)
|
||||||
|
|
||||||
|
<span class="control-error" v-if="errors.has('{{ $attribute->code }}')">@{{ errors.first('{!! $attribute->code !!}') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
@if ($form_accordians)
|
||||||
|
|
||||||
|
@foreach ($form_accordians->items as $accordian)
|
||||||
|
|
||||||
|
@include ($accordian['view'])
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#channel-switcher, #locale-switcher').on('change', function (e) {
|
||||||
|
$('#channel-switcher').val()
|
||||||
|
var query = '?channel=' + $('#channel-switcher').val() + '&locale=' + $('#locale-switcher').val();
|
||||||
|
|
||||||
|
window.location.href = "{{ route('admin.catalog.products.edit', $product->id) }}" + query;
|
||||||
|
})
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
<select v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" {{ $disabled ? 'disabled' : '' }}>
|
||||||
|
|
||||||
|
<?php $selectedOption = old($attribute->code) ?: $product[$attribute->code] ?>
|
||||||
|
|
||||||
|
<option value="0" {{ $selectedOption ? '' : 'selected'}}>
|
||||||
|
{{ $attribute->code == 'status' ? __('admin::app.catalog.products.disabled') : __('admin::app.catalog.products.no') }}
|
||||||
|
</option>
|
||||||
|
<option value="1" {{ $selectedOption ? 'selected' : ''}}>
|
||||||
|
{{ $attribute->code == 'status' ? __('admin::app.catalog.products.enabled') : __('admin::app.catalog.products.yes') }}
|
||||||
|
</option>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
<date>
|
||||||
|
<input type="text" name="{{ $attribute->code }}" class="control" {{ $attribute->is_required ? "v-validate='required'" : '' }} value="{{ old($attribute->code) ?: $product[$attribute->code] }}" {{ $disabled ? 'disabled' : '' }}/>
|
||||||
|
</date>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
<datetime>
|
||||||
|
<input type="text" name="{{ $attribute->code }}" class="control" {{ $attribute->is_required ? "v-validate='required'" : '' }} value="{{ old($attribute->code) ?: $product[$attribute->code]}}" {{ $disabled ? 'disabled' : '' }}>
|
||||||
|
</datetime>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<select v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" multiple {{ $disabled ? 'disabled' : '' }}>
|
||||||
|
|
||||||
|
@foreach($attribute->options as $option)
|
||||||
|
<option value="{{ $option->id }}" {{ in_array($option->id, explode(',', $attribute[$attribute->code])) ? 'selected' : ''}}>
|
||||||
|
{{ $option->admin_name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ old($attribute->code) ?: $product[$attribute->code]}}" {{ $disabled ? 'disabled' : '' }}/>
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
<select v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" {{ $disabled ? 'disabled' : '' }}>
|
||||||
|
|
||||||
|
<?php $selectedOption = old($attribute->code) ?: $product[$attribute->code] ?>
|
||||||
|
|
||||||
|
@foreach($attribute->options as $option)
|
||||||
|
<option value="{{ $option->id }}" {{ $option->id == $selectedOption ? 'selected' : ''}}>
|
||||||
|
{{ $option->admin_name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ old($attribute->code) ?: $product[$attribute->code] }}" {{ $disabled ? 'disabled' : '' }} {{ in_array($attribute->code, ['sku', 'url_key']) ? 'v-slugify' : '' }}/>
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<textarea v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" {{ $disabled ? 'disabled' : '' }}>{{ old($attribute->code) ?: $product[$attribute->code]}}</textarea>
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.catalog.products.products') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<a href="{{ route('admin.catalog.products.create') }}" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.catalog.products.add-product-btn-title') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
@inject('product','Webkul\Admin\DataGrids\ProductDataGrid')
|
||||||
|
{!! $product->render() !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
@extends('admin::layouts.master')
|
@extends('admin::layouts.master')
|
||||||
|
|
||||||
@section('content')
|
@section('content-wrapper')
|
||||||
<h1>Dashboard</h1>
|
<div class="content full-page">
|
||||||
|
<h1>Dashboard</h1>
|
||||||
|
</div>
|
||||||
@stop
|
@stop
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,115 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ config('app.locale') }}">
|
||||||
|
<head>
|
||||||
|
<title>@yield('page_title')</title>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="{{ asset('vendor/webkul/admin/assets/css/admin.css') }}">
|
||||||
|
<link rel="stylesheet" href="{{ asset('vendor/webkul/ui/assets/css/ui.css') }}">
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.container {
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: table;
|
||||||
|
z-index: 1;
|
||||||
|
background: #F8F9FA;
|
||||||
|
}
|
||||||
|
.center-box {
|
||||||
|
display: table-cell;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.adjacent-center {
|
||||||
|
width: 365px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-container .control-group .control {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-logo {
|
||||||
|
margin-bottom: 30px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
margin-top: 40px;
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer p {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #8E8E8E;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn.btn-primary {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
@yield('css')
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app" class="container">
|
||||||
|
|
||||||
|
<flash-wrapper ref='flashes'></flash-wrapper>
|
||||||
|
|
||||||
|
<div class="center-box">
|
||||||
|
|
||||||
|
<div class="adjacent-center">
|
||||||
|
|
||||||
|
<div class="brand-logo">
|
||||||
|
<img src="{{ asset('vendor/webkul/admin/assets/images/logo.png') }}" alt="Bagisto"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@yield('content')
|
||||||
|
|
||||||
|
<div class="footer">
|
||||||
|
<p>
|
||||||
|
© Copyright 2018 Webkul Software, All rights reserved.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.flashMessages = [];
|
||||||
|
@if($success = session('success'))
|
||||||
|
window.flashMessages = [{'type': 'alert-success', 'message': "{{ $success }}" }];
|
||||||
|
@elseif($warning = session('warning'))
|
||||||
|
window.flashMessages = [{'type': 'alert-warning', 'message': "{{ $warning }}" }];
|
||||||
|
@elseif($error = session('error'))
|
||||||
|
window.flashMessages = [{'type': 'alert-error', 'message': "{{ $error }}" }];
|
||||||
|
@endif
|
||||||
|
|
||||||
|
window.serverErrors = [];
|
||||||
|
@if (count($errors))
|
||||||
|
window.serverErrors = @json($errors->getMessages());
|
||||||
|
@endif
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="{{ asset('vendor/webkul/admin/assets/js/admin.js') }}"></script>
|
||||||
|
<script type="text/javascript" src="{{ asset('vendor/webkul/ui/assets/js/ui.js') }}"></script>
|
||||||
|
|
||||||
|
@yield('javascript')
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
@extends('admin::layouts.master')
|
||||||
|
|
||||||
|
@section('content-wrapper')
|
||||||
|
<div class="inner-section">
|
||||||
|
|
||||||
|
@include ('admin::layouts.nav-aside')
|
||||||
|
|
||||||
|
<div class="content-wrapper">
|
||||||
|
|
||||||
|
@include ('admin::layouts.tabs')
|
||||||
|
|
||||||
|
@yield('content')
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -10,38 +10,36 @@
|
||||||
<link rel="stylesheet" href="{{ asset('vendor/webkul/admin/assets/css/admin.css') }}">
|
<link rel="stylesheet" href="{{ asset('vendor/webkul/admin/assets/css/admin.css') }}">
|
||||||
<link rel="stylesheet" href="{{ asset('vendor/webkul/ui/assets/css/ui.css') }}">
|
<link rel="stylesheet" href="{{ asset('vendor/webkul/ui/assets/css/ui.css') }}">
|
||||||
|
|
||||||
|
@yield('head')
|
||||||
|
|
||||||
@yield('css')
|
@yield('css')
|
||||||
|
|
||||||
@yield('head')
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
|
|
||||||
<flash-wrapper ref='flashes'></flash-wrapper>
|
<flash-wrapper ref='flashes'></flash-wrapper>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@include ('admin::layouts.nav-top')
|
@include ('admin::layouts.nav-top')
|
||||||
|
|
||||||
@include ('admin::layouts.nav-left')
|
@include ('admin::layouts.nav-left')
|
||||||
|
|
||||||
<div class="content-container">
|
<div class="content-container">
|
||||||
|
|
||||||
@yield('content')
|
@yield('content-wrapper')
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" src="{{ asset('vendor/webkul/admin/assets/js/admin.js') }}"></script>
|
|
||||||
<script type="text/javascript" src="{{ asset('vendor/webkul/ui/assets/js/ui.js') }}"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.flashMessages= [];
|
window.flashMessages = [];
|
||||||
@if($success = session('success'))
|
@if($success = session('success'))
|
||||||
window.flashMessages = [{'type': 'alert-success', 'message': "{{ $success }}" }];
|
window.flashMessages = [{'type': 'alert-success', 'message': "{{ $success }}" }];
|
||||||
@elseif($warning = session('warning')))
|
@elseif($warning = session('warning'))
|
||||||
window.flashMessages = [{'type': 'alert-warning', 'message': "{{ $warning }}" }];
|
window.flashMessages = [{'type': 'alert-warning', 'message': "{{ $warning }}" }];
|
||||||
@elseif($error = session('error')))
|
@elseif($error = session('error'))
|
||||||
window.flashMessages = [{'type': 'alert-error', 'message': "{{ $error }}" }];
|
window.flashMessages = [{'type': 'alert-error', 'message': "{{ $error }}" }];
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
@ -51,7 +49,11 @@
|
||||||
@endif
|
@endif
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@yield('javascript')
|
<script type="text/javascript" src="{{ asset('vendor/webkul/admin/assets/js/admin.js') }}"></script>
|
||||||
|
<script type="text/javascript" src="{{ asset('vendor/webkul/ui/assets/js/ui.js') }}"></script>
|
||||||
|
|
||||||
|
@stack('scripts')
|
||||||
|
|
||||||
|
<div class="modal-overlay"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
@if(count($menu))
|
@if(count($subMenus))
|
||||||
<div class="aside-nav">
|
<div class="aside-nav">
|
||||||
<ul>
|
<ul>
|
||||||
@foreach($menu['items'] as $menu)
|
@foreach($subMenus['items'] as $menuItem)
|
||||||
<li class="{{ $menu['active'] ? 'active' : '' }}">
|
<li class="{{ $menu->getActive($menuItem) }}">
|
||||||
<a href="{{ $menu['url'] }}">
|
<a href="{{ $menuItem['url'] }}">
|
||||||
{{ $menu['name'] }}
|
{{ $menuItem['name'] }}
|
||||||
|
|
||||||
@if ($menu['active'])
|
@if ($menu->getActive($menuItem))
|
||||||
<i class="angle-right-icon"></i>
|
<i class="angle-right-icon"></i>
|
||||||
@endif
|
@endif
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
Administrator
|
Administrator
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<i class="icon arrow-down-icon-active"></i>
|
<i class="icon arrow-down-icon active"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="dropdown-list bottom-right">
|
<div class="dropdown-list bottom-right">
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
@if(count($tabs))
|
||||||
|
<div class="tabs">
|
||||||
|
<ul>
|
||||||
|
@foreach($tabs['items'] as $tab)
|
||||||
|
<li class="{{ $menu->getActive($tab) }}">
|
||||||
|
<a href="{{ $tab['url'] }}">
|
||||||
|
{{ $tab['name'] }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="{{ config('app.locale') }}">
|
|
||||||
<head>
|
|
||||||
<title>@yield('page_title')</title>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="{{ asset('vendor/webkul/admin/assets/css/admin.css') }}">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
|
|
||||||
<form method="POST" action="login">
|
|
||||||
@csrf
|
|
||||||
|
|
||||||
<div class="element-block">
|
|
||||||
<label for="email" class="field-label"></label>
|
|
||||||
<div class="field-block">
|
|
||||||
<input type="text" class="field" id="email" name="email"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="element-block">
|
|
||||||
<label for="password" class="field-label"></label>
|
|
||||||
<div class="field-block">
|
|
||||||
<input type="password" class="field" id="password" name="password"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@if (count($errors))
|
|
||||||
@foreach ($errors->all() as $error)
|
|
||||||
|
|
||||||
{{ $error }}
|
|
||||||
|
|
||||||
@endforeach
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<div class="button-block">
|
|
||||||
<button type="submit" class="button">Login</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
@ -0,0 +1,109 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.settings.channels.add-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.channels.store') }}" @submit.prevent="onSubmit">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.channels.add-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.channels.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.channels.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
|
||||||
|
<label for="code" class="required">{{ __('admin::app.settings.channels.code') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="code" name="code" value="{{ old('code') }}" v-code/>
|
||||||
|
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||||
|
<label for="name" class="required">{{ __('admin::app.settings.channels.name') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
|
||||||
|
<label for="description" class="required">{{ __('admin::app.settings.channels.description') }}</label>
|
||||||
|
<textarea class="control" id="description" name="description">{{ old('description') }}</textarea>
|
||||||
|
<span class="control-error" v-if="errors.has('description')">@{{ errors.first('description') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.channels.currencies-and-locales') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('locales[]') ? 'has-error' : '']">
|
||||||
|
<label for="locales" class="required">{{ __('admin::app.settings.channels.locales') }}</label>
|
||||||
|
<select v-validate="'required'" class="control" id="locales" name="locales[]" multiple>
|
||||||
|
@foreach(core()->getAllLocales() as $locale)
|
||||||
|
<option value="{{ $locale->id }}" {{ old('locales') && in_array($locale->id, old('locales')) ? 'selected' : '' }}>
|
||||||
|
{{ $locale->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('locales[]')">@{{ errors.first('locales[]') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('default_locale') ? 'has-error' : '']">
|
||||||
|
<label for="default_locale" class="required">{{ __('admin::app.settings.channels.default-locale') }}</label>
|
||||||
|
<select v-validate="'required'" class="control" id="default_locale" name="default_locale">
|
||||||
|
@foreach(core()->getAllLocales() as $locale)
|
||||||
|
<option value="{{ $locale->id }}" {{ old('default_locale') == $locale->id ? 'selected' : '' }}>
|
||||||
|
{{ $locale->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('default_locale')">@{{ errors.first('default_locale') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('currencies[]') ? 'has-error' : '']">
|
||||||
|
<label for="currencies" class="required">{{ __('admin::app.settings.channels.currencies') }}</label>
|
||||||
|
<select v-validate="'required'" class="control" id="currencies" name="currencies[]" multiple>
|
||||||
|
@foreach(core()->getAllCurrencies() as $currency)
|
||||||
|
<option value="{{ $currency->id }}" {{ old('currencies') && in_array($currency->id, old('currencies')) ? 'selected' : '' }}>
|
||||||
|
{{ $currency->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('currencies[]')">@{{ errors.first('currencies[]') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('base_currency') ? 'has-error' : '']">
|
||||||
|
<label for="base_currency" class="required">{{ __('admin::app.settings.channels.base-currency') }}</label>
|
||||||
|
<select v-validate="'required'" class="control" id="base_currency" name="base_currency">
|
||||||
|
@foreach(core()->getAllCurrencies() as $currency)
|
||||||
|
<option value="{{ $currency->id }}" {{ old('base_currency') == $currency->id ? 'selected' : '' }}>
|
||||||
|
{{ $currency->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('base_currency')">@{{ errors.first('base_currency') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,114 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.settings.channels.edit-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.channels.update', $channel->id) }}" @submit.prevent="onSubmit">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.channels.edit-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.channels.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
<input name="_method" type="hidden" value="PUT">
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.channels.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
|
||||||
|
<label for="code" class="required">{{ __('admin::app.settings.channels.code') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="code" name="code" value="{{ old('code') ?: $channel->code }}" v-code/>
|
||||||
|
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||||
|
<label for="name" class="required">{{ __('admin::app.settings.channels.name') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') ?: $channel->name }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
|
||||||
|
<label for="description" class="required">{{ __('admin::app.settings.channels.description') }}</label>
|
||||||
|
<textarea class="control" id="description" name="description">{{ old('description') ?: $channel->description }}</textarea>
|
||||||
|
<span class="control-error" v-if="errors.has('description')">@{{ errors.first('description') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.channels.currencies-and-locales') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('locales[]') ? 'has-error' : '']">
|
||||||
|
<label for="locales" class="required">{{ __('admin::app.settings.channels.locales') }}</label>
|
||||||
|
<?php $selectedOptionIds = old('locales') ?: $channel->locales->pluck('id')->toArray() ?>
|
||||||
|
<select v-validate="'required'" class="control" id="locales" name="locales[]" multiple>
|
||||||
|
@foreach(core()->getAllLocales() as $locale)
|
||||||
|
<option value="{{ $locale->id }}" {{ in_array($locale->id, $selectedOptionIds) ? 'selected' : '' }}>
|
||||||
|
{{ $locale->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('locales[]')">@{{ errors.first('locales[]') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('default_locale') ? 'has-error' : '']">
|
||||||
|
<label for="default_locale" class="required">{{ __('admin::app.settings.channels.default-locale') }}</label>
|
||||||
|
<?php $selectedOption = old('default_locale') ?: $channel->default_locale_id ?>
|
||||||
|
<select v-validate="'required'" class="control" id="default_locale" name="default_locale">
|
||||||
|
@foreach(core()->getAllLocales() as $locale)
|
||||||
|
<option value="{{ $locale->id }}" {{ $selectedOption == $locale->id ? 'selected' : '' }}>
|
||||||
|
{{ $locale->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('default_locale')">@{{ errors.first('default_locale') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('currencies[]') ? 'has-error' : '']">
|
||||||
|
<label for="currencies" class="required">{{ __('admin::app.settings.channels.currencies') }}</label>
|
||||||
|
<?php $selectedOptionIds = old('currencies') ?: $channel->currencies->pluck('id')->toArray() ?>
|
||||||
|
<select v-validate="'required'" class="control" id="currencies" name="currencies[]" multiple>
|
||||||
|
@foreach(core()->getAllCurrencies() as $currency)
|
||||||
|
<option value="{{ $currency->id }}" {{ in_array($currency->id, $selectedOptionIds) ? 'selected' : '' }}>
|
||||||
|
{{ $currency->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('currencies[]')">@{{ errors.first('currencies[]') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('base_currency') ? 'has-error' : '']">
|
||||||
|
<label for="base_currency" class="required">{{ __('admin::app.settings.channels.base-currency') }}</label>
|
||||||
|
<?php $selectedOption = old('base_currency') ?: $channel->base_currency_id ?>
|
||||||
|
<select v-validate="'required'" class="control" id="base_currency" name="base_currency">
|
||||||
|
@foreach(core()->getAllCurrencies() as $currency)
|
||||||
|
<option value="{{ $currency->id }}" {{ $selectedOption == $currency->id ? 'selected' : '' }}>
|
||||||
|
{{ $currency->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('base_currency')">@{{ errors.first('base_currency') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.channels.title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<a href="{{ route('admin.channels.create') }}" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.channels.add-title') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
@inject('channels','Webkul\Admin\DataGrids\ChannelDataGrid')
|
||||||
|
{!! $channels->render() !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.countries.store') }}" @submit.prevent="onSubmit">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.countries.add-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.countries.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.countries.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
|
||||||
|
<label for="code" class="required">{{ __('admin::app.settings.countries.code') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="code" name="code" v-code/>
|
||||||
|
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||||
|
<label for="name" class="required">{{ __('admin::app.settings.countries.name') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="name" name="name"/>
|
||||||
|
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.countries.title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<a href="{{ route('admin.countries.create') }}" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.countries.add-title') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
@inject('countries','Webkul\Admin\DataGrids\CountryDataGrid')
|
||||||
|
{!! $countries->render() !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.currencies.store') }}" @submit.prevent="onSubmit">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.currencies.add-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.currencies.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.currencies.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
|
||||||
|
<label for="code" class="required">{{ __('admin::app.settings.currencies.code') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="code" name="code" value="{{ old('code') }}" v-code/>
|
||||||
|
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||||
|
<label for="name" class="required">{{ __('admin::app.settings.currencies.name') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('symbol') ? 'has-error' : '']">
|
||||||
|
<label for="symbol" class="required">{{ __('admin::app.settings.currencies.symbol') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="symbol" name="symbol" value="{{ old('symbol') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('symbol')">@{{ errors.first('symbol') }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.currencies.update', $currency->id) }}" @submit.prevent="onSubmit">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.currencies.edit-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.currencies.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
<input name="_method" type="hidden" value="PUT">
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.currencies.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
|
||||||
|
<label for="code" class="required">{{ __('admin::app.settings.currencies.code') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="code" name="code" value="{{ old('code') ?: $currency->code }}" v-code/>
|
||||||
|
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||||
|
<label for="name" class="required">{{ __('admin::app.settings.currencies.name') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') ?: $currency->name }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('symbol') ? 'has-error' : '']">
|
||||||
|
<label for="symbol" class="required">{{ __('admin::app.settings.currencies.symbol') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="symbol" name="symbol" value="{{ old('symbol') ?: $currency->symbol }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('symbol')">@{{ errors.first('symbol') }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.currencies.title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<a href="{{ route('admin.currencies.create') }}" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.currencies.add-title') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
@inject('currencies','Webkul\Admin\DataGrids\CurrencyDataGrid')
|
||||||
|
{!! $currencies->render() !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.settings.exchange_rates.add-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.exchange_rates.store') }}" @submit.prevent="onSubmit">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.exchange_rates.add-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.exchange_rates.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.exchange_rates.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
<div class="control-group" :class="[errors.has('source_currency') ? 'has-error' : '']">
|
||||||
|
<label for="source_currency" class="required">{{ __('admin::app.settings.exchange_rates.source_currency') }}</label>
|
||||||
|
<select v-validate="'required'" class="control" name="source_currency">
|
||||||
|
@foreach($currencies as $currency)
|
||||||
|
<option value="{{ $currency->id }}">{{ $currency->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('source_currency')">@{{ errors.first('source_currency') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('target_currency') ? 'has-error' : '']">
|
||||||
|
<label for="target_currency" class="required">{{ __('admin::app.settings.exchange_rates.target_currency') }}</label>
|
||||||
|
<select v-validate="'required'" class="control" name="target_currency">
|
||||||
|
@foreach($currencies as $currency)
|
||||||
|
<option value="{{ $currency->id }}">{{ $currency->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('target_currency')">@{{ errors.first('target_currency') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('ratio') ? 'has-error' : '']">
|
||||||
|
<label for="ratio" class="required">{{ __('admin::app.settings.exchange_rates.ratio') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="ratio" name="ratio" value="{{ old('ratio') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('ratio')">@{{ errors.first('ratio') }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.settings.exchange_rates.edit-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.exchange_rates.update', $exchangeRate->id) }}" @submit.prevent="onSubmit">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.exchange_rates.edit-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.exchange_rates.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
<input name="_method" type="hidden" value="PUT">
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.exchange_rates.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
<div class="control-group" :class="[errors.has('source_currency') ? 'has-error' : '']">
|
||||||
|
<label for="source_currency" class="required">{{ __('admin::app.settings.exchange_rates.source_currency') }}</label>
|
||||||
|
<select v-validate="'required'" class="control" name="source_currency">
|
||||||
|
@foreach($currencies as $currency)
|
||||||
|
<option value="{{ $currency->id }}" {{ $exchangeRate->source_currency == $currency->id ? 'selected' : '' }}>
|
||||||
|
{{ $currency->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('source_currency')">@{{ errors.first('source_currency') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('target_currency') ? 'has-error' : '']">
|
||||||
|
<label for="target_currency" class="required">{{ __('admin::app.settings.exchange_rates.target_currency') }}</label>
|
||||||
|
<select v-validate="'required'" class="control" name="target_currency">
|
||||||
|
@foreach($currencies as $currency)
|
||||||
|
<option value="{{ $currency->id }}" {{ $exchangeRate->target_currency == $currency->id ? 'selected' : '' }}>
|
||||||
|
{{ $currency->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('target_currency')">@{{ errors.first('target_currency') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('ratio') ? 'has-error' : '']">
|
||||||
|
<label for="ratio" class="required">{{ __('admin::app.settings.exchange_rates.ratio') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="ratio" name="ratio" value="{{ old('ratio') ?: $exchangeRate->ratio }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('ratio')">@{{ errors.first('ratio') }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.settings.exchange_rates.title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.exchange_rates.title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<a href="{{ route('admin.exchange_rates.create') }}" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.exchange_rates.add-title') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
@inject('exchange_rates','Webkul\Admin\DataGrids\ExchangeRatesDataGrid')
|
||||||
|
{!! $exchange_rates->render() !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,141 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.settings.inventory_sources.add-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.inventory_sources.store') }}" @submit.prevent="onSubmit">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.inventory_sources.add-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.inventory_sources.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.inventory_sources.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
|
||||||
|
<label for="code" class="required">{{ __('admin::app.settings.inventory_sources.code') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="code" name="code" value="{{ old('code') }}" v-code/>
|
||||||
|
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||||
|
<label for="name" class="required">{{ __('admin::app.settings.inventory_sources.name') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="description">{{ __('admin::app.settings.inventory_sources.description') }}</label>
|
||||||
|
<textarea class="control" id="description" name="description">{{ old('description') }}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="latitude">{{ __('admin::app.settings.inventory_sources.latitude') }}</label>
|
||||||
|
<input class="control" id="latitude" name="latitude" value="{{ old('latitude') }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="longitude">{{ __('admin::app.settings.inventory_sources.longitude') }}</label>
|
||||||
|
<input class="control" id="longitude" name="longitude" value="{{ old('longitude') }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="priority">{{ __('admin::app.settings.inventory_sources.priority') }}</label>
|
||||||
|
<input class="control" id="priority" name="priority" value="{{ old('priority') }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="status">{{ __('admin::app.settings.inventory_sources.status') }}</label>
|
||||||
|
<span class="checkbox">
|
||||||
|
<input type="checkbox" id="status" name="status" value="1">
|
||||||
|
<label class="checkbox-view" for="status"></label>
|
||||||
|
{{ __('admin::app.settings.inventory_sources.source-is-active') }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.inventory_sources.contact-info') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="contact_name">{{ __('admin::app.settings.inventory_sources.contact_name') }}</label>
|
||||||
|
<input class="control" id="contact_name" name="contact_name" value="{{ old('contact_name') }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="contact_email">{{ __('admin::app.settings.inventory_sources.contact_email') }}</label>
|
||||||
|
<input class="control" id="contact_email" name="contact_email" value="{{ old('contact_email') }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="contact_number">{{ __('admin::app.settings.inventory_sources.contact_number') }}</label>
|
||||||
|
<input class="control" id="contact_number" name="contact_number" value="{{ old('contact_number') }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="contact_fax">{{ __('admin::app.settings.inventory_sources.contact_fax') }}</label>
|
||||||
|
<input class="control" id="country" name="contact_fax" value="{{ old('contact_fax') }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.inventory_sources.address') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="country">{{ __('admin::app.settings.inventory_sources.country') }}</label>
|
||||||
|
<select class="control" id="country" name="country">
|
||||||
|
@foreach(country()->all() as $countryCoode => $countryName)
|
||||||
|
<option value="{{ $countryCoode }}" {{ old('country') == $countryCoode ? 'selected' : '' }}>
|
||||||
|
{{ $countryName }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="state">{{ __('admin::app.settings.inventory_sources.state') }}</label>
|
||||||
|
<input class="control" id="state" name="state" value="{{ old('state') }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="city">{{ __('admin::app.settings.inventory_sources.city') }}</label>
|
||||||
|
<input class="control" id="city" name="city" value="{{ old('city') }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="street">{{ __('admin::app.settings.inventory_sources.street') }}</label>
|
||||||
|
<input class="control" id="street" name="street" value="{{ old('street') }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="postcode">{{ __('admin::app.settings.inventory_sources.postcode') }}</label>
|
||||||
|
<input class="control" id="postcode" name="postcode" value="{{ old('postcode') }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,143 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.settings.inventory_sources.edit-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.inventory_sources.update', $inventorySource->id) }}" @submit.prevent="onSubmit">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.inventory_sources.edit-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.inventory_sources.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
<input name="_method" type="hidden" value="PUT">
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.inventory_sources.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
|
||||||
|
<label for="code" class="required">{{ __('admin::app.settings.inventory_sources.code') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="code" name="code" value="{{ old('code') ?: $inventorySource->code }}" v-code/>
|
||||||
|
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||||
|
<label for="name" class="required">{{ __('admin::app.settings.inventory_sources.name') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') ?: $inventorySource->name }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="description">{{ __('admin::app.settings.inventory_sources.description') }}</label>
|
||||||
|
<textarea class="control" id="description" name="description">{{ old('description') ?: $inventorySource->description }}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="latitude">{{ __('admin::app.settings.inventory_sources.latitude') }}</label>
|
||||||
|
<input class="control" id="latitude" name="latitude" value="{{ old('latitude') ?: $inventorySource->latitude }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="longitude">{{ __('admin::app.settings.inventory_sources.longitude') }}</label>
|
||||||
|
<input class="control" id="longitude" name="longitude" value="{{ old('longitude') ?: $inventorySource->longitude }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="priority">{{ __('admin::app.settings.inventory_sources.priority') }}</label>
|
||||||
|
<input class="control" id="priority" name="priority" value="{{ old('priority') ?: $inventorySource->priority }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="status">{{ __('admin::app.settings.inventory_sources.status') }}</label>
|
||||||
|
<span class="checkbox">
|
||||||
|
<input type="checkbox" id="status" name="status" value="{{ $inventorySource->status }}" {{ $inventorySource->status ? 'checked' : '' }}>
|
||||||
|
<label class="checkbox-view" for="status"></label>
|
||||||
|
{{ __('admin::app.settings.inventory_sources.source-is-active') }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.inventory_sources.contact-info') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="contact_name">{{ __('admin::app.settings.inventory_sources.contact_name') }}</label>
|
||||||
|
<input class="control" id="contact_name" name="contact_name" value="{{ old('contact_name') ?: $inventorySource->contact_name }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="contact_email">{{ __('admin::app.settings.inventory_sources.contact_email') }}</label>
|
||||||
|
<input class="control" id="contact_email" name="contact_email" value="{{ old('contact_email') ?: $inventorySource->symbol }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="contact_number">{{ __('admin::app.settings.inventory_sources.contact_number') }}</label>
|
||||||
|
<input class="control" id="contact_number" name="contact_number" value="{{ old('contact_number') ?: $inventorySource->contact_number }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="contact_fax">{{ __('admin::app.settings.inventory_sources.contact_fax') }}</label>
|
||||||
|
<input class="control" id="country" name="contact_fax" value="{{ old('contact_fax') ?: $inventorySource->contact_fax }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.inventory_sources.address') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<?php $selectedCountry = old('country') ?: $inventorySource->country ?>
|
||||||
|
<label for="country">{{ __('admin::app.settings.inventory_sources.country') }}</label>
|
||||||
|
<select class="control" id="country" name="country">
|
||||||
|
@foreach(country()->all() as $countryCoode => $countryName)
|
||||||
|
<option value="{{ $countryCoode }}" {{ $selectedCountry == $countryCoode ? 'selected' : '' }}>
|
||||||
|
{{ $countryName }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="state">{{ __('admin::app.settings.inventory_sources.state') }}</label>
|
||||||
|
<input class="control" id="state" name="state" value="{{ old('state') ?: $inventorySource->state }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="city">{{ __('admin::app.settings.inventory_sources.city') }}</label>
|
||||||
|
<input class="control" id="city" name="city" value="{{ old('city') ?: $inventorySource->city }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="street">{{ __('admin::app.settings.inventory_sources.street') }}</label>
|
||||||
|
<input class="control" id="street" name="street" value="{{ old('street') ?: $inventorySource->street }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="postcode">{{ __('admin::app.settings.inventory_sources.postcode') }}</label>
|
||||||
|
<input class="control" id="postcode" name="postcode" value="{{ old('postcode') ?: $inventorySource->postcode }}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.settings.inventory_sources.title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.inventory_sources.title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<a href="{{ route('admin.inventory_sources.create') }}" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.inventory_sources.add-title') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
@inject('inventory_sources','Webkul\Admin\DataGrids\InventorySourcesDataGrid')
|
||||||
|
{!! $inventory_sources->render() !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.settings.locales.add-locale-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.locales.store') }}" @submit.prevent="onSubmit">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.locales.add-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.locales.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.locales.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
|
||||||
|
<label for="code">{{ __('admin::app.settings.locales.code') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="code" name="code" v-code/>
|
||||||
|
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||||
|
<label for="name">{{ __('admin::app.settings.locales.name') }}</label>
|
||||||
|
<input v-validate="'required'" class="control" id="name" name="name"/>
|
||||||
|
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.locales.title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<a href="{{ route('admin.locales.create') }}" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.locales.add-title') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
|
||||||
|
@inject('locales','Webkul\Admin\DataGrids\LocalesDataGrid')
|
||||||
|
{!! $locales->render() !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.settings.sliders.add-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<form method="POST" action="{{ route('admin.sliders.create') }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.sliders.add-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.sliders.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
<accordian :title="'{{ __('admin::app.settings.sliders.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('title') ? 'has-error' : '']">
|
||||||
|
<label for="title">{{ __('admin::app.settings.sliders.title') }}</label>
|
||||||
|
<input type="text" class="control" name="title" v-validate="'required'">
|
||||||
|
<span class="control-error" v-if="errors.has('title')">@{{ errors.first('title') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('channel_id') ? 'has-error' : '']">
|
||||||
|
<label for="channel_id">{{ __('admin::app.settings.sliders.channels') }}</label>
|
||||||
|
<select class="control" id="channel_id" name="channel_id" value="" v-validate="'required'">
|
||||||
|
@foreach($channels[0] as $channel)
|
||||||
|
<option value="{{ $channel->id }}">{{ __($channel->name) }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<span class="control-error" v-if="errors.has('channel_id')">@{{ errors.first('channel_id') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('image') ? 'has-error' : '']">
|
||||||
|
<label for="new_image">{{ __('admin::app.settings.sliders.image') }}</label>
|
||||||
|
|
||||||
|
<image-upload>
|
||||||
|
|
||||||
|
<input type="file" class="control" id="add_image" name="image" value="" v-validate="'image|required'" placeholder="Upload from Outer"/>
|
||||||
|
|
||||||
|
<span class="control-error" v-if="errors.has('image')">@{{ errors.first('image') }}</span>
|
||||||
|
{{-- The image field validation is not working, resolve it. --}}
|
||||||
|
|
||||||
|
</image-upload>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('content') ? 'has-error' : '']">
|
||||||
|
<label for="content">{{ __('admin::app.settings.sliders.content') }}</label>
|
||||||
|
|
||||||
|
<textarea class="control" id="add_content" name="content" v-validate="'required'" rows="5"></textarea>
|
||||||
|
|
||||||
|
<span class="control-error" v-if="errors.has('content')">@{{ errors.first('content') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.settings.sliders.title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<a href="{{ route('admin.sliders.store') }}" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.settings.sliders.add-title') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
@inject('sliders','Webkul\Admin\DataGrids\SliderDataGrid')
|
||||||
|
{!! $sliders->render() !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
@extends('admin::layouts.anonymous-master')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.users.forget-password.title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('css')
|
||||||
|
<style>
|
||||||
|
.button-group {
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
||||||
|
.primary-back-icon {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
<div class="panel">
|
||||||
|
|
||||||
|
<div class="panel-content">
|
||||||
|
|
||||||
|
<div class="form-container" style="text-align: left">
|
||||||
|
|
||||||
|
<h1>{{ __('admin::app.users.forget-password.header-title') }}</h1>
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.forget-password.store') }}" @submit.prevent="onSubmit">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('email') ? 'has-error' : '']">
|
||||||
|
<label for="email">{{ __('admin::app.users.forget-password.email') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="email" name="email" value="{{ old('email') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('email')">@{{ errors.first('email') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="button-group">
|
||||||
|
<button class="btn btn-xl btn-primary">{{ __('admin::app.users.forget-password.submit-btn-title') }}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" style="margin-bottom: 0">
|
||||||
|
<a href="{{ route('admin.session.create') }}">
|
||||||
|
<i class="icon primary-back-icon"></i>
|
||||||
|
{{ __('admin::app.users.forget-password.back-link-title') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@stop
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
@extends('admin::layouts.master')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
@include ('admin::layouts.nav-aside')
|
|
||||||
|
|
||||||
<div class="content">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
@stop
|
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
@extends('admin::layouts.anonymous-master')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.users.reset-password.title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('css')
|
||||||
|
<style>
|
||||||
|
.button-group {
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
||||||
|
.primary-back-icon {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
<div class="panel">
|
||||||
|
|
||||||
|
<div class="panel-content">
|
||||||
|
|
||||||
|
<div class="form-container" style="text-align: left">
|
||||||
|
|
||||||
|
<h1>{{ __('admin::app.users.reset-password.title') }}</h1>
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.reset-password.store') }}" @submit.prevent="onSubmit">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<input type="hidden" name="token" value="{{ $token }}">
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('email') ? 'has-error' : '']">
|
||||||
|
<label for="email">{{ __('admin::app.users.reset-password.email') }}</label>
|
||||||
|
<input type="text" v-validate="'required|email'" class="control" id="email" name="email" value="{{ old('email') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('email')">@{{ errors.first('email') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('password') ? 'has-error' : '']">
|
||||||
|
<label for="password">{{ __('admin::app.users.reset-password.password') }}</label>
|
||||||
|
<input type="password" v-validate="'required|min:6'" class="control" id="password" name="password"/>
|
||||||
|
<span class="control-error" v-if="errors.has('password')">@{{ errors.first('password') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" :class="[errors.has('password_confirmation') ? 'has-error' : '']">
|
||||||
|
<label for="password_confirmation">{{ __('admin::app.users.reset-password.confirm-password') }}</label>
|
||||||
|
<input type="password" v-validate="'required|min:6|confirmed:password'" class="control" id="password_confirmation" name="password_confirmation" data-vv-as="password"/>
|
||||||
|
<span class="control-error" v-if="errors.has('password_confirmation')">@{{ errors.first('password_confirmation') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="button-group">
|
||||||
|
<button type="submit" class="btn btn-xl btn-primary">{{ __('admin::app.users.reset-password.submit-btn-title') }}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" style="margin-bottom: 0">
|
||||||
|
<a href="{{ route('admin.session.create') }}">
|
||||||
|
<i class="icon primary-back-icon"></i>
|
||||||
|
{{ __('admin::app.users.reset-password.back-link-title') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@stop
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
{{ __('admin::app.users.roles.add-role-title') }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('admin.roles.store') }}" @submit.prevent="onSubmit">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<h1>{{ __('admin::app.users.roles.add-role-title') }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-action">
|
||||||
|
<button type="submit" class="btn btn-lg btn-primary">
|
||||||
|
{{ __('admin::app.users.roles.save-btn-title') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="form-container">
|
||||||
|
@csrf()
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.users.roles.general') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||||
|
<label for="name" class="required">{{ __('admin::app.users.roles.name') }}</label>
|
||||||
|
<input type="text" v-validate="'required'" class="control" id="email" name="name" value="{{ old('name') }}"/>
|
||||||
|
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="description">{{ __('admin::app.users.roles.description') }}</label>
|
||||||
|
<textarea class="control" id="description" name="description">
|
||||||
|
{{ old('description') }}
|
||||||
|
</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
|
||||||
|
<accordian :title="'{{ __('admin::app.users.roles.access-control') }}'" :active="true">
|
||||||
|
<div slot="body">
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="permission_type">{{ __('admin::app.users.roles.permissions') }}</label>
|
||||||
|
<select class="control" name="permission_type" id="permission_type">
|
||||||
|
<option value="custom">{{ __('admin::app.users.roles.custom') }}</option>
|
||||||
|
<option value="all">{{ __('admin::app.users.roles.all') }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<tree-view value-field="key" id-field="key" items='@json($acl->items)'></tree-view>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</accordian>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#permission_type').on('change', function(e) {
|
||||||
|
if($(e.target).val() == 'custom') {
|
||||||
|
$('.tree-container').removeClass('hide')
|
||||||
|
} else {
|
||||||
|
$('.tree-container').addClass('hide')
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue