Почему у Eloquent модели недоступны методы конструктора запросов?

Здравствуйте! Есть модель:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
 * @property integer $unid
 * @property integer $userid
 * @property integer $domain
 * @property string $host
 * @property string $type
 * @property string $content
 * @property integer $priority
 * @property integer $weight
 * @property integer $proto
 * @property integer $port
 * @property integer $target
 */
class DNS extends Model
{
    /**
     * The table associated with the model.
     * 
     * @var string
     */
    protected $table = 'dns';
    protected $primaryKey = 'unid';
    /**
     * @var array
     */
    protected $fillable = ['userid', 'domain', 'host', 'type', 'content', 'priority', 'weight', 'proto', 'port', 'target'];
}

И контроллер:
namespace App\Http\Controllers;
require '../vendor/autoload.php';
use App\DNS;

class DNSController extends Controller
{ 
//тут какой-то код
....
//а тут я пытаюсь использовать методы из конструктора запросов  в модели 
  public function CheckRecord ($userid,$id) {
$check = new DNS();
$check->where('unid',1);
        if (isset($check->content)) {return true;}
        else {return false;}
    }
...

}

Но PHPstorm говорит, что в этом классе нет функций where и find, зато нашел функции isUnguarded,all,destroy,save и пр.
  • Вопрос задан
  • 196 просмотров
Пригласить эксперта
Ответы на вопрос 1
AmdY
@AmdY
PHP и прочие вебштучки
Это всё фасады и магические методы, установи https://github.com/barryvdh/laravel-ide-helper
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы