title: findOrCreate in laravel
body: <p>I want to create data but if the data already in database, it will update. but if the data not already in database, it will create new data. </p>
  
  <p><strong>this my controller</strong></p>
  
  <pre><code>public function store(Request $request)
  {      
      $real = SpentTime::findOrCreate([
          'plan_id' =&gt; $request-&gt;get ('plan_id'),
          'daily_spent_time' =&gt; $request-&gt;get ('daily_spent_time'),
          'daily_percentage' =&gt; $request-&gt;get ('daily_percentage'),
          'reason' =&gt; $request-&gt;get ('reason')
      ]);
  
      return redirect()-&gt;route('real.index', compact( 'reals'));
  }
  </code></pre>
  
  <p><strong>this my model</strong></p>
  
  <pre><code>public static function findOrCreate($plan_id)
  {
      $real = SpentTime::find($plan_id);
      return $real ?: new SpentTime;
  }
  </code></pre>
  
  <p>when I make data already in the database, the data is not updated.</p>