stepanenko3 / nova-settings

This Laravel Nova settings tool based on env, using nativ nova fields and resources
MIT License
31 stars 5 forks source link

Not working on live site! #10

Closed HeadStudios closed 1 year ago

HeadStudios commented 1 year ago

Hi,

I've just noticed that while settings() function works fine on my staging it does not work on my live. I've reviewed to confirm everything is the same and I can't find any differences. When I do settings('env'); on live site it comes back with empty array [] but it does come back with the correct values on the staging site.

I know both staging and live are using the same database and I was wondering if you could suggest some troubleshooting steps to find out why this is happening. Thank you!

stepanenko3 commented 1 year ago

Hi, @HeadStudios

Perhaps you have created a resource with settings for "development" (Indicated in the "Env" field of the settings resource), but not created for "production", or is "production" empty?

HeadStudios commented 1 year ago

Hi! Thanks for your quick response!

I noticed if I change APP_ENV from production to local the settings() function works... I ended up removing the code from the settings function which checks the APP_ENV variable. Chrs!

stepanenko3 commented 1 year ago

You could just create a separate record of settings for production )) And edit production and development separately

HeadStudios commented 1 year ago

You could just create a separate record of settings for production )) And edit production and development separately

Thank you! Yes I just realised that there is a text field to set which environment these settings should apply to. All fixed. Thank you for the quick response. Chrs.