Category "laravel-query-builder"

Laravel Query Builder in Model

I would like to know if is it possible to work in a model using query builder to make a join between 4 tables, I don't know how to use eloquent with 4 tables th

MySQL upgrade causing unexpected results on simple WHERE clauses

I'm upgrading my Laravel app to use MySQL 8.0.23 from 8.0.20, and I see an issue with WHERE clauses that produce unexpected results. SELECT * FROM guilds W

Laravel having column name in where clause static method

Recently I just realized that Laravel generates a static method with column name when joined in a where clause using camel case example $user = User::whereN

How can i paginate laravel collection?

here is how i trying to paginate: $posts = Post::all()->sortByDesc("created_at")->pagination(1); but i get this error: Method Illuminate\Database\Eloquen

Querying only one row from a one to many relationship laravel

I have a products table and a product_pictures table, where a single product can have many pictures (one to many relationship). I am trying to display all of th

Querying only one row from a one to many relationship laravel

I have a products table and a product_pictures table, where a single product can have many pictures (one to many relationship). I am trying to display all of th