Skip to content

Commit

Permalink
refactor-type-routes
Browse files Browse the repository at this point in the history
  • Loading branch information
shivendra-webkul committed Jul 22, 2024
1 parent e9a8048 commit 559347e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 12 deletions.
12 changes: 0 additions & 12 deletions packages/Webkul/Admin/src/Http/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,18 +352,6 @@
Route::delete('{id}', 'SourceController@destroy')->name('admin.settings.sources.delete');
});

// Lead Types Routes
Route::prefix('types')->group(function () {
Route::get('', 'TypeController@index')->name('admin.settings.types.index');

Route::post('create', 'TypeController@store')->name('admin.settings.types.store');

Route::get('edit/{id?}', 'TypeController@edit')->name('admin.settings.types.edit');

Route::put('edit/{id}', 'TypeController@update')->name('admin.settings.types.update');

Route::delete('{id}', 'TypeController@destroy')->name('admin.settings.types.delete');
});

// Email Templates Routes
Route::prefix('email-templates')->group(function () {
Expand Down
3 changes: 3 additions & 0 deletions packages/Webkul/Admin/src/Providers/AdminServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Webkul\Admin\Http\Middleware\Locale;
use Illuminate\Support\Facades\Route;

class AdminServiceProvider extends ServiceProvider
{
Expand All @@ -18,6 +19,8 @@ public function boot(Router $router): void
{
include __DIR__.'/../Http/helpers.php';

Route::middleware('web')->group(__DIR__.'/../Routes/web.php');

$this->loadRoutesFrom(__DIR__.'/../Http/routes.php');

$this->loadMigrationsFrom(__DIR__.'/../Database/Migrations');
Expand Down
26 changes: 26 additions & 0 deletions packages/Webkul/Admin/src/Routes/settings-routes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

use Illuminate\Support\Facades\Route;
use Webkul\Admin\Http\Controllers\Setting\TypeController;

/**
* Settings routes.
*/
Route::group(['middleware' => ['admin_locale'], 'prefix' => config('app.admin_path')], function () {
Route::prefix('settings')->group(function () {
/**
* Type routes.
*/
Route::controller(TypeController::class)->prefix('types')->group(function () {
Route::get('', 'index')->name('admin.settings.types.index');

Route::post('create', 'store')->name('admin.settings.types.store');

Route::get('edit/{id?}', 'edit')->name('admin.settings.types.edit');

Route::put('edit/{id}', 'update')->name('admin.settings.types.update');

Route::delete('{id}', 'destroy')->name('admin.settings.types.delete');
});
});
});
7 changes: 7 additions & 0 deletions packages/Webkul/Admin/src/Routes/web.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

/**
* Settings routes.
*/
require 'settings-routes.php';

0 comments on commit 559347e

Please sign in to comment.