Home>

Language: PHP (laravel)

I want to extract a specific query from the DB.
Here we want to extract a suitable query from the "id" column of the table.

Error message
BadMethodCallException (code: 0): Call to undefined method Illuminate \\ ...
Applicable source code
Hoge.php
class Hoge extends BaseModel
{
// abbreviated
    public function scopeGetFuga ($query, $id)
    {
        return $query->where ('id', '=', $id);
    }
}
HogeController.php
        $hoge = Hoge :: getFuga ('1')->get ();
Tried

We paid attention to typographical errors.

Supplemental information (FW/tool version etc.)

laravel 5.5