Snippets tagged “eloquent”
7 snippets use this tag.
- Eloquent model mass updatePHP
To update multiple records in the Eloquent ORM (Object-Relational Mapping) in Laravel, you can use the update() method on the query builder or on a model instance.
- How to alias a table in Laravel Eloquent queries (or using Query Builder)?PHP
To alias a table in a Laravel Eloquent query, you can use the as method on a DB facade.
- How to get last insert id in Eloquent ORM laravelPHP
In Laravel, you can use the save method provided by Eloquent to insert a new record and retrieve the last insert ID.
- Laravel - where less/greater than date syntaxPHP
In Laravel, you can use the where method on a query builder or an Eloquent model to filter records based on a date column using less than or greater than operators.
- Laravel Delete Query BuilderPHP
In Laravel, you can use the Query Builder to delete records from a database table.
- Laravel Eloquent LEFT JOIN WHERE NULLPHP
In Laravel, you can use the leftJoin method on a query builder instance to perform a left join, and then use the whereNull method to only include records where a column from the right-hand table is null:
- Laravel Eloquent Sum of relation's columnPHP
You can use the sum method on an Eloquent relation to get the sum of a column's values.