2017-06-07 3 views

Antwort

8

updateOrCreate ist Methode der Eloquent Builder und updateOrInsert ist Methode existiert oder aktualisieren, Query Builder.

updateOrCreate kehrt Modell, während updateOrInsert kehrt boolean


Signatures aus Laravel Code:

updateOrCreate

/** 
* Create or update a record matching the attributes, and fill it with values. 
* 
* @param array $attributes 
* @param array $values 
* @return \Illuminate\Database\Eloquent\Model 
*/ 
public function updateOrCreate(array $attributes, array $values = []) 

updateOrInsert

/** 
* Insert or update a record matching the attributes, and fill it with values. 
* 
* @param array $attributes 
* @param array $values 
* @return bool 
*/ 
public function updateOrInsert(array $attributes, array $values = []) 
Verwandte Themen