Show pages for app,env,org plus navigation, servers wip
This commit is contained in:
@@ -8,8 +8,7 @@ class ApplicationController extends Controller
|
||||
{
|
||||
public function show(Request $request)
|
||||
{
|
||||
return inertia('Applications/Show', [
|
||||
// 'application' => $request->route('application'),
|
||||
]);
|
||||
$id = $request->route('application');
|
||||
return inertia('applications/Show');
|
||||
}
|
||||
}
|
||||
|
||||
17
app/Http/Controllers/EnvironmentController.php
Normal file
17
app/Http/Controllers/EnvironmentController.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Environment;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class EnvironmentController extends Controller
|
||||
{
|
||||
public function show(Request $request)
|
||||
{
|
||||
$id = $request->route('environment');
|
||||
return inertia('environments/Show', [
|
||||
'environment' => Environment::findOrFail($id),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -6,5 +6,8 @@ use Illuminate\Http\Request;
|
||||
|
||||
class OrganisationController extends Controller
|
||||
{
|
||||
//
|
||||
public function show()
|
||||
{
|
||||
return inertia('organisations/Show');
|
||||
}
|
||||
}
|
||||
|
||||
17
app/Http/Controllers/ServerController.php
Normal file
17
app/Http/Controllers/ServerController.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Organisation;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ServerController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$organisation = Organisation::findOrFail($request->route('organisation'));
|
||||
return inertia('servers/Index', [
|
||||
'servers' => $organisation->servers()->paginate(30),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -30,9 +30,9 @@ class HandleInertiaRequests extends Middleware
|
||||
...parent::share($request),
|
||||
'name' => config('app.name'),
|
||||
'organisation' => $request->route('organisation') ? Organisation::with('applications')->findOrFail($request->route('organisation')) : null,
|
||||
'application' => $request->route('application') ? Application::findOrFail($request->route('application')) : null,
|
||||
'application' => $request->route('application') ? Application::with('environments')->findOrFail($request->route('application')) : null,
|
||||
'auth' => [
|
||||
'user' => $request->user()->load('organisations'),
|
||||
'user' => $request->user()?->load('organisations'),
|
||||
],
|
||||
'ziggy' => [
|
||||
...(new Ziggy)->toArray(),
|
||||
|
||||
Reference in New Issue
Block a user