Merge pull request #5273 from devansh-webkul/velocity-routes-improvement

Velocity routes moved to the routes folder
This commit is contained in:
Devansh 2021-10-26 15:25:47 +05:30 committed by GitHub
commit 0b63f8150c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 18 deletions

View File

@ -1,11 +1,13 @@
<?php
use Webkul\Velocity\Velocity;
if (! function_exists('velocity')) {
function velocity()
{
return app()->make(Velocity::class);
}
if (! function_exists('velocity')) {
/**
* Velocity helper.
*
* @return \Webkul\Velocity\Velocity
*/
function velocity()
{
return app()->make(\Webkul\Velocity\Velocity::class);
}
?>
}

View File

@ -4,7 +4,6 @@ namespace Webkul\Velocity\Providers;
use Illuminate\Foundation\AliasLoader;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\ServiceProvider;
use Webkul\Velocity\Facades\Velocity as VelocityFacade;
@ -19,9 +18,9 @@ class VelocityServiceProvider extends ServiceProvider
{
include __DIR__ . '/../Http/helpers.php';
include __DIR__ . '/../Http/admin-routes.php';
include __DIR__ . '/../Routes/admin-routes.php';
include __DIR__ . '/../Http/front-routes.php';
include __DIR__ . '/../Routes/front-routes.php';
$this->app->register(EventServiceProvider::class);

View File

@ -1,28 +1,27 @@
<?php
// Controllers
use Illuminate\Support\Facades\Route;
use Webkul\Velocity\Http\Controllers\Admin\ConfigurationController;
use Webkul\Velocity\Http\Controllers\Admin\ContentController;
Route::group(['middleware' => ['web', 'admin_locale']], function () {
Route::prefix(config('app.admin_url') . '/velocity')->group(function () {
Route::group(['middleware' => ['admin']], function () {
// Content Pages Route
Route::get('/content', [ContentController::class, 'index'])->defaults('_config', [
'view' => 'velocity::admin.content.index'
])->name('velocity.admin.content.index');
Route::get('/content/search', [ContentController::class, 'search'])->name('velocity.admin.content.search');
Route::get('/content/create', [ContentController::class, 'create'])->defaults('_config',[
Route::get('/content/create', [ContentController::class, 'create'])->defaults('_config', [
'view' => 'velocity::admin.content.create'
])->name('velocity.admin.content.create');
Route::post('/content/create', [ContentController::class, 'store'])->defaults('_config',[
Route::post('/content/create', [ContentController::class, 'store'])->defaults('_config', [
'redirect' => 'velocity.admin.content.index'
])->name('velocity.admin.content.store');
Route::get('/content/edit/{id}', [ContentController::class, 'edit'])->defaults('_config',[
Route::get('/content/edit/{id}', [ContentController::class, 'edit'])->defaults('_config', [
'view' => 'velocity::admin.content.edit'
])->name('velocity.admin.content.edit');
@ -49,4 +48,4 @@ Route::group(['middleware' => ['web', 'admin_locale']], function () {
])->name('velocity.admin.store.meta-data');
});
});
});
});

View File

@ -1,6 +1,6 @@
<?php
// Controllers
use Illuminate\Support\Facades\Route;
use Webkul\Velocity\Http\Controllers\Shop\CartController;
use Webkul\Velocity\Http\Controllers\Shop\ComparisonController;
use Webkul\Velocity\Http\Controllers\Shop\ShopController;