Laravel Eloquent ist an object-relational-mapper, an ORM, that makes working with databases a joy. While you still need a basic understanding about your database and how writing queries works, Laravel Eloquent provides convenient methos to insert, update and query this data. Eloquent uses the active record pattern where every column in the database table is accessible via a magic method of the related Eloquent Model.

The Eloquent relationships on the User model for this setup looks as simple as that: public function posts(): HasMany { return $this->hasMany(Post::class); } public function comments(): HasMany { return $this->hasMany(Comment::class); }

When you query your database with Laravel Eloquent, you can add as many where conditions to the query as you want.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners