php - connect to existing database in laravel 4 -


i have started using laravel 4 , have been reading "code bright". attempting migrate 1 of applications laravel framework. have seen how create new database using schema builder , migrations, have database few tables , hundreds of rows. how use models in laravel 4 query database? have added connection in config.

you have create models each table. if table name plural, best use it's singular name class name model.

for cases doesn't work (where name may not plural or ends in 'ies' may confuse laravel), set property protected $table = 'tablename'; coincide table wish create model for.

after that, follow documention on eloquent setting relationships may need make.

it may possible, , idea, make migrations each of tables, though may quite time consuming. you'd have make each migration file fill out migrations table laravel uses hand.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -