diff --git a/config/acl.php b/config/acl.php new file mode 100644 index 000000000..3a82deda4 --- /dev/null +++ b/config/acl.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/config/menu.php b/config/menu.php new file mode 100644 index 000000000..d511416be --- /dev/null +++ b/config/menu.php @@ -0,0 +1,13 @@ + [ + + ], + + 'customer' => [ + + ] +]; + +?> \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Config/acl.php b/packages/Webkul/Admin/src/Config/acl.php new file mode 100644 index 000000000..084205d45 --- /dev/null +++ b/packages/Webkul/Admin/src/Config/acl.php @@ -0,0 +1,152 @@ + 'dashboard', + 'name' => 'Dashboard', + 'route' => 'admin.dashboard.index', + 'sort' => 1 + ], [ + 'key' => 'sales', + 'name' => 'Sales', + 'route' => 'admin.sales.orders.index', + 'sort' => 2 + ], [ + 'key' => 'sales.orders', + 'name' => 'Orders', + 'route' => 'admin.sales.orders.index', + 'sort' => 1 + ], [ + 'key' => 'sales.invoices', + 'name' => 'Invoices', + 'route' => 'admin.sales.invoices.index', + 'sort' => 2 + ], [ + 'key' => 'sales.shipments', + 'name' => 'Shipments', + 'route' => 'admin.sales.shipments.index', + 'sort' => 3 + ], [ + 'key' => 'catalog', + 'name' => 'Catalog', + 'route' => 'admin.catalog.index', + 'sort' => 3 + ], [ + 'key' => 'catalog.products', + 'name' => 'Products', + 'route' => 'admin.catalog.products.index', + 'sort' => 1 + ], [ + 'key' => 'catalog.categories', + 'name' => 'Categories', + 'route' => 'admin.catalog.categories.index', + 'sort' => 2 + ], [ + 'key' => 'catalog.attributes', + 'name' => 'Attributes', + 'route' => 'admin.catalog.attributes.index', + 'sort' => 3 + ], [ + 'key' => 'catalog.families', + 'name' => 'Families', + 'route' => 'admin.catalog.families.index', + 'sort' => 4 + ], [ + 'key' => 'customers', + 'name' => 'Customers', + 'route' => 'admin.customers.index', + 'sort' => 4 + ], [ + 'key' => 'customers.customers', + 'name' => 'Customers', + 'route' => 'admin.customers.index', + 'sort' => 1 + ], [ + 'key' => 'customers.groups', + 'name' => 'Groups', + 'route' => 'admin.groups.index', + 'sort' => 2 + ], [ + 'key' => 'customers.reviews', + 'name' => 'Reviews', + 'route' => 'admin.customers.reviews.index', + 'sort' => 3 + ], [ + 'key' => 'configuration', + 'name' => 'Configure', + 'route' => 'admin.account.edit', + 'sort' => 1 + ], [ + 'key' => 'configuration', + 'name' => 'Configure', + 'route' => 'admin.account.edit', + 'sort' => 1 + ], [ + 'key' => 'settings', + 'name' => 'Settings', + 'route' => 'admin.users.index', + 'sort' => 6 + ], [ + 'key' => 'settings.locales', + 'name' => 'Locales', + 'route' => 'admin.locales.index', + 'sort' => 1 + ], [ + 'key' => 'settings.currencies', + 'name' => 'Currencies', + 'route' => 'admin.currencies.index', + 'sort' => 2 + ], [ + 'key' => 'settings.exchange_rates', + 'name' => 'Exchange Rates', + 'route' => 'admin.exchange_rates.index', + 'sort' => 3 + ], [ + 'key' => 'settings.inventory_sources', + 'name' => 'Inventory Sources', + 'route' => 'admin.inventory_sources.index', + 'sort' => 4 + ], [ + 'key' => 'settings.channels', + 'name' => 'Channels', + 'route' => 'admin.channels.index', + 'sort' => 5 + ], [ + 'key' => 'settings.users', + 'name' => 'Users', + 'route' => 'admin.users.index', + 'sort' => 6 + ], [ + 'key' => 'settings.users.users', + 'name' => 'Users', + 'route' => 'admin.users.index', + 'sort' => 1 + ], [ + 'key' => 'settings.users.roles', + 'name' => 'Roles', + 'route' => 'admin.roles.index', + 'sort' => 1 + ], [ + 'key' => 'settings.sliders', + 'name' => 'Sliders', + 'route' => 'admin.sliders.index', + 'sort' => 7 + ], [ + 'key' => 'settings.taxes', + 'name' => 'Taxes', + 'route' => 'admin.tax-categories.index', + 'sort' => 8 + ], [ + 'key' => 'settings.taxes.tax-categories', + 'name' => 'Tax Categories', + 'route' => 'admin.tax-categories.index', + 'sort' => 1 + ], [ + 'key' => 'settings.taxes.tax-rates', + 'name' => 'Tax Rates', + 'route' => 'admin.tax-rates.index', + 'sort' => 2 + ] +]; + +?> \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Config/auth.php b/packages/Webkul/Admin/src/Config/auth.php deleted file mode 100644 index 021b99787..000000000 --- a/packages/Webkul/Admin/src/Config/auth.php +++ /dev/null @@ -1,61 +0,0 @@ - [ - 'web' => [ - 'driver' => 'session', - 'provider' => 'users', - ], - - 'api' => [ - 'driver' => 'token', - 'provider' => 'users', - ], - - 'customer' =>[ - 'driver' => 'session', - 'provider' => 'customers' - ], - - 'admin' => [ - 'driver' => 'session', - 'provider' => 'admins' - ], - - 'admin-api' => [ - 'driver' => 'token', - 'provider' => 'admins', - ] - ], - - 'providers' => [ - 'users' => [ - 'driver' => 'eloquent', - 'model' => Webkul\User\Models\User::class, - ], - - 'customers' => [ - 'driver' => 'eloquent', - 'model' => Webkul\Customer\Models\Customer::class, - ], - - 'admins' => [ - 'driver' => 'eloquent', - 'model' => Webkul\User\Models\Admin::class, - ] - ], - - 'passwords' => [ - 'admins' => [ - 'provider' => 'admins', - 'table' => 'admin_password_resets', - 'expire' => 60, - ], - 'customers' => [ - 'provider' => 'customers', - 'table' => 'customer_password_resets', - 'expire' => 60, - ], - ], -]; diff --git a/packages/Webkul/Admin/src/Config/menu.php b/packages/Webkul/Admin/src/Config/menu.php new file mode 100644 index 000000000..d5451bc17 --- /dev/null +++ b/packages/Webkul/Admin/src/Config/menu.php @@ -0,0 +1,180 @@ + 'dashboard', + 'name' => 'Dashboard', + 'route' => 'admin.dashboard.index', + 'sort' => 1, + 'icon-class' => 'dashboard-icon', + ], [ + 'key' => 'sales', + 'name' => 'Sales', + 'route' => 'admin.sales.orders.index', + 'sort' => 2, + 'icon-class' => 'sales-icon', + ], [ + 'key' => 'sales.orders', + 'name' => 'Orders', + 'route' => 'admin.sales.orders.index', + 'sort' => 1, + 'icon-class' => '', + ], [ + 'key' => 'sales.shipments', + 'name' => 'Shipments', + 'route' => 'admin.sales.shipments.index', + 'sort' => 2, + 'icon-class' => '', + ], [ + 'key' => 'sales.invoices', + 'name' => 'Invoices', + 'route' => 'admin.sales.invoices.index', + 'sort' => 3, + 'icon-class' => '', + ], + [ + 'key' => 'catalog', + 'name' => 'Catalog', + 'route' => 'admin.catalog.products.index', + 'sort' => 3, + 'icon-class' => 'catalog-icon', + ], [ + 'key' => 'catalog.products', + 'name' => 'Products', + 'route' => 'admin.catalog.products.index', + 'sort' => 1, + 'icon-class' => '', + ], [ + 'key' => 'catalog.categories', + 'name' => 'Categories', + 'route' => 'admin.catalog.categories.index', + 'sort' => 2, + 'icon-class' => '', + ], [ + 'key' => 'catalog.attributes', + 'name' => 'Attributes', + 'route' => 'admin.catalog.attributes.index', + 'sort' => 3, + 'icon-class' => '', + ], [ + 'key' => 'catalog.families', + 'name' => 'Families', + 'route' => 'admin.catalog.families.index', + 'sort' => 4, + 'icon-class' => '', + ], [ + 'key' => 'customers', + 'name' => 'Customers', + 'route' => 'admin.customer.index', + 'sort' => 4, + 'icon-class' => 'customer-icon', + ], [ + 'key' => 'customers.customers', + 'name' => 'Customers', + 'route' => 'admin.customer.index', + 'sort' => 1, + 'icon-class' => '', + ], [ + 'key' => 'customers.groups', + 'name' => 'Groups', + 'route' => 'admin.groups.index', + 'sort' => 2, + 'icon-class' => '', + ], [ + 'key' => 'customers.reviews', + 'name' => 'Reviews', + 'route' => 'admin.customer.review.index', + 'sort' => 3, + 'icon-class' => '', + ], [ + 'key' => 'customers.subscribers', + 'name' => 'Newsletter Subscription', + 'route' => 'admin.customers.subscribers.index', + 'sort' => 4, + 'icon-class' => '', + ], [ + 'key' => 'configuration', + 'name' => 'Configure', + 'route' => 'admin.configuration.index', + 'sort' => 5, + 'icon-class' => 'configuration-icon', + ], [ + 'key' => 'settings', + 'name' => 'Settings', + 'route' => 'admin.locales.index', + 'sort' => 6, + 'icon-class' => 'settings-icon', + ], [ + 'key' => 'settings.locales', + 'name' => 'Locales', + 'route' => 'admin.locales.index', + 'sort' => 1, + 'icon-class' => '', + ], [ + 'key' => 'settings.currencies', + 'name' => 'Currencies', + 'route' => 'admin.currencies.index', + 'sort' => 2, + 'icon-class' => '', + ], [ + 'key' => 'settings.exchange_rates', + 'name' => 'Exchange Rates', + 'route' => 'admin.exchange_rates.index', + 'sort' => 3, + 'icon-class' => '', + ], [ + 'key' => 'settings.inventory_sources', + 'name' => 'Inventory Sources', + 'route' => 'admin.inventory_sources.index', + 'sort' => 4, + 'icon-class' => '', + ], [ + 'key' => 'settings.channels', + 'name' => 'Channels', + 'route' => 'admin.channels.index', + 'sort' => 5, + 'icon-class' => '', + ], [ + 'key' => 'settings.users', + 'name' => 'Users', + 'route' => 'admin.users.index', + 'sort' => 6, + 'icon-class' => '', + ], [ + 'key' => 'settings.users.users', + 'name' => 'Users', + 'route' => 'admin.users.index', + 'sort' => 1, + 'icon-class' => '', + ], [ + 'key' => 'settings.users.roles', + 'name' => 'Roles', + 'route' => 'admin.roles.index', + 'sort' => 2, + 'icon-class' => '', + ], [ + 'key' => 'settings.sliders', + 'name' => 'Sliders', + 'route' => 'admin.sliders.index', + 'sort' => 7, + 'icon-class' => '', + ], [ + 'key' => 'settings.taxes', + 'name' => 'Taxes', + 'route' => 'admin.tax-categories.index', + 'sort' => 8, + 'icon-class' => '', + ], [ + 'key' => 'settings.taxes.tax-categories', + 'name' => 'Tax Categories', + 'route' => 'admin.tax-categories.index', + 'sort' => 1, + 'icon-class' => '', + ], [ + 'key' => 'settings.taxes.tax-rates', + 'name' => 'Tax Rates', + 'route' => 'admin.tax-rates.index', + 'sort' => 2, + 'icon-class' => '', + ] +]; diff --git a/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php b/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php index 90d648033..28d291850 100644 --- a/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php @@ -51,6 +51,9 @@ class ConfigurationController extends Controller */ public function index() { + // if(!request()->route('slug')) + // return redirect()->route('admin.configuration.index', ['slug' => 'marketplace']); + return view($this->_config['view']); } diff --git a/packages/Webkul/Admin/src/Http/routes.php b/packages/Webkul/Admin/src/Http/routes.php index c117b8f0a..e4c4bbb72 100644 --- a/packages/Webkul/Admin/src/Http/routes.php +++ b/packages/Webkul/Admin/src/Http/routes.php @@ -69,6 +69,10 @@ Route::group(['middleware' => ['web']], function () { ])->name('admin.customer.review.index'); + Route::get('configuration/{slug?}/{slug2?}', 'Webkul\Admin\Http\Controllers\ConfigurationController@index')->defaults('_config', [ + 'view' => 'admin::configuration.index' + ])->name('admin.configuration.index'); + //Shipping Methods Routes Route::get('configuration/sales/shipping-methods', 'Webkul\Admin\Http\Controllers\ConfigurationController@index')->defaults('_config', [ 'view' => 'admin::configuration.sales.shipping-method' diff --git a/packages/Webkul/Admin/src/ProductFormAccordian.php b/packages/Webkul/Admin/src/ProductFormAccordian.php index 16169dea8..c116db403 100644 --- a/packages/Webkul/Admin/src/ProductFormAccordian.php +++ b/packages/Webkul/Admin/src/ProductFormAccordian.php @@ -16,7 +16,7 @@ class ProductFormAccordian { public static function create($callback) { $accordian = new ProductFormAccordian(); $callback($accordian); - $accordian->items = $accordian->sortItems($accordian->items); + $accordian->items = core()->sortItems($accordian->items); return $accordian; } @@ -38,21 +38,4 @@ class ProductFormAccordian { '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; - } } \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php b/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php index d4b954059..1388d4fac 100644 --- a/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php +++ b/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php @@ -40,6 +40,16 @@ class AdminServiceProvider extends ServiceProvider Handler::class ); } + + /** + * Register services. + * + * @return void + */ + public function register() + { + $this->registerConfig(); + } /** * Bind the the data to the views @@ -57,39 +67,33 @@ class AdminServiceProvider extends ServiceProvider view()->composer(['admin::layouts.nav-left', 'admin::layouts.nav-aside', 'admin::layouts.tabs'], function ($view) { $menu = current(Event::fire('admin.menu.create')); - $keys = explode('.', $menu->currentKey); - $subMenus = $tabs = []; - if (count($keys) > 1) { - $subMenus = [ - 'items' => $menu->sortItems(array_get($menu->items, current($keys) . '.children')), - 'current' => $menu->current, - 'currentKey' => $menu->currentKey - ]; + $menu->items = core()->sortItems($menu->items); - 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); + view()->composer(['admin::layouts.nav-aside', 'admin::layouts.tabs', 'admin::configuration.index'], function ($view) { + $tree = current(Event::fire('admin.config.create')); + + $tree->items = core()->sortItems($tree->items); + + $view->with('config', $tree); }); } - + /** - * Merge the given configuration with the existing configuration. + * Register package config. * - * @param string $path - * @param string $key * @return void */ - protected function mergeConfigFrom($path, $key) + protected function registerConfig() { - $config = $this->app['config']->get($key, []); + $this->mergeConfigFrom( + dirname(__DIR__) . '/Config/menu.php', 'menu.admin' + ); - $this->app['config']->set($key, array_merge($config, require $path)); + $this->mergeConfigFrom( + dirname(__DIR__) . '/Config/acl.php', 'acl' + ); } -} +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php index 1636dad97..83cd881d0 100644 --- a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php +++ b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php @@ -6,209 +6,11 @@ use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\View; use Webkul\Ui\Menu; +use Webkul\Core\Tree; use Webkul\Admin\ProductFormAccordian; class EventServiceProvider extends ServiceProvider { - protected $menuItems = [ - [ - 'key' => 'dashboard', - 'name' => 'Dashboard', - 'route' => 'admin.dashboard.index', - 'sort' => 1, - 'icon-class' => 'dashboard-icon', - ], [ - 'key' => 'sales', - 'name' => 'Sales', - 'route' => 'admin.sales.orders.index', - 'sort' => 2, - 'icon-class' => 'sales-icon', - ], [ - 'key' => 'sales.orders', - 'name' => 'Orders', - 'route' => 'admin.sales.orders.index', - 'sort' => 1, - 'icon-class' => '', - ], [ - 'key' => 'sales.shipments', - 'name' => 'Shipments', - 'route' => 'admin.sales.shipments.index', - 'sort' => 2, - 'icon-class' => '', - ], [ - 'key' => 'sales.invoices', - 'name' => 'Invoices', - 'route' => 'admin.sales.invoices.index', - 'sort' => 3, - 'icon-class' => '', - ], - [ - 'key' => 'catalog', - 'name' => 'Catalog', - 'route' => 'admin.catalog.products.index', - 'sort' => 3, - 'icon-class' => 'catalog-icon', - ], [ - 'key' => 'catalog.products', - 'name' => 'Products', - 'route' => 'admin.catalog.products.index', - 'sort' => 1, - 'icon-class' => '', - ], [ - 'key' => 'catalog.categories', - 'name' => 'Categories', - 'route' => 'admin.catalog.categories.index', - 'sort' => 2, - 'icon-class' => '', - ], [ - 'key' => 'catalog.attributes', - 'name' => 'Attributes', - 'route' => 'admin.catalog.attributes.index', - 'sort' => 3, - 'icon-class' => '', - ], [ - 'key' => 'catalog.families', - 'name' => 'Families', - 'route' => 'admin.catalog.families.index', - 'sort' => 4, - 'icon-class' => '', - ], [ - 'key' => 'customers', - 'name' => 'Customers', - 'route' => 'admin.customer.index', - 'sort' => 4, - 'icon-class' => 'customer-icon', - ], [ - 'key' => 'customers.customers', - 'name' => 'Customers', - 'route' => 'admin.customer.index', - 'sort' => 1, - 'icon-class' => '', - ], [ - 'key' => 'customers.groups', - 'name' => 'Groups', - 'route' => 'admin.groups.index', - 'sort' => 2, - 'icon-class' => '', - ], [ - 'key' => 'customers.reviews', - 'name' => 'Reviews', - 'route' => 'admin.customer.review.index', - 'sort' => 3, - 'icon-class' => '', - ], [ - 'key' => 'customers.subscribers', - 'name' => 'Newsletter Subscription', - 'route' => 'admin.customers.subscribers.index', - 'sort' => 4, - 'icon-class' => '', - ], [ - 'key' => 'configuration', - 'name' => 'Configure', - 'route' => 'admin.account.edit', - 'sort' => 5, - 'icon-class' => 'configuration-icon', - ], [ - 'key' => 'configuration.account', - 'name' => 'My Account', - 'route' => 'admin.account.edit', - 'sort' => 1, - 'icon-class' => '', - ], - [ - 'key' => 'configuration.sales', - 'name' => 'Sales', - 'route' => 'admin.configuration.sales.shipping_methods', - 'sort' => 1, - 'icon-class' => '', - ], [ - 'key' => 'configuration.sales.shipping_method', - 'name' => 'Shipping Methods', - 'route' => 'admin.configuration.sales.shipping_methods', - 'sort' => 1, - 'icon-class' => '', - ], - [ - 'key' => 'settings', - 'name' => 'Settings', - 'route' => 'admin.locales.index', - 'sort' => 6, - 'icon-class' => 'settings-icon', - ], [ - 'key' => 'settings.locales', - 'name' => 'Locales', - 'route' => 'admin.locales.index', - 'sort' => 1, - 'icon-class' => '', - ], [ - 'key' => 'settings.currencies', - 'name' => 'Currencies', - 'route' => 'admin.currencies.index', - 'sort' => 2, - 'icon-class' => '', - ], [ - 'key' => 'settings.exchange_rates', - 'name' => 'Exchange Rates', - 'route' => 'admin.exchange_rates.index', - 'sort' => 3, - 'icon-class' => '', - ], [ - 'key' => 'settings.inventory_sources', - 'name' => 'Inventory Sources', - 'route' => 'admin.inventory_sources.index', - 'sort' => 4, - 'icon-class' => '', - ], [ - 'key' => 'settings.channels', - 'name' => 'Channels', - 'route' => 'admin.channels.index', - 'sort' => 5, - 'icon-class' => '', - ], [ - 'key' => 'settings.users', - 'name' => 'Users', - 'route' => 'admin.users.index', - 'sort' => 6, - 'icon-class' => '', - ], [ - 'key' => 'settings.users.users', - 'name' => 'Users', - 'route' => 'admin.users.index', - 'sort' => 1, - 'icon-class' => '', - ], [ - 'key' => 'settings.users.roles', - 'name' => 'Roles', - 'route' => 'admin.roles.index', - 'sort' => 2, - 'icon-class' => '', - ], [ - 'key' => 'settings.sliders', - 'name' => 'Sliders', - 'route' => 'admin.sliders.index', - 'sort' => 7, - 'icon-class' => '', - ], [ - 'key' => 'settings.taxes', - 'name' => 'Taxes', - 'route' => 'admin.tax-categories.index', - 'sort' => 8, - 'icon-class' => '', - ], [ - 'key' => 'settings.taxes.tax-categories', - 'name' => 'Tax Categories', - 'route' => 'admin.tax-categories.index', - 'sort' => 1, - 'icon-class' => '', - ], [ - 'key' => 'settings.taxes.tax-rates', - 'name' => 'Tax Rates', - 'route' => 'admin.tax-rates.index', - 'sort' => 2, - 'icon-class' => '', - ] - ]; - /** * Bootstrap services. * @@ -218,6 +20,8 @@ class EventServiceProvider extends ServiceProvider { $this->createAdminMenu(); + $this->createAdminConfig(); + $this->buildACL(); $this->registerACL(); @@ -241,20 +45,40 @@ class EventServiceProvider extends ServiceProvider public function createAdminMenu() { Event::listen('admin.menu.create', function () { - return Menu::create(function ($menu) { + return Tree::create(function ($menu) { Event::fire('admin.menu.build', $menu); }); }); Event::listen('admin.menu.build', function ($menu) { - foreach($this->menuItems as $item){ + foreach(config('menu.admin') as $item) { if (bouncer()->hasPermission($item['key'])) { - $menu->add($item['key'], $item['name'], $item['route'], $item['sort'], $item['icon-class']); + $menu->add($item, 'menu'); } } }); } + /** + * This method fires an event for config creation, any package can add their config item by listening to the admin.config.build event + * + * @return void + */ + public function createAdminConfig() + { + Event::listen('admin.config.create', function () { + return Tree::create(function ($tree) { + Event::fire('admin.config.build', $tree); + }); + }); + + Event::listen('admin.config.build', function ($config) { + foreach(config('core') as $item) { + $config->add($item); + } + }); + } + /** * Build route based ACL * @@ -263,61 +87,9 @@ class EventServiceProvider extends ServiceProvider public function buildACL() { Event::listen('admin.acl.build', function ($acl) { - $acl->add('dashboard', 'Dashboard', 'admin.dashboard.index', 1); - - $acl->add('sales', 'Sales', 'admin.sales.orders.index', 2); - - $acl->add('sales.orders', 'Orders', 'admin.sales.orders.index', 1); - - $acl->add('sales.invoices', 'Invoices', 'admin.sales.invoices.index', 1); - - $acl->add('sales.shipments', 'Shipments', 'admin.sales.shipments.index', 1); - - $acl->add('catalog', 'Catalog', 'admin.catalog.index', 3); - - $acl->add('catalog.products', 'Products', 'admin.catalog.products.index', 1); - - $acl->add('catalog.categories', 'Categories', 'admin.catalog.categories.index', 2); - - $acl->add('catalog.attributes', 'Attributes', 'admin.catalog.attributes.index', 3); - - $acl->add('catalog.families', 'Families', 'admin.catalog.families.index', 4); - - $acl->add('customers', 'Customers', 'admin.customers.index', 4); - - $acl->add('customers.customers', 'Customers', 'admin.customers.index', 1); - - $acl->add('customers.groups', 'Groups', 'admin.groups.index', 2); - - $acl->add('customers.reviews', 'Reviews', 'admin.customers.reviews.index', 3); - - $acl->add('configuration', 'Configure', 'admin.account.edit', 5); - - $acl->add('settings', 'Settings', 'admin.users.index', 6); - - $acl->add('settings.locales', 'Locales', 'admin.locales.index', 1); - - $acl->add('settings.currencies', 'Currencies', 'admin.currencies.index', 2); - - $acl->add('settings.exchange_rates', 'Exchange Rates', 'admin.exchange_rates.index', 3); - - $acl->add('settings.inventory_sources', 'Inventory Sources', 'admin.inventory_sources.index', 4); - - $acl->add('settings.channels', 'Channels', 'admin.channels.index', 5); - - $acl->add('settings.users', 'Users', 'admin.users.index', 6); - - $acl->add('settings.users.users', 'Users', 'admin.users.index', 1); - - $acl->add('settings.users.roles', 'Roles', 'admin.roles.index', 2); - - $acl->add('settings.sliders', 'Sliders', 'admin.sliders.index', 7); - - $acl->add('settings.taxes', 'Taxes', 'admin.tax-categories.index', 7); - - $acl->add('settings.taxes.tax-categories', 'Tax Categories', 'admin.tax-categories.index', 1); - - $acl->add('settings.taxes.tax-rates', 'Tax Rates', 'admin.tax-rates.index', 2); + foreach(config('acl') as $item) { + $acl->add($item); + } }); } diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 767c970de..5883f693b 100644 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -310,6 +310,9 @@ return [ ], 'configuration' => [ + 'title' => 'Configuration', + 'save-btn-title' => 'Save', + 'tax-categories' => [ 'title' => 'Tax Categories', 'add-title' => 'Add Tax Category', @@ -552,14 +555,17 @@ return [ 'status' => 'Status', 'comment' => 'Comment' ], + 'subscribers' => [ 'title' => 'News Letter Subscribers', 'title-edit' => 'Edit News Letter Subscriber', 'email' => 'Email', 'is_subscribed' => 'Subscribed', 'edit-btn-title' => 'Update Subscriber', - 'update-success' => 'You updated subscriber', - 'update-failed' => 'Error! You cannot unsubscribed the subscriber' + 'update-success' => 'Subscriber was successfully updated', + 'update-failed' => 'Error! You cannot unsubscribe the subscriber', + 'delete-success' => 'Subscriber was successfully deleted', + 'delete-failed' => 'Erorr! Subscriber cannot be deleted' ] ], diff --git a/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php index b206b60e7..6f0bff662 100644 --- a/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/account/edit.blade.php @@ -1,11 +1,11 @@ -@extends('admin::layouts.content') +@extends('admin::layouts.master') @section('page_title') {{ __('admin::app.account.title') }} @stop -@section('content') -