title: Updateorcreate always create | How to use it?
body: <p>I try to use updateOrCreate function in an observer.
  So i have this function : </p>
  
  <pre><code> $transportpropremoyenaller = Transport::updateOrCreate(
          ['centre_id' =&gt; $gestionsejour-&gt;centre_id, 'allerouretour' =&gt; 
  'Aller', 'date' =&gt; $gestionsejour-&gt;datedebut],
          ['ville' =&gt;  \Config::get('constants.transport.0'), 'tarif' =&gt; '0']
      );
  </code></pre>
  
  <p>I use this function in GestionsejourObserver like that :</p>
  
  <pre><code> public function created(Gestionsejour $gestionsejour)
  {
      return $this-&gt;addtransportpropremoyen($gestionsejour);
  }
  </code></pre>
  
  <p>When i create a new object updateOrCreate never update and always create a new one.</p>
  
  <p>Gestionsejour model is:</p>
  
  <pre><code> protected $fillable = [
      'datefin',
      'user_id',
      'agrement',
      'centre_id',
      'datedebut',
      'created_at',
      'updated_at',
      'deleted_at',
      'dureesejour',
      'periodesejour',
      'complet',
  ];
  
  public function centre()
  {
      return $this-&gt;belongsTo(Centre::class, 'centre_id');
  }
  
  public function getDatedebutAttribute($value)
  {
      return $value ? Carbon::parse($value)-&gt;format(config('panel.date_format')) : null;
  }
  
  public function setDatedebutAttribute($value)
  {
      $this-&gt;attributes['datedebut'] = $value ? Carbon::createFromFormat(config('panel.date_format'), $value)-&gt;format('Y-m-d') : null;
  }
  
  public function getDatefinAttribute($value)
  {
      return $value ? Carbon::parse($value)-&gt;format(config('panel.date_format')) : null;
  }
  
  public function setDatefinAttribute($value)
  {
      $this-&gt;attributes['datefin'] = $value ? Carbon::createFromFormat(config('panel.date_format'), $value)-&gt;format('Y-m-d') : null;
  }
  
  public function user()
  {
      return $this-&gt;belongsTo(User::class, 'user_id');
  }
  </code></pre>
  
  <p>Myabe it's not possible to send 3 attributes or there is a problem with date. I don't know. I'm reading laravel doc but don't understand what is the problem in this simple function.</p>