add LegacyLayoutController.php. Need modern layout and routing for DRY

This commit is contained in:
E98Developer 2026-03-22 07:17:36 +01:00
parent 5ec98de0bb
commit dbdab1a38c
4 changed files with 40 additions and 21 deletions

View 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,
]);
}
}

View File

@ -1,18 +1,18 @@
@php
$modules = [
['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' => 'activeOrder', 'displayName' => 'Megrendelések', 'icon' => 'tranzakciok', 'link' => route('orderArchive.index'), 'roles' => ['root','developer','admin','profit-center']],
['name' => 'productGroup', 'displayName' => 'Termékcsoportok', 'icon' => 'category', 'link' => route('admin.productGroup.index'), 'roles' => ['root','developer','admin']],
['name' => 'product', 'displayName' => 'Termék', 'icon' => 'raktar', 'link' => route('admin.product.index'), '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' => 'priceList', 'displayName' => 'Webrendelős árlisták', 'icon' => 'price_list2', 'link' => route('admin.priceList.index'), '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' => 'profitCenter', 'displayName' => 'Profitcenter', 'icon' => 'profitCenter', 'link' => route('admin.profitCenter.index'), 'roles' => ['root','developer','admin']],
['name' => 'fileBatchUpload', 'displayName' => 'Tömeges Feltöltés', 'icon' => 'upload', 'link' => route('admin.fileBatchUpload.index'), 'roles' => ['root','developer','admin']],
['name' => 'statistics', 'displayName' => 'Statisztikák', 'icon' => 'kimutatasok', 'link' => route('admin.statistics.index'), 'roles' => ['root','developer','admin']],
['name' => 'export', 'displayName' => 'Export', 'icon' => 'export', 'link' => route('admin.export.index'), 'roles' => ['root','developer','admin']],
['name' => 'priceListProcessor', 'displayName' => 'Árlista feldolgozó', 'icon' => 'price_list', 'link' => '/admin/pricelist-files', 'roles' => ['root','developer','admin']],
['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('legacy.show', ['path' => 'order']), 'roles' => ['root','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('legacy.show', ['path' => 'admin/productGroup']), '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('legacy.show', ['path' => 'admin/supplier']), '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('legacy.show', ['path' => 'admin/priceListProfitCenter']), '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('legacy.show', ['path' => 'admin/fileBatchUpload']), '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('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']],
];
@endphp

View File

@ -96,7 +96,7 @@
APP.setApiToken('{{csrf_token()}}');
APP.loadMainContent('{{route('dashboard.index')}}');
APP.loadMainContent('{{ $initialUrl ?? route('dashboard.index') }}');
$('#appLoader').toggleClass('d-none');
$('#appContent').toggleClass('d-none');
//alert('doc ready');

View File

@ -11,6 +11,7 @@
|
*/
use App\Http\Controllers\LegacyLayoutController;
use App\Http\Controllers\LoginController;
use App\Http\Controllers\OrderArchiveController;
use App\Http\Controllers\OrderController;
@ -68,16 +69,14 @@
if (! auth()->check()) {
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 view('welcome');
return redirect()->route('legacy.show');
})->name('landing');
Route::get('/legacy/{path?}', [LegacyLayoutController::class, 'show'])
->where('path', '.*')
->name('legacy.show');
Route::resource('/dashboard', \App\Http\Controllers\DashboardController::class);
Route::prefix('order')->name('order.')->group(function () {