The Form upload and the product image as featured image and other other images using the store function of laravel 

```
use App\Productimage;
use App\Products; 
public function store(Request $request)
{
    $featured = $request->featured_image->store('products_featured');
    $product = Products::create([       //uploading successfully
    'name'=>$request->name,
    'featured_image' => $featured,
    ]);
             foreach ($request->photos as $photo) {   //error
        $filename = $photo->store('product_images');
        Productimage::create([
            'product_id' => $product->id,
            'image_name' => $filename,
        ]);
    }
    return back();
}

```