title: UpdateOrCreate Model Object
body: <p>I am using <code>Laravel 5.5</code> and I am declaring my model object the following:</p>
  
  <pre><code>        $product = new product();
          $product-&gt;name = $coinArr[$key];
          $product-&gt;symbol = $symbolArr[$key];
          $product-&gt;current_price = $priceArr[$key];
  
          ///save image to public folder
          $fileName = basename($imgArr[$key]);
          Image::make($imgArr[$key])-&gt;save(public_path('images/' . $fileName));           
          $product-&gt;asset_logo = $fileName;
          //$product-&gt;updateOrCreate();
          App/Product::updateOrCreate($product);
  </code></pre>
  
  <p>If the <code>product</code> does not exist in the database I would like to create it else just update it.</p>
  
  <p>I tried the following two ways to use the <code>updateOrCreate</code> method. However, I receive the following error for <code>App/Product::updateOrCreate($product);</code>:</p>
  
  <pre><code>  Type error: Too few arguments to function Illuminate\Database\Eloquent\Builder::updateOrCreate(), 0 passed in C:\Users\admin\Desktop\Coding Projects\laravel_proj\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php on line 1455 and at least 1 expected
  </code></pre>
  
  <p>And the following error for <code>$product-&gt;updateOrCreate();</code>:</p>
  
  <pre><code>Type error: Too few arguments to function Illuminate\Database\Eloquent\Builder::updateOrCreate()
  </code></pre>
  
  <p>Any suggestions how to use <code>updateOrCreate</code> with my model object?</p>
  
  <p>I appreciate your replies!</p>