feat: companies CRUD with person dialog integration and navigation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 11:16:01 +02:00
parent 169a078a92
commit 4388811be9
14 changed files with 984 additions and 73 deletions

View File

@@ -20,7 +20,10 @@ final class CompanyController extends Controller
{
Gate::authorize('viewAny', [Company::class, $organisation]);
$companies = $organisation->companies()->get();
$companies = $organisation->companies()
->withCount('persons')
->ordered()
->get();
return CompanyResource::collection($companies);
}
@@ -34,6 +37,15 @@ final class CompanyController extends Controller
return $this->created(new CompanyResource($company));
}
public function show(Organisation $organisation, Company $company): JsonResponse
{
Gate::authorize('view', [$company, $organisation]);
$company->loadCount('persons');
return $this->success(new CompanyResource($company));
}
public function update(UpdateCompanyRequest $request, Organisation $organisation, Company $company): JsonResponse
{
Gate::authorize('update', [$company, $organisation]);