D
D
driverx182017-09-03 22:58:54
Laravel
driverx18, 2017-09-03 22:58:54

Why is the DB Facade needed?

I am more than sure that the question is very noob, but I really want to know the answer
. Laravel has a DB facade, with it you can pull data from the database, add it, and so on. Let's say if you work through the DB facade with the articles table, then it will be something like this: But why do I need a DB facade if I can do all this through the model? Clarify please
DB::table('articles')->get();
$articles = Article::all();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PashaNedved, 2017-09-04
@PashaNedved

But why do I need a DB facade if I can do all this through the model?

Maybe you don't need a DB facade?
Q: What if I don't need Eloquent?
Answer: I will use the DB facade.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question