有一个名称为Shop的model,可以使用Shop::where("id",14)->first()
但在Illuminate\Database\Eloquent\Model
中却找不到where方法。不过在555行找到了使用where
的代码:
if ( ! is_null($instance = static::where($attributes)->first()))
{
return $instance;
}
这里的static::where()
是怎么回事,Shop::where()
是调用的哪里的where
方法