Kys*_*lik 16
updateOrCreate
是的方法锋生成器和updateOrInsert
是的方法查询生成器.
updateOrCreate
返回模型,而updateOrInsert
返回布尔值
来自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|static
*/
public function updateOrCreate(array $attributes, array $values = [])
Run Code Online (Sandbox Code Playgroud)
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 = [])
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3876 次 |
最近记录: |