añadir nuevas funcionalidades

This commit is contained in:
2025-04-30 20:56:28 +02:00
parent 883daf32ed
commit 655ea60d6b
71 changed files with 3836 additions and 1158 deletions

View File

@@ -6,9 +6,13 @@ use App\Jobs\ProcessDocumentOCR;
use App\Models\Document;
use App\Models\Project;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
class DocumentController extends Controller
{
public $comments=[];
/**
* Display a listing of the resource.
*/
@@ -56,7 +60,19 @@ class DocumentController extends Controller
*/
public function show(Document $document)
{
//
$this->authorize('view', $document); // Si usas políticas
if (!Storage::exists($document->file_path)) {
abort(404);
}
$document->url = Storage::url($document->file_path);
return view('documents.show', [
'document' => $document,
'versions' => $document->versions()->latest()->get(),
'comments' => $this->comments,
]);
}
/**