unch-cms/routes/tenant.php
2022-09-02 11:25:50 +07:00

60 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
use Illuminate\Support\Facades\Route;
use Stancl\Tenancy\Middleware\InitializeTenancyByDomain;
use Stancl\Tenancy\Middleware\PreventAccessFromCentralDomains;
use Stancl\JobPipeline\JobPipeline;
use App\Models\Tenant;
/*
|--------------------------------------------------------------------------
| Tenant Routes
|--------------------------------------------------------------------------
|
| Here you can register the tenant routes for your application.
| These routes are loaded by the TenantRouteServiceProvider.
|
| Feel free to customize them however you want. Good luck!
|
*/
Route::middleware([
'web',
InitializeTenancyByDomain::class,
PreventAccessFromCentralDomains::class,
])->group(function () {
Route::get('/', function () {
$theme = tenant('tenant_theme');
Theme::uses($theme);
$data['tenant'] = tenant('tenant_username');
$theme_uri = theme_helper::get_theme_uri($theme);
// dd($themes);
return Theme::view('index',['theme_uri'=>$theme_uri]);
});
Route::get('/about',function(){
});
Route::middleware(['auth', 'uc-admin'])->group(function () {
Route::get('uc-admin', function () {
echo "hello admin";
})->name('uc-admin');
});
});