server selector wip
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\ServerStatus;
|
||||
use App\Models\Environment;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -10,9 +11,13 @@ class EnvironmentController extends Controller
|
||||
public function show(Request $request)
|
||||
{
|
||||
$id = $request->route('environment');
|
||||
$environment = Environment::with('application')->findOrFail($id);
|
||||
|
||||
return inertia('environments/Show', [
|
||||
'environment' => Environment::with('application')->findOrFail($id),
|
||||
'environment' => $environment,
|
||||
'servers' => inertia()->optional(function () use ($environment) {
|
||||
return $environment->application?->organisation?->servers->where('status', ServerStatus::ACTIVE)?->values() ?? [];
|
||||
}),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user