php - The difference between an Eloquent Model and a Model? -


so, i'm confused : in laravel's official documentation, :

the eloquent orm included laravel provides beautiful, simple activerecord implementation working database. each database table has corresponding "model" used interact table.

ok util here great, !

so make migration create database : php artisan make:migration create_items_table --create="items"

great until here :)

so theoretically speaking, when make : php artisan make:model item , laravel create php class ( used interact items table) :

   class item extends eloquent {       ...      } 

but,in real world, when make : php artisan make:model item , laravel creates php class ( used interact items table) ::

   class item extends model {       ...      } 

so why model , not eloquent ?? missing sth ? , what's difference between eloquent model , model.

and if there's difference, when should use eloquent , when model ... ?

thank ^^

i found solution question ...

so must add alias config/app.php

 'aliases' => [         'eloquent'  => illuminate\database\eloquent\model::class, 

and when create model, laravel use eloquent; instead of use illuminate\database\eloquent\model; why think, person may use model, when other may use eloquent , it's matter of give meaning sense namespace :3


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -