25 lines
623 B
PHP
25 lines
623 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Organisation;
|
|
use Inertia\Response;
|
|
|
|
class EnvironmentIndexController extends Controller
|
|
{
|
|
public function __invoke(Organisation $organisation): Response
|
|
{
|
|
$applications = $organisation->applications()
|
|
->with([
|
|
'environments' => fn ($query) => $query
|
|
->withCount(['services', 'attachments', 'variables', 'buildArtifacts'])
|
|
->latest(),
|
|
])
|
|
->get();
|
|
|
|
return inertia('environments/Index', [
|
|
'applications' => $applications,
|
|
]);
|
|
}
|
|
}
|