bakerkretzmar / nova-settings-tool

Laravel Nova tool to view and edit application settings.
MIT License
167 stars 32 forks source link

Add single file input type #19

Closed FabioWidmer closed 5 years ago

FabioWidmer commented 5 years ago

This pull request adds support for single file input type settings. The disk and path can be specified in the new disk and path config for every setting.

Enjoy!

zacksleo commented 5 years ago

What about Image Field support?

FabioWidmer commented 5 years ago

@zacksleo This could be easily added in another pull request. Maybe I will do it when I have time and @bakerkretzmar had a look at this one :) Would appreciate it if you could review the pull request soon. Thank you!

bakerkretzmar commented 5 years ago

Thanks! Will take a look and hopefully merge this today.

Since the setting is a single file, I think I'll make the disk (and additionally, a path) configurable for each file, in case someone has multiple file settings and wants to store them in different places.

Thoughts?

FabioWidmer commented 5 years ago

@bakerkretzmar I removed the files_disk config and added the option to set the disk and path per setting object. It makes sense to give the option to store files at different locations. Not sure why the CI check failed for this commit.

FabioWidmer commented 5 years ago

@bakerkretzmar Thanks for merging the pull request. If everything is okay could you please release a new version for Packagist?

bakerkretzmar commented 5 years ago

I will when I've had some time to work on it, hopefully by this weekend. It turns out that sending the whole request as multipart/form-data breaks all the other inputs... empty text comes through as "null", booleans as "true" or "false", etc. I'm putting together a workaround.