Basic seeder, navigating to application page
This commit is contained in:
15
app/Http/Controllers/ApplicationController.php
Normal file
15
app/Http/Controllers/ApplicationController.php
Normal 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'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
10
app/Http/Controllers/OrganisationController.php
Normal file
10
app/Http/Controllers/OrganisationController.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class OrganisationController extends Controller
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user