I am confused what's the difference of seeding and by using model in laravel which both saving data into the database. Why not just use Model? or Why not Seed? When and why they used?
Answers will be appreciated.
I am confused what's the difference of seeding and by using model in laravel which both saving data into the database. Why not just use Model? or Why not Seed? When and why they used?
Answers will be appreciated.
Seeds are used to put static or test to database for once. Everytime you run seeders your data tables will be truncated and seeded again.
However Models are dynamic they can recieve data from controller directly from forms, API's or files etc.
P.S: You can use files, API's for seeding too but evertime you put new file to same table old one will be truncated