refactor: remove tenant code check and implement middleware for menu validation in controllers
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Domains\Authorization\Enums\RoleCode;
|
||||
use App\Domains\Catalog\Models\Attribute;
|
||||
use App\Domains\Catalog\Models\CatalogItem;
|
||||
use App\Domains\Catalog\Models\Category;
|
||||
use App\Domains\Menu\Models\Menu;
|
||||
use App\Domains\Shared\Enums\FieldType;
|
||||
use App\Domains\Tenant\Models\Tenant;
|
||||
use App\Domains\Tenant\Models\WebsiteType;
|
||||
@@ -211,7 +212,15 @@ class EntryControllerTest extends TestCase
|
||||
|
||||
private function createFiestaTenant(): Tenant
|
||||
{
|
||||
return $this->createTenant('fiesta_futbol_infantil');
|
||||
$tenant = $this->createTenant('fiesta_futbol_infantil');
|
||||
$menu = Menu::query()->create([
|
||||
'code' => 'adminapp.fiesta-futbol-infantil.entradas',
|
||||
'label' => 'Entradas',
|
||||
'route' => '/admin/entradas',
|
||||
]);
|
||||
$tenant->menues()->attach($menu->code);
|
||||
|
||||
return $tenant;
|
||||
}
|
||||
|
||||
private function createTenant(string $code): Tenant
|
||||
|
||||
Reference in New Issue
Block a user