feat(tenant): add asset URL to tenant resource response

This commit is contained in:
2026-09-07 09:20:46 -03:00
parent 1e7a9b6876
commit ca4ea0aa6c
2 changed files with 11 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ class TenantResource extends JsonResource
'site_title' => $this->site_title
?? $this->websiteType?->site_title
?? 'ShopitFront',
'asset_url' => config('filesystems.disks.s3.url'),
'address' => $this->address,
'phone' => $this->phone,
'favicon' => ($this->favicon ?? $this->websiteType?->favicon)

View File

@@ -128,6 +128,16 @@ class BootstrapTenantControllerTest extends TestCase
$this->assertArrayNotHasKey('props', $response->json('data'));
}
public function test_it_returns_the_configured_asset_url_in_the_bootstrap(): void
{
config()->set('filesystems.disks.s3.url', 'https://s3.shopit.com.ar/shopit-local');
$this->createTenant();
$this->getJson('/api/tenants/bootstrap?dominio=acme.com&path=%2F')
->assertOk()
->assertJsonPath('data.asset_url', 'https://s3.shopit.com.ar/shopit-local');
}
public function test_it_bootstraps_a_tenant_from_a_full_url(): void
{
$this->createTenant([