2024-04-26 12:09:54 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Livewire\Storage;
|
|
|
|
|
|
|
|
|
|
use App\Models\S3Storage;
|
2025-11-17 09:05:18 +00:00
|
|
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
2024-04-26 12:09:54 +00:00
|
|
|
use Livewire\Component;
|
|
|
|
|
|
|
|
|
|
class Show extends Component
|
|
|
|
|
{
|
2025-11-17 09:05:18 +00:00
|
|
|
use AuthorizesRequests;
|
|
|
|
|
|
2024-04-26 12:09:54 +00:00
|
|
|
public $storage = null;
|
2024-06-10 20:43:34 +00:00
|
|
|
|
2024-04-26 12:09:54 +00:00
|
|
|
public function mount()
|
|
|
|
|
{
|
|
|
|
|
$this->storage = S3Storage::ownedByCurrentTeam()->whereUuid(request()->storage_uuid)->first();
|
2024-06-10 20:43:34 +00:00
|
|
|
if (! $this->storage) {
|
2024-04-26 12:09:54 +00:00
|
|
|
abort(404);
|
|
|
|
|
}
|
2026-02-25 13:20:29 +00:00
|
|
|
try {
|
|
|
|
|
$this->authorize('view', $this->storage);
|
|
|
|
|
} catch (\Illuminate\Auth\Access\AuthorizationException) {
|
|
|
|
|
return $this->redirectRoute('storage.index', navigate: true);
|
|
|
|
|
}
|
2024-04-26 12:09:54 +00:00
|
|
|
}
|
2024-06-10 20:43:34 +00:00
|
|
|
|
2024-04-26 12:09:54 +00:00
|
|
|
public function render()
|
|
|
|
|
{
|
|
|
|
|
return view('livewire.storage.show');
|
|
|
|
|
}
|
|
|
|
|
}
|