Closed adrian-schnell closed 9 months ago
I've updated my local installation to use that same uri but everything keeps working, so the problem is not with the custom uri.
403 indicates an authorization / authentication problem; the issue might be related to your Nova path.
If you can answer the following questions we'll probably find the issue:
path
option set to in config/nova.php
?Thanks for your quick reply.
'path' => '/admin_backend',
https://domain.test/admin_backend/setup/create-community
MenuItem::link(__('backend/sidebar_menu.community_wizard'), NovaWizard::pathToWizard('create-community')),
when adding it as tool with new NovaWizard('create-community')
it links to https://domain.test/admin_backend/nova-wizard
and inside the wizard config:
return [
'create-community' => [
'class' => CreateCommunityWizard::class,
'uri' => 'setup/create-community',
'windowTitle' => 'Create your Community now',
],
];
Sorry for the confusion, I've been working too much on nova-calendar 🙈.
I meant "2. At what URL are you trying to open your wizard?" I guess the same URL as you mentioned under 3?
I've recreated your setup but everything works for me.
However, I do get a 403 if I remove the Tool from the array returned by tools()
in the NovaServiceProvider
.
Can you check again if you performed step 4 of the installation instructions completely?
I.e., are you including new NovaWizard('create-community')
in the array returned by the tools()
method?
indeed the tool was missing as I understood it to either add it as tool or as link.
Now I added the tool as well. The link is still added manually. Sorry was a misunderstood of my side 🫣
But now I've a followup problem: The window remains empty except the navigations. In the console there's this error:
In the class I copied the demo content:
<?php
namespace App\Nova\Wizard;
use Laravel\Nova\Fields;
use Wdelfuego\NovaWizard\AbstractWizard;
class CreateCommunityWizard extends AbstractWizard
{
public function wizardViewData(): array
{
return [
'steps' =>
[
'title' => 'Step 1/2',
'fields' => [
Fields\Text::make(__('Username'), 'username'),
Fields\Text::make(__('Text field'), 'myText'),
Fields\Textarea::make(__('Longer text'), 'myLongerText')
->help("You can use Help texts on Nova fields like you're used to"),
Fields\Number::make(__('Some number'), 'myNumber')
->rules('required')
->withMeta(['value' => 60])
->min(1)
->step(1),
],
],
[
'title' => 'Step 2/2',
'fields' => [
Fields\Text::make(__('Text field 2'), 'myText2'),
Fields\Textarea::make(__('Longer text 2'), 'myLongerText2')
->help("You can use Help texts on Nova fields like you're used to"),
Fields\Number::make(__('Some number 2'), 'myNumber2')
->rules('required')
->withMeta(['value' => 60])
->min(1)
->step(1),
],
],
];
}
public function onSubmit($formData, &$context): bool
{
return true;
}
public function successViewData($context): array
{
return [
'message' => 'Success! Your Community has been created.',
];
}
}
Thanks for letting me know. If you think the documentation can be improved, feel free to create a PR!
I've created a new issue for your Javascript error.
I tried to setup the wizard as shown in the documentation. Only thing I changed is the uri in the config file to
setup/create-community
. When clicking the link to open the wizard (embed as tool or direct link) I'm receiving 403.