2017-06-07 29 views

Trả lời

8

updateOrCreate là phương pháp Eloquent BuilderupdateOrInsert là phương pháp là gì Query Builder. mô hình

updateOrCreate lợi nhuận, trong khi lợi nhuận updateOrInsert boolean


Signatures từ mã Laravel:

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 = []) 
Các vấn đề liên quan