nine's avatar
Level 1

images and storage

Hi

I follow this tutorial : http://laraveldaily.com/upload-multiple-files-laravel-5-4/ to store images but i cant find the way to get them.

I have my tables, i can store images with this function :

public function uploadSubmit(UploadRequest $request)
    {
        $product = Product::create($request->all());
        foreach ($request->photos as $photo) {
            $filename = $photo->store('S1');
            ProductsPhoto::create([
                'product_id' => $product->id,
                'filename' => $filename
            ]);
        }
        return 'Upload successful!';
    }

$photo->store('photos') : how does it works ?

Because in documentation i found things like : Storage::disk('local')->put($file->getFilename().'.'.$extension, File::get($file)); and to get the image Storage::disk('local')->get($entry->filename);

I'll try a php artisan storage:link command to give me the possibility to see my images but in src tag i try a lot of things like src ="/storage/app/S1/the-filename but its not working.

Can you help ? Thank you

0 likes
0 replies

Please or to participate in this conversation.