Skip to content

Commit

Permalink
Fix update Model with no file
Browse files Browse the repository at this point in the history
  • Loading branch information
henryavila committed Sep 19, 2023
1 parent 47dd0ea commit 6b4ef56
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to `laravel-nova-multitenancy` will be documented in this file.

## v3.1.0 - 2023-09-19
Abort if domain is required and domain is not found

## v3.0.4 - 2023-09-01

Fix calc of files size
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "henryavila/laravel-nova-multitenancy",
"version": "3.0.5",
"version": "3.1.0",
"description": "Integrate the multi tenancy single database in Laravel Nova.",
"keywords": [
"henryavila",
Expand Down
3 changes: 3 additions & 0 deletions config/nova-multitenancy.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
// if null, will deactivate the Tenant finder by domain
'domain_class' => null,

// If set to true and a 'domain_class' is defined, will throw a 403 error if the current site domain is not find on Tenant
'must_find_tenant_on_domain' => false,

'fqdn_column' => 'fqdn',

// This invokable class will be executed after the Tenant has been set as current tenant
Expand Down
3 changes: 2 additions & 1 deletion resources/lang/pt_BR.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"Você precisa estar vinculado a alguma conta.": "Você precisa estar vinculado a alguma conta.",
"Você não possui nenhuma conta vinculada ao seu usuário.": "Você não possui nenhuma conta vinculada ao seu usuário.",
"Selecione uma conta": "Selecione uma conta"
"Selecione uma conta": "Selecione uma conta",
"Domínio não encontrado!": "Domínio não encontrado!"
}
4 changes: 4 additions & 0 deletions src/Http/Middleware/SetTenantMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ public function handle($request, Closure $next)

return $next($request);
}

if (config('nova-multitenancy.must_find_tenant_on_domain')) {
abort(403, trans('Domínio não encontrado!'));
}
}

// If the user came from Tenant Selection, let's get data from session and save the tenant
Expand Down

0 comments on commit 6b4ef56

Please sign in to comment.