38 lines
926 B
PHP
38 lines
926 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Client\Doctor;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Resources\Client\CaseResource;
|
|
use App\Models\Document;
|
|
use App\Services\Document\CaseService;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Inertia\Inertia;
|
|
|
|
class DocumentController extends Controller
|
|
{
|
|
protected CaseService $caseService;
|
|
|
|
public function __construct(CaseService $caseService)
|
|
{
|
|
$this->caseService = $caseService;
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$documents = $this->caseService->pendingForUser(Auth::user())
|
|
->paginate(10)
|
|
->withQueryString()
|
|
->onEachSide(1);
|
|
|
|
return Inertia::client('Dashboard/Documents/Index', [
|
|
'documents' => CaseResource::collection($documents),
|
|
]);
|
|
}
|
|
|
|
public function show(Document $document)
|
|
{
|
|
return redirect()->route('dashboard.cases.show', $document);
|
|
}
|
|
}
|