dcasia / nova-filepond

A Nova field for uploading File, Image and Video using Filepond.
MIT License
48 stars 27 forks source link

Changes in request and logic saving the files #19

Closed dacastro4 closed 3 years ago

dacastro4 commented 4 years ago

Route 404 issue

I fixed the error that I was getting (#18) when trying to process a file. I had to do this to fix it

Route::post('/process/{resource}/{resourceId}', [ FilepondController::class, 'process' ])->name('nova.filepond.process');

It was an issue with the NovaRequest class which required a "resource" in the URL.

JSON column value

I had to make a couple of changes in here to able to do the normal process with JSON column from DB. If you need an example let me know.

Removing file after moving

I'm removing the file after it's moved from the temp folder here

temp location and naming convention

So I decided to add a better naming convention using the file's name because it was really confusing with the random names. Also, I'm using the storage folder for temp files instead of the system's tmp folder. code

Files inside tabs

I made a couple of changes that allow inputs inside the Tab class to use this custom Field code

Vue Index Field

I added a simple list of file names so at least we can see the file names <- (WIP)

milewski commented 4 years ago

I see, so the 404 error was caused by https://github.com/dcasia/nova-filepond/blob/master/src/Http/Controllers/FilepondController.php#L130 $resource::newModel() couldn't find the model because missing the resource on the URL, this must have been a change on latest nova versions before it wasn't required.

Regardless thanks for the PR let me know when it's ready to merge

AlexAzartsev commented 4 years ago

Hello, I faced the same issue with 404 process url, will this fix be merged into master?