Eloquent: Getting Started | Laravel Create or update
IntroductionLaravelincludesEloquent,anobject-relationalmapper(ORM)thatmakesitenjoyabletointeractwithyourdatabase.WhenusingEloquent,eachdatabasetablehasacorresponding"Model"thatisusedtointeractwiththattable.Inadditiontoretrievingrecordsfromthedatabasetable,Eloquentmodelsallowyoutoinsert,update,anddeleterecordsfromthetableaswell.NoteBeforegettingstarted,besuretoconfigureadatabaseconnectioninyourapplicationsconfig/database.phpconfigurationfile.Formoreinformationonconfiguringyourdatabase,checkou...
IntroductionLaravel includes Eloquent, an object-relational mapper (ORM) that makes it enjoyable to interact with your database. When using Eloquent, each database table has a corresponding "Model" that is used to interact with that table. In addition to retrieving records from the database table, Eloquent models allow you to insert, update, and delete records from the table as well.
NoteBefore getting started, be sure to configure a database connection in your applications config/database.php configuration file. For more information on configuring your database, check out the database configuration documentation[1].
Laravel BootcampIf youre new to Laravel, feel free to jump into the Laravel Bootcamp[2]. The Laravel Bootcamp will walk you through building your first Laravel application using Eloquent. Its a great way to get a tour of everything the Laravel and Eloquent have to offer.
Generating Model ClassesTo get started, lets create an Eloquent mo...