A
A
Abac2502021-09-22 03:18:51
Laravel
Abac250, 2021-09-22 03:18:51

Using DB Facade through Model Laravel 8?

I have a question about using models in laravel 8 for queries.
I am writing laravel in Phpstorm IDE.
The problem is that when using models in this way for queries: the

Model::where()->get();

IDE doesn't give any hints, which is not very convenient. Yes, I know that you can use the DB facade, but still I would like such an option.
But when using this option:

Model::query()->where()->get();

Hints work fine.

Tell me if it's okay to use the last option. And can there be consequences from this in the future?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question