Sopamo / laravel-filepond

Laravel backend module for filepond uploads
MIT License
203 stars 56 forks source link

How to send photos with the form to the server? #4

Closed a1lan1 closed 4 years ago

a1lan1 commented 5 years ago

Hello! I want to send the form along with the pictures, on the server, to save the photos I use the Spatie/laravel-medialibrary.

My server code is:

public function store(Request $request)
{
    $product = Product::create($request->all());

    $product->addMediaFromRequest('images')
        ->toMediaCollection('images');

    return response()->json($product);
}

How can I send photos along with the rest of the data from the form to transfer them to the server and save as:

$product->addMediaFromRequest('images')->toMediaCollection('images');

Thanks!

Sopamo commented 5 years ago

Filepond works by uploading the images first, then submitting the form with the rest of your data and moving the files where they should be stored. See the Readme.

Sopamo commented 4 years ago

Closing due to inactivity