route('organisation')); return inertia('registries/Create', [ 'registryTypes' => array_values(RegistryType::toArray()), ]); } public function store(StoreRegistryRequest $request): RedirectResponse { $organisation = Organisation::findOrFail($request->route('organisation')); $organisation->registries()->create([ 'name' => $request->string('name')->toString(), 'type' => $request->enum('type', RegistryType::class), 'url' => rtrim($request->string('url')->toString(), '/'), 'credentials' => [ 'username' => $request->string('username')->toString(), 'password' => $request->string('password')->toString(), ], ]); return redirect() ->route('organisations.show', ['organisation' => $organisation->id]) ->with('success', 'Registry created.'); } }