kdion4891 / laravel-livewire-forms

A dynamic, responsive Laravel Livewire form component with realtime validation, file uploads, array fields, and more.
243 stars 54 forks source link

Deployment optimization not possible, file-upload route is a Closure. #19

Closed xewl closed 3 years ago

xewl commented 4 years ago

Description

During deployment the optimize command failed. The file-upload endpoint is set up as a Closure. https://github.com/kdion4891/laravel-livewire-forms/blob/1dd0b4dd11a17abfeee8c921bd9f08ffe90c95b0/routes/web.php#L4-L6

Returning

  LogicException 

  Unable to prepare route [laravel-livewire-forms/file-upload] for serialization. Uses Closure.

Steps to reproduce

use php artisan optimize

Context

papalardo commented 3 years ago

Its easy to resolve. Create controller and move the Closure content to this controller. Then send pull request.

xewl commented 3 years ago

@papalardo Sure is. Well.. since L8 we can also finally serialize closures, so it shouldn't be a problem at this point. I sadly passed for the usage of this repository in the end. So, given these 2 factors I'll close this one.