Difference between DB :: table ('table') and model: :( 'table')

on laravel we can access using DB::table('table')->get();or using model::('table')->all(); my question what is the difference between them?

thank.

+4
source share
1 answer

You can do this because the Modelfacade also DBimplements the functions that give the instance Builder.

https://laravel.com/api/5.2/Illuminate/Database/Eloquent/Model.html
https://laravel.com/api/5.2/Illuminate/Database/Query/Builder.html

, Model , Builder , , , , , - .

, , Builder ( , - Builder), , .

, , Laravel, Symfony2 , . .

+3

All Articles