25 lines
465 B
PHP
25 lines
465 B
PHP
<?php
|
|
|
|
namespace App\Livewire\Project;
|
|
|
|
use App\Models\ProjectReport;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Livewire\Component;
|
|
|
|
class ReportRow extends Component
|
|
{
|
|
public ProjectReport $report;
|
|
|
|
public function download()
|
|
{
|
|
$filePath = $this->report->project->download_path . '/' . $this->report->path;
|
|
|
|
if (!Storage::exists($filePath)) {
|
|
abort(404);
|
|
}
|
|
|
|
return Storage::download($filePath);
|
|
}
|
|
|
|
}
|