wowowowowo
This commit is contained in:
24
app/Http/Controllers/EnvironmentIndexController.php
Normal file
24
app/Http/Controllers/EnvironmentIndexController.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user