Hi guys ,
I wanna share with you this trick that you may don't know or did not used it before . what if you want to do something like this .
Animals::dogs(); or Animals::cats(); how you can achieve this ... well it's simple with eloquent
Laravel has many choices for performing a query, sometimes it could be confusing, I hope this list help you to clear any doubts.
If you know other way please show it in comments for add it.
Using this package - http://csv.thephpleague.com/
In your controller or wherever you are calling this method from simply create a method like so:
At the top you need to use: use League\Csv;
That's about it, you should be good to go! Would like to thank @msurguy for his help on this too.
- See more at: http://laravelsnippets.com/members/snippets/csv-data-manipulation-with-laravel#sthash.oqBx1dzA.dpuf
With database seeding you can fill your database with dummy data with simple command. I created code that will fill users table with some data. users table consists of three columns (username,email,biog).