雄辩的地方还没有丢失

时间:2015-10-21 18:40:37

标签: laravel eloquent

我需要访问雄辩的whereHasNot方法(此处添加:
https://github.com/laravel/framework/commit/8f0cb08d8ebd157cbfe9fdebb54d2b71b0afaabd

我通过composer安装了laravel / framework(v5.1.20)。但是,我的/Illuminate/Database/Eloquent/Builder.php文件中不存在该方法。

以下是我在composer.json中的内容

"laravel/framework": "5.1.*",

我在这里错过了吗?

如果我无法通过作曲家添加此内容,如何在我的应用中扩展Eloquent以添加此方法?

谢谢!

1 个答案:

答案 0 :(得分:20)

2014年12月17日,它被重命名为whereDoesntHave

/**
 * Add a relationship count condition to the query with where clauses.
 *
 * @param  string  $relation
 * @param  \Closure|null  $callback
 * @return \Illuminate\Database\Eloquent\Builder|static
 */
public function whereDoesntHave($relation, Closure $callback = null)
{
    return $this->doesntHave($relation, 'and', $callback);
}