add LegacyLayoutController.php. Need modern layout and routing for DRY
This commit is contained in:
parent
5ec98de0bb
commit
dbdab1a38c
20
app/Http/Controllers/LegacyLayoutController.php
Normal file
20
app/Http/Controllers/LegacyLayoutController.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
|
|
||||||
|
class LegacyLayoutController extends Controller
|
||||||
|
{
|
||||||
|
public function show(string $path = ''): View
|
||||||
|
{
|
||||||
|
$targetUrl = $path !== ''
|
||||||
|
? url($path)
|
||||||
|
: route('dashboard.index');
|
||||||
|
|
||||||
|
return view('layout.core', [
|
||||||
|
'site' => env('APP_STAGE', 'DEV'),
|
||||||
|
'initialUrl' => $targetUrl,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,18 +1,18 @@
|
|||||||
@php
|
@php
|
||||||
$modules = [
|
$modules = [
|
||||||
['name' => 'home', 'displayName' => 'Főoldal', 'icon' => 'home', 'link' => route('dashboard.index'), 'roles' => ['root','admin','developer','profit-center']],
|
['name' => 'home', 'displayName' => 'Főoldal', 'icon' => 'home', 'link' => route('dashboard.index'), 'roles' => ['root','admin','developer','profit-center']],
|
||||||
['name' => 'order', 'displayName' => 'Új megrendelés', 'icon' => 'bevetelezes', 'link' => route('order.index'), 'roles' => ['root','profit-center']],
|
['name' => 'order', 'displayName' => 'Új megrendelés', 'icon' => 'bevetelezes', 'link' => route('legacy.show', ['path' => 'order']), 'roles' => ['root','profit-center']],
|
||||||
['name' => 'activeOrder', 'displayName' => 'Megrendelések', 'icon' => 'tranzakciok', 'link' => route('orderArchive.index'), 'roles' => ['root','developer','admin','profit-center']],
|
['name' => 'activeOrder', 'displayName' => 'Megrendelések', 'icon' => 'tranzakciok', 'link' => route('legacy.show', ['path' => 'orderArchive']), 'roles' => ['root','developer','admin','profit-center']],
|
||||||
['name' => 'productGroup', 'displayName' => 'Termékcsoportok', 'icon' => 'category', 'link' => route('admin.productGroup.index'), 'roles' => ['root','developer','admin']],
|
['name' => 'productGroup', 'displayName' => 'Termékcsoportok', 'icon' => 'category', 'link' => route('legacy.show', ['path' => 'admin/productGroup']), 'roles' => ['root','developer','admin']],
|
||||||
['name' => 'product', 'displayName' => 'Termék', 'icon' => 'raktar', 'link' => route('admin.product.index'), 'roles' => ['root','developer','admin']],
|
['name' => 'product', 'displayName' => 'Termék', 'icon' => 'raktar', 'link' => route('legacy.show', ['path' => 'admin/product']), 'roles' => ['root','developer','admin']],
|
||||||
['name' => 'supplier', 'displayName' => 'Beszállító adatbázis', 'icon' => 'supplier', 'link' => route('admin.supplier.index'), 'roles' => ['root','developer','admin','profit-center']],
|
['name' => 'supplier', 'displayName' => 'Beszállító adatbázis', 'icon' => 'supplier', 'link' => route('legacy.show', ['path' => 'admin/supplier']), 'roles' => ['root','developer','admin','profit-center']],
|
||||||
['name' => 'priceList', 'displayName' => 'Webrendelős árlisták', 'icon' => 'price_list2', 'link' => route('admin.priceList.index'), 'roles' => ['root','developer','admin','profit-center']],
|
['name' => 'priceList', 'displayName' => 'Webrendelős árlisták', 'icon' => 'price_list2', 'link' => route('legacy.show', ['path' => 'admin/priceList']), 'roles' => ['root','developer','admin','profit-center']],
|
||||||
['name' => 'priceListProfitCenter', 'displayName' => 'PC Árlista', 'icon' => 'price_list_user', 'link' => route('admin.priceListProfitCenter.index'), 'roles' => ['root','developer','admin']],
|
['name' => 'priceListProfitCenter','displayName' => 'PC Árlista', 'icon' => 'price_list_user','link' => route('legacy.show', ['path' => 'admin/priceListProfitCenter']), 'roles' => ['root','developer','admin']],
|
||||||
['name' => 'profitCenter', 'displayName' => 'Profitcenter', 'icon' => 'profitCenter', 'link' => route('admin.profitCenter.index'), 'roles' => ['root','developer','admin']],
|
['name' => 'profitCenter', 'displayName' => 'Profitcenter', 'icon' => 'profitCenter', 'link' => route('legacy.show', ['path' => 'admin/profitCenter']), 'roles' => ['root','developer','admin']],
|
||||||
['name' => 'fileBatchUpload', 'displayName' => 'Tömeges Feltöltés', 'icon' => 'upload', 'link' => route('admin.fileBatchUpload.index'), 'roles' => ['root','developer','admin']],
|
['name' => 'fileBatchUpload', 'displayName' => 'Tömeges Feltöltés', 'icon' => 'upload', 'link' => route('legacy.show', ['path' => 'admin/fileBatchUpload']), 'roles' => ['root','developer','admin']],
|
||||||
['name' => 'statistics', 'displayName' => 'Statisztikák', 'icon' => 'kimutatasok', 'link' => route('admin.statistics.index'), 'roles' => ['root','developer','admin']],
|
['name' => 'statistics', 'displayName' => 'Statisztikák', 'icon' => 'kimutatasok', 'link' => route('legacy.show', ['path' => 'admin/statistics']), 'roles' => ['root','developer','admin']],
|
||||||
['name' => 'export', 'displayName' => 'Export', 'icon' => 'export', 'link' => route('admin.export.index'), 'roles' => ['root','developer','admin']],
|
['name' => 'export', 'displayName' => 'Export', 'icon' => 'export', 'link' => route('legacy.show', ['path' => 'admin/export']), 'roles' => ['root','developer','admin']],
|
||||||
['name' => 'priceListProcessor', 'displayName' => 'Árlista feldolgozó', 'icon' => 'price_list', 'link' => '/admin/pricelist-files', 'roles' => ['root','developer','admin']],
|
['name' => 'priceListProcessor', 'displayName' => 'Árlista feldolgozó', 'icon' => 'price_list', 'link' => '/admin/pricelist-files', 'roles' => ['root','developer','admin']],
|
||||||
];
|
];
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
|
|||||||
@ -96,7 +96,7 @@
|
|||||||
|
|
||||||
APP.setApiToken('{{csrf_token()}}');
|
APP.setApiToken('{{csrf_token()}}');
|
||||||
|
|
||||||
APP.loadMainContent('{{route('dashboard.index')}}');
|
APP.loadMainContent('{{ $initialUrl ?? route('dashboard.index') }}');
|
||||||
$('#appLoader').toggleClass('d-none');
|
$('#appLoader').toggleClass('d-none');
|
||||||
$('#appContent').toggleClass('d-none');
|
$('#appContent').toggleClass('d-none');
|
||||||
//alert('doc ready');
|
//alert('doc ready');
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use App\Http\Controllers\LegacyLayoutController;
|
||||||
use App\Http\Controllers\LoginController;
|
use App\Http\Controllers\LoginController;
|
||||||
use App\Http\Controllers\OrderArchiveController;
|
use App\Http\Controllers\OrderArchiveController;
|
||||||
use App\Http\Controllers\OrderController;
|
use App\Http\Controllers\OrderController;
|
||||||
@ -68,16 +69,14 @@
|
|||||||
if (! auth()->check()) {
|
if (! auth()->check()) {
|
||||||
return view('layout.login');
|
return view('layout.login');
|
||||||
}
|
}
|
||||||
/* Debugbar::info('debugBarinfo'.basename(__FILE__).':'.__LINE__);
|
|
||||||
\Log::channel('BrowserConsole')->info('BrowserConsole',['basename'=>basename(__FILE__),'line'=>__LINE__]);
|
|
||||||
\Log::channel('chromePHP')->info('chromePHP'.basename(__FILE__).':'.__LINE__);
|
|
||||||
\Log::channel('firePHP')->info('firePHP'.basename(__FILE__).':'.__LINE__);*/
|
|
||||||
$viewData['site'] = env('APP_STAGE', 'DEV');
|
|
||||||
|
|
||||||
return view('layout.core')->with($viewData);
|
return redirect()->route('legacy.show');
|
||||||
// return view('welcome');
|
|
||||||
})->name('landing');
|
})->name('landing');
|
||||||
|
|
||||||
|
Route::get('/legacy/{path?}', [LegacyLayoutController::class, 'show'])
|
||||||
|
->where('path', '.*')
|
||||||
|
->name('legacy.show');
|
||||||
|
|
||||||
Route::resource('/dashboard', \App\Http\Controllers\DashboardController::class);
|
Route::resource('/dashboard', \App\Http\Controllers\DashboardController::class);
|
||||||
|
|
||||||
Route::prefix('order')->name('order.')->group(function () {
|
Route::prefix('order')->name('order.')->group(function () {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user