Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why I got 404 on nova-settings url ? #190

Open
sergeynilov opened this issue Nov 7, 2024 · 3 comments
Open

Why I got 404 on nova-settings url ? #190

sergeynilov opened this issue Nov 7, 2024 · 3 comments

Comments

@sergeynilov
Copy link

sergeynilov commented Nov 7, 2024

I have installed outl1ne/nova-settings "^5.2" into Laravel 10 / nova 4.27 app and with default config
file config/nova-settings.php :

<?php

return [

    /**
     * Set a name for the settings table
     */
    'table' => 'nova_settings',

    /**
     * URL path of settings page
     */
    'base_path' => 'nova-settings',

    /**
     * Reload the entire page on save. Useful when updating any Nova UI related settings.
     */
    'reload_page_on_save' => false,

    /**
     * We need to know which eloquent model should be used to retrieve your permissions.
     * Of course, it is often just the default model but you may use whatever you like.
     *
     * The model you want to use as a model needs to extend the original model.
     */
    'models' => [
        'settings' => \Outl1ne\NovaSettings\Models\Settings::class,
    ],

    /**
     * Show the sidebar menu
     */
    'show_in_sidebar' => true
];

In NovaServiceProvider class I defined settings itens as :

    public function boot()
    {
        parent::boot();

//        if ( ! App::isLocal()) {
//            Nova::globalSearchDebounce(2);
//        }



        \Outl1ne\NovaSettings\NovaSettings::addSettingsFields([
            Boolean::make(NovaSettingsParamEnum::USER_ACTIVE_ON_REGISTER->value,
                fn() => $this->resolveUserActiveOnRegisterValue()),
            Text::make(NovaSettingsParamEnum::CONTACT_US_EMAIL->value, fn() => $this->resolveContactUsEmailValue()),
            Number::make(NovaSettingsParamEnum::INVOICE_DAYS_BEFORE_EXPIRE->value,
                fn() => $this->resolveInvoiceDaysBeforeExpireValue()),
        ],
            [
                NovaSettingsParamEnum::USER_ACTIVE_ON_REGISTER->value => 'boolean',
                NovaSettingsParamEnum::CONTACT_US_EMAIL->value => 'string',
                NovaSettingsParamEnum::INVOICE_DAYS_BEFORE_EXPIRE->value => 'integer',
                // ...
            ]
        );
    }

I left 3rd parameter as empty (default 'general' value).

I see new menu item :

https://img001.prntscr.com/file/img001/pNaA_ELwQ-inT8HKEPWgHA.png

but clicking on the menu item I got 404 error and I can not enter settings page.

I run commands :

php artisan route:clear
php artisan config:clear
php artisan cache:clear
php artisan view:clear

The same result.

In php artisan route:list command I see :

  DELETE    nova-api/nova-settings/{path}/field/{fieldName} .......................................................................................................................................................... Outl1ne\NovaSettings › SettingsController@deleteImage

...

GET|HEAD  nova-vendor/nova-settings/settings ........................................................................................................................................................... nova-settings.get › Outl1ne\NovaSettings › SettingsController@get
  POST      nova-vendor/nova-settings/settings ......................................................................................................................................................... nova-settings.save › Outl1ne\NovaSettings › SettingsController@save
...
  GET|HEAD  nova/nova-settings/{pageId?} ................................................................................................................................................................................................................................... 

What did I miss in my settings ?

@Tarpsvo
Copy link
Collaborator

Tarpsvo commented Nov 7, 2024

image
Did you add it to the tools?

@sergeynilov
Copy link
Author

Yes, and the plugin works ok when I read some parameter from db

@sergeynilov
Copy link
Author

I salved this issue after I began using local server with url

php artisan serve

with url for my app

http://127.0.0.1:8000/

Before that I used virtual host of apache 2 under kubuntu 22.04 with php 8.2.

That seems strange for me, but are there some common known errors with virtual host of apache?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants