Merge branch 'develop' of lab.s-web.fr:ldc-web/projets/com-app-bo into develop
This commit is contained in:
commit
a2e0a60d08
8 changed files with 14 additions and 15 deletions
|
|
@ -183,7 +183,7 @@ class SyncController extends Controller
|
|||
->exists(sprintf('docs/%s/%s.%s', \tenant()->getKey(), $doc['uuid'], $doc['type']));
|
||||
if ($exists) {
|
||||
array_push($attach, URL::temporarySignedRoute(
|
||||
'bo.docs.download',
|
||||
'docs.download',
|
||||
now()->addDays(30),
|
||||
['tenant' => \tenant()->getKey(), 'uuid' => $doc['uuid']]
|
||||
));
|
||||
|
|
|
|||
|
|
@ -209,14 +209,15 @@ class DocumentController extends Controller
|
|||
/**
|
||||
* Download the document
|
||||
*
|
||||
* @param string $tenant
|
||||
* @param string $uuid
|
||||
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
|
||||
*/
|
||||
public function download(string $uuid): \Symfony\Component\HttpFoundation\BinaryFileResponse
|
||||
public function download(string $tenant, string $uuid): \Symfony\Component\HttpFoundation\BinaryFileResponse
|
||||
{
|
||||
$doc = Document::where('uuid', $uuid)->firstOrFail();
|
||||
$pathToFile = public_path() . Storage::url(
|
||||
sprintf('docs/%s/%s.%s', \tenant()->getKey(), $doc->uuid, $doc->type)
|
||||
sprintf('docs/%s/%s.%s', $tenant, $doc->uuid, $doc->type)
|
||||
);
|
||||
return response()->download($pathToFile, $doc->path);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ use App\Traits\Models\IsRelatedToTenant;
|
|||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Str;
|
||||
use Stancl\Tenancy\Contracts\Tenant as BaseTenant;
|
||||
use Stancl\Tenancy\Database\Concerns\BelongsToTenant;
|
||||
use Uwil\LaravelCommon\Helpers\ToolboxHelper;
|
||||
|
||||
|
|
@ -104,7 +105,7 @@ class Formulary extends Model
|
|||
private static function assertNameIsUnique(
|
||||
string|null $name,
|
||||
?int $id = null,
|
||||
\App\Models\Tenant|\Stancl\Tenancy\Contracts\Tenant $tenant = null
|
||||
Tenant|BaseTenant|null $tenant = null
|
||||
) {
|
||||
$table = (new self())->getTable();
|
||||
ToolboxHelper::assertFieldIsUnique($table, 'name', $name, $id, self::whereTenantQuery($tenant));
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 3.1 KiB |
3
resources/views/vendor/errors/403.blade.php
vendored
3
resources/views/vendor/errors/403.blade.php
vendored
|
|
@ -8,6 +8,5 @@
|
|||
@section('button', true)
|
||||
|
||||
@section('image')
|
||||
{{-- FIXME: Personaliser ca --}}
|
||||
<img src="" class="logo img-fluid" alt="{{ config('app.name') }}">
|
||||
<img src="{{ Vite::asset('resources/assets/images/logo.png') }}" class="logo img-fluid" alt="{{ config('app.name') }}">
|
||||
@endsection
|
||||
|
|
|
|||
3
resources/views/vendor/errors/404.blade.php
vendored
3
resources/views/vendor/errors/404.blade.php
vendored
|
|
@ -8,6 +8,5 @@
|
|||
@section('button', true)
|
||||
|
||||
@section('image')
|
||||
{{-- FIXME: Personaliser ca --}}
|
||||
<img src="" class="logo img-fluid" alt="{{ config('app.name') }}">
|
||||
<img src="{{ Vite::asset('resources/assets/images/logo.png') }}" class="logo img-fluid" alt="{{ config('app.name') }}">
|
||||
@endsection
|
||||
|
|
|
|||
3
resources/views/vendor/errors/503.blade.php
vendored
3
resources/views/vendor/errors/503.blade.php
vendored
|
|
@ -6,6 +6,5 @@
|
|||
@section('submessage', __('Le site est en maintenance, nous reviendrons...'))
|
||||
|
||||
@section('image')
|
||||
{{-- FIXME: Personaliser ca --}}
|
||||
<img src="" class="logo img-fluid" alt="{{ config('app.name') }}">
|
||||
<img src="{{ Vite::asset('resources/assets/images/logo.png') }}" class="logo img-fluid" alt="{{ config('app.name') }}">
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -104,10 +104,10 @@ Route::middleware(['web', 'admin-secure'])->name('bo.')->group(function () {
|
|||
])->where('direction', 'up|down')
|
||||
->name('formularies.change-order');
|
||||
});
|
||||
|
||||
// * Public files download
|
||||
Route::get('/docs/{uuid}/download', [DocumentController::class, 'download'])
|
||||
->name('docs.download')
|
||||
->middleware('signed');
|
||||
});
|
||||
});
|
||||
|
||||
// Public files download.
|
||||
Route::get('/{tenant}/docs/{uuid}/download', [DocumentController::class, 'download'])
|
||||
->name('docs.download')
|
||||
->middleware('signed');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue