28 lines
760 B
PHP
28 lines
760 B
PHP
<?php
|
|
|
|
namespace App\Domains\Admin\Controllers;
|
|
|
|
use App\Models\Tenant;
|
|
use App\Providers\InertiaProvider;
|
|
use App\Scopes\CommonController;
|
|
use Illuminate\Http\Request;
|
|
use Inertia\Response;
|
|
|
|
class TenantEditPageController extends CommonController
|
|
{
|
|
public function __invoke(string $slug, Request $request): Response
|
|
{
|
|
$tenant = Tenant::where('slug', $slug)->firstOrFail();
|
|
|
|
$inertiaProvider = new InertiaProvider('Admin/TenantEdit', [
|
|
'tenant' => [
|
|
'name' => $tenant->name,
|
|
'slug' => $tenant->slug,
|
|
'url' => $tenant->url,
|
|
'is_active_local_group' => $tenant->is_active_local_group,
|
|
],
|
|
]);
|
|
return $inertiaProvider->render();
|
|
}
|
|
}
|