diff --git a/.gitignore b/.gitignore index a8b6a79d2..b8f14e562 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ Homestead.yaml npm-debug.log yarn-error.log .env +/ignorables/* \ No newline at end of file diff --git a/composer.json b/composer.json index 502e36421..79eefdf65 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ "php": "^7.1.3", "dimsav/laravel-translatable": "^9.0", "fideloper/proxy": "^4.0", + "intervention/image": "^2.4", "kalnoy/nestedset": "^4.3", "laravel/framework": "5.6.*", "laravel/tinker": "^1.0", diff --git a/composer.lock b/composer.lock index d907946d1..43a06425e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "daaa24e649dd4e9808feef8251e43247", + "content-hash": "8acd4eec85be1351459a67cfd14d039b", "packages": [ { "name": "commerceguys/intl", @@ -465,6 +465,141 @@ ], "time": "2018-02-07T20:20:57+00:00" }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20T17:10:46+00:00" + }, + { + "name": "intervention/image", + "version": "2.4.2", + "source": { + "type": "git", + "url": "https://github.com/Intervention/image.git", + "reference": "e82d274f786e3d4b866a59b173f42e716f0783eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Intervention/image/zipball/e82d274f786e3d4b866a59b173f42e716f0783eb", + "reference": "e82d274f786e3d4b866a59b173f42e716f0783eb", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "guzzlehttp/psr7": "~1.1", + "php": ">=5.4.0" + }, + "require-dev": { + "mockery/mockery": "~0.9.2", + "phpunit/phpunit": "^4.8 || ^5.7" + }, + "suggest": { + "ext-gd": "to use GD library based image processing.", + "ext-imagick": "to use Imagick based image processing.", + "intervention/imagecache": "Caching extension for the Intervention Image library" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + }, + "laravel": { + "providers": [ + "Intervention\\Image\\ImageServiceProvider" + ], + "aliases": { + "Image": "Intervention\\Image\\Facades\\Image" + } + } + }, + "autoload": { + "psr-4": { + "Intervention\\Image\\": "src/Intervention/Image" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oliver Vogel", + "email": "oliver@olivervogel.com", + "homepage": "http://olivervogel.com/" + } + ], + "description": "Image handling and manipulation library with support for Laravel integration", + "homepage": "http://image.intervention.io/", + "keywords": [ + "gd", + "image", + "imagick", + "laravel", + "thumbnail", + "watermark" + ], + "time": "2018-05-29T14:19:03+00:00" + }, { "name": "jakub-onderka/php-console-color", "version": "0.1", @@ -1371,6 +1506,56 @@ ], "time": "2017-02-14T16:28:37+00:00" }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, { "name": "psr/log", "version": "1.0.2", diff --git a/config/app.php b/config/app.php index 41513b3e8..c0c8e6ef1 100644 --- a/config/app.php +++ b/config/app.php @@ -170,6 +170,9 @@ return [ App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, + //Laravel Intervention + Intervention\Image\ImageServiceProvider::class, + //Webkul packages Webkul\User\Providers\UserServiceProvider::class, Webkul\Admin\Providers\AdminServiceProvider::class, @@ -232,7 +235,8 @@ return [ 'URL' => Illuminate\Support\Facades\URL::class, 'Validator' => Illuminate\Support\Facades\Validator::class, 'View' => Illuminate\Support\Facades\View::class, - 'Datagrid' => Webkul\Ui\DataGrid\Facades\DataGrid::class + 'Datagrid' => Webkul\Ui\DataGrid\Facades\DataGrid::class, + 'Image' => Intervention\Image\Facades\Image::class ], ]; diff --git a/config/image.php b/config/image.php new file mode 100644 index 000000000..2b1d2c3e1 --- /dev/null +++ b/config/image.php @@ -0,0 +1,20 @@ + 'gd' + +]; diff --git a/packages/Webkul/Admin/src/Http/Controllers/DataGridController.php b/packages/Webkul/Admin/src/Http/Controllers/DataGridController.php index be8676840..6b4d52397 100644 --- a/packages/Webkul/Admin/src/Http/Controllers/DataGridController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/DataGridController.php @@ -22,120 +22,73 @@ class DataGridController extends Controller */ public function index() { - // $select_verbs = [ - // 0 => "aggregate", - // 1 => "columns", - // 2 => "from", - // 3 => "joins", - // 4 => "wheres", - // 5 => "groups", - // 6 => "havings", - // 7 => "orders", - // 8 => "limit", - // 9 => "offset", - // 10 => "lock" - // ]; - // $bindings = [ - // "select" => [], - // "from" => [], - // "join" => [], - // "where" => [], - // "having" => [], - // "order" => [], - // "union" => [], - // ]; - // $operators = [ - // 'eq' => "=", - // 'lt' => "<", - // 'gt' => ">", - // 'lte' => "<=", - // 'gte' => ">=", - // 'neqs' => "<>", - // 'neqn' => "!=", - // 'ceq' => "<=>", - // 'like' => "like", - // 'likebin' => "like binary", - // 'ntlike' => "not like", - // 'ilike' => "ilike", - // 'regex' => "regexp", - // 'notregex' => "not regexp", - // 'simto' => "similar to", - // 'nsimto' => "not similar to", - // 'nilike' => "not ilike", - // ]; DataGrid::make([ - 'name' => 'authors', - 'table' => 'authors as a', - 'select' => 'a.id', + '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' => 'a.id', + 'column' => 'u.id', 'type' => 'integer', 'label' => 'Admin ID' ], [ - 'column' => 'a.email', + 'column' => 'u.email', 'type' => 'string', 'label' => 'Admin E-Mail', ], [ - 'column' => 'a.first_name', + 'column' => 'u.name', 'type' => 'string', 'label' => 'Admin Name', ] ], 'searchables' =>[ [ - 'name' => 'a.id', + 'name' => 'u.id', 'label' => 'ID', 'label' => 'Admin ID', ], [ - 'name' => 'a.name', + 'name' => 'u.name', 'label' => 'Name', 'label' => 'Admin Name', ] ], 'join' => [ - // [ - // 'join' => 'leftjoin', - // 'table' => 'posts as p', - // 'primaryKey' => 'a.id', - // 'condition' => '=', - // 'secondaryKey' => 'p.author_id', - // ] + [ + 'join' => 'leftjoin', + 'table' => 'roles as r', + 'primaryKey' => 'u.role_id', + 'condition' => '=', + 'secondaryKey' => 'r.id', + ] ], 'columns' => [ [ - 'name' => 'a.id', + 'name' => 'u.id', 'type' => 'string', 'label' => 'Admin ID', 'sortable' => true, 'filterable' => true ], [ - 'name' => 'a.email', + 'name' => 'u.email', 'type' => 'string', 'label' => 'Admin E-Mail', 'sortable' => true, 'filterable' => true ], - // [ - // 'name' => 'p.content as pp', - // 'type' => 'string', - // 'label' => 'Content', - // 'sortable' => true, - // 'filterable' => false, - // ], [ - 'name' => 'a.first_name', + 'name' => 'u.name', 'type' => 'string', 'label' => 'Admin Name', 'sortable' => true, 'filterable' => true, // will create on run time query // 'filter' => [ - // 'function' => 'where', // orwhere - // 'condition' => ['name', '=', 'Admin'] // multiarray + // 'function' => 'orwhere', // orwhere + // 'condition' => ['name', 'like', 'u'] // multiarray // ], 'attributes' => [ 'class' => 'class-a class-b', @@ -143,10 +96,23 @@ class DataGridController extends Controller 'onclick' => "window.alert('alert from datagrid column')" ], 'wrapper' => function ($value, $object) { - return '' . $object->first_name . ''; + return '' . $object->name . ''; }, ], - + [ + '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' => [ @@ -174,13 +140,6 @@ class DataGridController extends Controller ]); $result = DataGrid::render(); return $result; - // $prepareMassAction = DataGrid::massAction(); - // if ($prepareMassAction) { - // $result = DataGrid::render(); - // return $result; - // } else { - // throw new \Exception('Mass Actions Attributes Have Some Unknown Problems'); - // } } //for performing mass actions @@ -213,7 +172,6 @@ class DataGridController extends Controller ] ]; $result = DataGrid::makeMassAction($make); - // return $result; } public function massDelete(Request $r) diff --git a/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/ChannelsComposer.php b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/ChannelsComposer.php new file mode 100644 index 000000000..9a213fa8a --- /dev/null +++ b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/ChannelsComposer.php @@ -0,0 +1,154 @@ + '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' => 'channel_id', + 'type' => 'number', + 'label' => 'Channel ID', + ], + [ + 'column' => 'code', + 'alias' => 'channel_code', + 'type' => 'string', + 'label' => 'Channel Code', + ], + [ + 'column' => 'name', + 'alias' => 'channel_name', + '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' => [] + + ]); + + $view->with('datagrid', $datagrid); + // $view->with('count', $this->users->count()); + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/CountryComposer.php b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/CountryComposer.php new file mode 100644 index 000000000..7d4c1ae36 --- /dev/null +++ b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/CountryComposer.php @@ -0,0 +1,167 @@ + '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' => 'country_id', + 'type' => 'number', + 'label' => 'ID', + 'sortable' => true, + ], + [ + 'name' => 'code', + 'alias' => 'country_code', + 'type' => 'string', + 'label' => 'Code', + 'sortable' => true, + ], + [ + 'name' => 'name', + 'alias' => 'country_name', + 'type' => 'string', + 'label' => 'Name', + 'sortable' => true, + ], + [ + 'name' => 'status', + 'alias' => 'country_status', + 'type' => 'number', + 'label' => 'Code', + 'sortable' => true, + ], + + ], + + //don't use aliasing in case of filters + + 'filterable' => [ + [ + 'column' => 'id', + 'alias' => 'country_id', + 'type' => 'number', + 'label' => 'ID', + ], + [ + 'column' => 'code', + 'alias' => 'country_code', + 'type' => 'string', + 'label' => 'Code', + ], + [ + 'column' => 'name', + 'alias' => 'country_name', + 'type' => 'string', + 'label' => 'Name', + ], + [ + 'column' => 'status', + 'alias' => 'country_status', + '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' => [] + + ]); + + $view->with('datagrid', $datagrid); + // $view->with('count', $this->users->count()); + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/CurrenciesComposer.php b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/CurrenciesComposer.php new file mode 100644 index 000000000..b489aa97d --- /dev/null +++ b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/CurrenciesComposer.php @@ -0,0 +1,154 @@ + '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' => 'currency_id', + 'type' => 'number', + 'label' => 'ID', + 'sortable' => true, + ], + [ + 'name' => 'code', + 'alias' => 'currency_code', + 'type' => 'string', + 'label' => 'Code', + 'sortable' => true, + ], + [ + 'name' => 'name', + 'alias' => 'currency_name', + 'type' => 'string', + 'label' => 'Name', + 'sortable' => true, + ], + + ], + + //don't use aliasing in case of filters + + 'filterable' => [ + [ + 'column' => 'id', + 'alias' => 'currency_id', + 'type' => 'number', + 'label' => 'ID', + ], + [ + 'column' => 'code', + 'alias' => 'currency_code', + 'type' => 'string', + 'label' => 'Code', + ], + [ + 'column' => 'name', + 'alias' => 'currency_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' => [] + + ]); + + $view->with('datagrid', $datagrid); + // $view->with('count', $this->users->count()); + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/ExchangeRatesComposer.php b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/ExchangeRatesComposer.php new file mode 100644 index 000000000..c207f3881 --- /dev/null +++ b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/ExchangeRatesComposer.php @@ -0,0 +1,162 @@ + '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' => 'exch_id', + 'type' => 'number', + 'label' => 'Rate ID', + 'sortable' => true, + ], + [ + 'name' => 'source_currency', + 'alias' => 'exch_source_currency', + 'type' => 'string', + 'label' => 'Source Currency', + 'sortable' => true, + ], + [ + 'name' => 'target_currency', + 'alias' => 'exch_target_currency', + 'type' => 'string', + 'label' => 'Target Currency', + 'sortable' => true, + ], + [ + 'name' => 'ratio', + 'alias' => 'exch_ratio', + 'type' => 'string', + 'label' => 'Exchange Ratio', + ], + + ], + + //don't use aliasing in case of filters + + 'filterable' => [ + [ + 'column' => 'id', + 'alias' => 'exch_id', + 'type' => 'number', + 'label' => 'Rate ID', + ], + [ + 'column' => 'source_currency', + 'alias' => 'exch_source_currency', + 'type' => 'string', + 'label' => 'Source Currency', + 'sortable' => true, + ], + [ + 'column' => 'target_currency', + 'alias' => 'exch_target_currency', + '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' => [] + + ]); + + $view->with('datagrid', $datagrid); + // $view->with('count', $this->users->count()); + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/InventorySourcesComposer.php b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/InventorySourcesComposer.php new file mode 100644 index 000000000..b6b2c4083 --- /dev/null +++ b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/InventorySourcesComposer.php @@ -0,0 +1,167 @@ + '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' => 'inventory_id', + 'type' => 'number', + 'label' => 'ID', + 'sortable' => true, + ], + [ + 'name' => 'code', + 'alias' => 'inventory_code', + 'type' => 'string', + 'label' => 'Code', + 'sortable' => true, + ], + [ + 'name' => 'name', + 'alias' => 'inventory_name', + 'type' => 'string', + 'label' => 'Name', + 'sortable' => true, + ], + [ + 'name' => 'priority', + 'alias' => 'inventory_priority', + 'type' => 'string', + 'label' => 'Priority', + 'sortable' => true, + ], + [ + 'name' => 'status', + 'alias' => 'inventory_status', + 'type' => 'string', + 'label' => 'Status', + 'sortable' => true, + ], + + ], + + //don't use aliasing in case of filters + + 'filterable' => [ + [ + 'column' => 'id', + 'alias' => 'inventory_id', + 'type' => 'number', + 'label' => 'ID', + ], + [ + 'column' => 'code', + 'alias' => 'inventory_code', + 'type' => 'string', + 'label' => 'Code', + ], + [ + 'column' => 'name', + 'alias' => 'inventory_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' => [] + + ]); + + $view->with('datagrid', $datagrid); + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/LocalesComposer.php b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/LocalesComposer.php new file mode 100644 index 000000000..8de71b5c9 --- /dev/null +++ b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/LocalesComposer.php @@ -0,0 +1,154 @@ + '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' => 'locale_id', + 'type' => 'number', + 'label' => 'ID', + 'sortable' => true, + ], + [ + 'name' => 'code', + 'alias' => 'locale_code', + 'type' => 'string', + 'label' => 'Code', + 'sortable' => true, + ], + [ + 'name' => 'name', + 'alias' => 'locale_name', + 'type' => 'string', + 'label' => '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' => [] + + ]); + + $view->with('datagrid', $datagrid); + // $view->with('count', $this->users->count()); + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/RolesComposer.php b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/RolesComposer.php new file mode 100644 index 000000000..82b31fcc9 --- /dev/null +++ b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/RolesComposer.php @@ -0,0 +1,154 @@ + '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' => 'r_id', + 'type' => 'number', + 'label' => 'ID', + 'sortable' => true, + ], + [ + 'name' => 'name', + 'alias' => 'r_name', + 'type' => 'string', + 'label' => 'Name', + 'sortable' => true, + ], + [ + 'name' => 'permission_type', + 'alias' => 'r_permission_type', + 'type' => 'string', + 'label' => 'Permission Type', + 'sortable' => true, + ], + + ], + + //don't use aliasing in case of filters + + 'filterable' => [ + [ + 'column' => 'id', + 'alias' => 'r_id', + 'type' => 'number', + 'label' => 'ID', + ], + [ + 'column' => 'name', + 'alias' => 'r_name', + 'type' => 'string', + 'label' => 'Name', + ], + [ + 'column' => 'permission_type', + 'alias' => 'r_permission_type', + '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' => [] + + ]); + + $view->with('datagrid', $datagrid); + // $view->with('count', $this->users->count()); + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/SliderComposer.php b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/SliderComposer.php new file mode 100644 index 000000000..480437e8d --- /dev/null +++ b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/SliderComposer.php @@ -0,0 +1,159 @@ + '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' => 'slider_id', + 'type' => 'number', + 'label' => 'ID', + 'sortable' => true, + ], + [ + 'name' => 's.title', + 'alias' => 'slider_title', + 'type' => 'string', + 'label' => 'title', + ], + [ + 'name' => 's.channel_id', + 'alias' => 'channel_id', + 'type' => 'string', + 'label' => 'Channel ID', + 'sortable' => true, + ], + [ + 'name' => 'c.name', + 'alias' => 'channel_name', + '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' => [] + + ]); + + $view->with('datagrid', $datagrid); + // $view->with('count', $this->users->count()); + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/UserComposer.php b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/UserComposer.php index 028d9bd6f..e64f8f4d5 100644 --- a/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/UserComposer.php +++ b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/UserComposer.php @@ -26,37 +26,14 @@ class UserComposer */ public function compose(View $view) { + $datagrid = DataGrid::make([ 'name' => 'Admins', 'table' => 'admins as u', 'select' => 'u.id', - 'aliased' => true, //boolean to validate aliasing on the basis of this. - 'filterable' => [ - [ - 'column' => 'u.email', - 'type' => 'string', - 'label' => 'Admin E-Mail' - ], [ - 'column' => 'u.name', - 'type' => 'string', - 'label' => 'Admin Name' - ], [ - 'column' => 'u.id', - 'type' => 'number', - 'label' => 'Admin ID' - ] - ], - 'searchable' => [ - [ - 'column' => 'u.email', - 'type' => 'string', - 'label' => 'Admin E-Mail' - ], [ - 'column' => 'u.name', - 'type' => 'string', - 'label' => 'Admin Name' - ] - ], + 'perpage' => 5, + 'aliased' => true, //use this with false as default and true in case of joins + 'massoperations' =>[ [ 'route' => route('admin.datagrid.delete'), @@ -76,40 +53,72 @@ class UserComposer // ] // ], ], - 'join' => [ - // [ - // 'join' => 'leftjoin', - // 'table' => 'roles as r', - // 'primaryKey' => 'u.role_id', - // 'condition' => '=', - // 'secondaryKey' => 'r.id', - // ] + '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 '' . $object->ID . ''; + }, ], [ 'name' => 'u.name', + 'alias' => 'Name', 'type' => 'string', - 'label' => 'Admin Name', + 'label' => 'Name', 'sortable' => true, + 'wrapper' => function ($value, $object) { + return '' . $object->Name . ''; + }, ], [ 'name' => 'u.email', + 'alias' => 'Email', 'type' => 'string', - 'label' => 'Admin E-Mail', + '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' => 'r.name as rolename', - // 'type' => 'string', - // 'label' => 'Role Name', - // 'sortable' => true, - // ], // [ // 'name' => 'a.first_name', // 'type' => 'string', @@ -132,6 +141,37 @@ class UserComposer // ], ], + //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' => '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' => "<", @@ -150,4 +190,4 @@ class UserComposer $view->with('datagrid', $datagrid); // $view->with('count', $this->users->count()); } -} +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/routes.php b/packages/Webkul/Admin/src/Http/routes.php index e0518507c..879f9e4a9 100644 --- a/packages/Webkul/Admin/src/Http/routes.php +++ b/packages/Webkul/Admin/src/Http/routes.php @@ -212,7 +212,7 @@ Route::group(['middleware' => ['web']], function () { ])->name('admin.countries.store'); - // Country Routes + // Currency Routes Route::get('/currencies', 'Webkul\Core\Http\Controllers\CurrencyController@index')->defaults('_config', [ 'view' => 'admin::settings.currencies.index' ])->name('admin.currencies.index'); @@ -226,7 +226,7 @@ Route::group(['middleware' => ['web']], function () { ])->name('admin.currencies.store'); - // Country Routes + // 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'); @@ -299,6 +299,20 @@ Route::group(['middleware' => ['web']], function () { ])->name('admin.account.edit'); Route::put('/account', 'Webkul\User\Http\Controllers\AccountController@update')->name('admin.account.update'); + + // Admin Store Front Settings Route + Route::get('/slider','Webkul\Shop\Http\Controllers\SliderController@index')->defaults('_config',[ + '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'); }); }); }); diff --git a/packages/Webkul/Admin/src/Providers/ComposerServiceProvider.php b/packages/Webkul/Admin/src/Providers/ComposerServiceProvider.php index 7037ffa84..ce77d7de8 100644 --- a/packages/Webkul/Admin/src/Providers/ComposerServiceProvider.php +++ b/packages/Webkul/Admin/src/Providers/ComposerServiceProvider.php @@ -16,14 +16,34 @@ class ComposerServiceProvider extends ServiceProvider */ public function boot() { - // Using class based composers... + + //for the users in the countries dashboard + View::composer('admin::settings.countries.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\CountryComposer'); + + //for the users in the admin dashboard View::composer('admin::users.users.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\UserComposer'); - // Using Closure based composers... + //for the users in the admin dashboard + View::composer('admin::users.roles.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\RolesComposer'); + + //for the locales in admin dashboard + View::composer('admin::settings.locales.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\LocalesComposer'); + + //for the currencies in admin dashboard + View::composer('admin::settings.currencies.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\CurrenciesComposer'); + + //for the Exchange Rates in admin dashboard + View::composer('admin::settings.exchange_rates.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\ExchangeRatesComposer'); + + //for inventory sources in admin dashboard + View::composer('admin::settings.inventory_sources.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\InventorySourcesComposer'); + + //for channels in admin dashboard + View::composer('admin::settings.channels.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\ChannelsComposer'); + + //for sliders in admin dashboard + View::composer('admin::settings.sliders.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\SliderComposer'); - // View::composer('admin::users.index', function ($view) { - // // - // }); } /** diff --git a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php index af035c347..4446d60cf 100644 --- a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php +++ b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php @@ -33,13 +33,13 @@ class EventServiceProvider extends ServiceProvider */ public function createAdminMenu() { - Event::listen('admin.menu.create', function() { - return Menu::create(function($menu) { + Event::listen('admin.menu.create', function () { + return Menu::create(function ($menu) { Event::fire('admin.menu.build', $menu); }); }); - Event::listen('admin.menu.build', function($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'); @@ -75,6 +75,8 @@ class EventServiceProvider extends ServiceProvider $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, ''); }); } @@ -85,7 +87,7 @@ class EventServiceProvider extends ServiceProvider */ public function buildACL() { - Event::listen('admin.acl.build', function($acl) { + Event::listen('admin.acl.build', function ($acl) { $acl->add('dashboard', 'Dashboard', 'admin.dashboard.index', 1); $acl->add('configuration', 'Configure', 'admin.account.edit', 5); @@ -107,7 +109,7 @@ class EventServiceProvider extends ServiceProvider */ public function registerACL() { - $this->app->singleton('acl', function() { + $this->app->singleton('acl', function () { return current(Event::fire('admin.acl.create')); }); @@ -121,22 +123,14 @@ class EventServiceProvider extends ServiceProvider */ 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('images', 'Inventories', 'admin::catalog.products.accordians.inventories', 1); + $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); - - // $accordian->add('product-links', 'Linked Products', 'admin::catalog.products.accordians.product-links', 4); }); } } diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 8aa28cefd..75bc3141f 100644 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -28,6 +28,7 @@ return [ 'submit-btn-title' => 'Reset Password' ], 'roles' => [ + 'title' => 'Roles', 'add-role-title' => 'Add Role', 'edit-role-title' => 'Edit Role', 'save-btn-title' => 'Save Role', @@ -175,6 +176,7 @@ return [ ], 'settings' => [ 'locales' => [ + 'title' => 'Locales', 'add-locale-title' => 'Add Locale', 'edit-locale-title' => 'Edit Locale', 'add-title' => 'Add Locale', @@ -184,6 +186,7 @@ return [ 'name' => 'Name' ], 'countries' => [ + 'title' => 'Countries', 'add-title' => 'Add Counrty', 'save-btn-title' => 'Save Counrty', 'general' => 'General', @@ -191,6 +194,7 @@ return [ 'name' => 'Name' ], 'currencies' => [ + 'title' => 'Currencies', 'add-title' => 'Add Currency', 'edit-title' => 'Edit Currency', 'save-btn-title' => 'Save Currency', @@ -249,6 +253,16 @@ return [ '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' + ], ] ]; \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/channels/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/channels/index.blade.php index e07483858..9f9e6af3f 100644 --- a/packages/Webkul/Admin/src/Resources/views/settings/channels/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/settings/channels/index.blade.php @@ -4,7 +4,7 @@
@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/countries/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/countries/index.blade.php index db2b18659..69216c383 100644 --- a/packages/Webkul/Admin/src/Resources/views/settings/countries/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/settings/countries/index.blade.php @@ -4,7 +4,7 @@
@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/currencies/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/currencies/index.blade.php index 78af5b483..dd000e54d 100644 --- a/packages/Webkul/Admin/src/Resources/views/settings/currencies/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/settings/currencies/index.blade.php @@ -4,7 +4,7 @@
@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/exchange_rates/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/exchange_rates/index.blade.php index 42f738f56..7f9488f70 100644 --- a/packages/Webkul/Admin/src/Resources/views/settings/exchange_rates/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/settings/exchange_rates/index.blade.php @@ -8,7 +8,7 @@
@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/index.blade.php index 861ff89ee..8aec9b881 100644 --- a/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/index.blade.php @@ -8,7 +8,7 @@
@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/locales/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/locales/index.blade.php index 80addfaa3..18a88a1b3 100644 --- a/packages/Webkul/Admin/src/Resources/views/settings/locales/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/settings/locales/index.blade.php @@ -4,7 +4,7 @@
@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/sliders/create.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/sliders/create.blade.php new file mode 100644 index 000000000..dfbcafa39 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/sliders/create.blade.php @@ -0,0 +1,71 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.settings.sliders.add-title') }} +@stop + +@section('content') +
+
+ + +
+
+ @csrf() + +
+ +
+ + + @{{ errors.first('title') }} +
+ +
+ + + @{{ errors.first('channel_id') }} +
+ +
+ + + + + + + @{{ errors.first('image') }} + {{-- The image field validation is not working, resolve it. --}} + + +
+ +
+ + + + + @{{ errors.first('content') }} +
+ +
+
+
+
+
+
+@endsection \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/sliders/index.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/sliders/index.blade.php new file mode 100644 index 000000000..5b2ce8c55 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/settings/sliders/index.blade.php @@ -0,0 +1,21 @@ +@extends('admin::layouts.content') + +@section('content') +
+ + +
+ {!! $datagrid->render() !!} +
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/users/roles/index.blade.php b/packages/Webkul/Admin/src/Resources/views/users/roles/index.blade.php index 1ad1d9cda..1088d3f8b 100644 --- a/packages/Webkul/Admin/src/Resources/views/users/roles/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/users/roles/index.blade.php @@ -4,7 +4,7 @@
@stop diff --git a/packages/Webkul/Admin/src/Resources/views/users/users/index.blade.php b/packages/Webkul/Admin/src/Resources/views/users/users/index.blade.php index e37a68fb4..122c72bf1 100644 --- a/packages/Webkul/Admin/src/Resources/views/users/users/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/users/users/index.blade.php @@ -9,7 +9,7 @@