Basic seeder, navigating to application page

This commit is contained in:
2025-03-28 14:39:36 +00:00
parent d21250ce66
commit 72b6231b8c
10 changed files with 146 additions and 27 deletions

View File

@@ -0,0 +1,15 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ApplicationController extends Controller
{
public function show(Request $request)
{
return inertia('Applications/Show', [
// 'application' => $request->route('application'),
]);
}
}

View File

@@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class OrganisationController extends Controller
{
//
}

View File

@@ -2,27 +2,16 @@
namespace App\Http\Middleware;
use Illuminate\Foundation\Inspiring;
use App\Models\Application;
use App\Models\Organisation;
use Illuminate\Http\Request;
use Inertia\Middleware;
use Tighten\Ziggy\Ziggy;
class HandleInertiaRequests extends Middleware
{
/**
* The root template that's loaded on the first page visit.
*
* @see https://inertiajs.com/server-side-setup#root-template
*
* @var string
*/
protected $rootView = 'app';
/**
* Determines the current asset version.
*
* @see https://inertiajs.com/asset-versioning
*/
public function version(Request $request): ?string
{
return parent::version($request);
@@ -37,14 +26,13 @@ class HandleInertiaRequests extends Middleware
*/
public function share(Request $request): array
{
[$message, $author] = str(Inspiring::quotes()->random())->explode('-');
return [
...parent::share($request),
'name' => config('app.name'),
'quote' => ['message' => trim($message), 'author' => trim($author)],
'organisation' => $request->route('organisation') ? Organisation::with('applications')->findOrFail($request->route('organisation')) : null,
'application' => $request->route('application') ? Application::findOrFail($request->route('application')) : null,
'auth' => [
'user' => $request->user(),
'user' => $request->user()->load('organisations'),
],
'ziggy' => [
...(new Ziggy)->toArray(),