Tag : Query Builder

ItSolutionStuff.com have tutorials for Query Builder tag, here you can study articles of Query Builder tag, Query Builder tag posts collection, most popular and useful tutorials of Query Builder tag, here you can find list of all relevant posts and example about Query Builder tag, we have lists of tutorials and examples about Query Builder tag. very simple and quick example collection of Latest Query Builder tag.




How to use Union query with Laravel Eloquent?

How to use Union query with Laravel Eloquent?

In this post, i would like to share with you how we can use union and union all query in laravel 5 application. Laravel eloquent provide query builder and they give us join, relationship, subquery and also union. But we need some time to get all records from two different table at that time you nee.....

By Hardik Savani | September 18, 2018 | Category : PHP Laravel

Laravel 5 - whereIn and whereNotIn with subquery example using query builder

Laravel 5 - whereIn and whereNotIn with subquery example using query builder

As you know laravel is very popular php framework in today. So every point will be require for database related and that important. In this post i would like to share with you how to use subquery with whereIn and whereNotIn clause from scratch. We may sometimes require to use select query with wher.....

By Hardik Savani | March 23, 2017 | Category : Laravel MySql


Laravel - How to search with comma separated values using Query Builder ?

Laravel - How to search with comma separated values using Query Builder ?

Sometimes, we require to manage to take single column for multiple integer ids, for example if we have "posts" table and require to set multiple tags on each post, so at that time we can take just single column and store selected tags ids. this way will use less memory. It is simple to store data in.....

By Hardik Savani | March 2, 2017 | Category : Laravel MySql

Laravel 5 - "syntax error or access violation 1055 in group by" Solved

Laravel 5 - "syntax error or access violation 1055 in group by" Solved

Yesterday i was working on my Laravel 5.4 application and when i use group by statement in query builder I found error like as bellow: <br/> <strong> SQLSTATE[42000]: Syntax error or access violation: 1055 'admin.products.name' isn't in GROUP BY (SQL: select `products`.*, SUM(products_stock.stock) f.....

By Hardik Savani | February 15, 2017 | Category : Laravel

Laravel - How to make subquery in select statement?

Laravel - How to make subquery in select statement?

Sometimes we require to make subquery inside the select statement in Laravel. At that time we are thinking how to select from subquery using in Laravel Query Builder. In this post i will give you example of subquery in select statement in Laravel 5 application from scratch. For subquery in select .....

By Hardik Savani | February 6, 2017 | Category : Laravel MySql

MySql comma separated column join in PHP Laravel 5

MySql comma separated column join in PHP Laravel 5

If we work in big application or project of Laravel Framework, sometimes we require to manage column value into comma separated because we can save memory of database. But if we store comma separated value in column with ids then it's difficult to inner join or left join and get records from another.....

By Hardik Savani | January 7, 2017 | Category : PHP Laravel MySql SQL

Laravel 5.3 - Call to undefined method Illuminate\Database\Query\Builder::lists() Solved

Laravel 5.3 - Call to undefined method Illuminate\Database\Query\Builder::lists() Solved

Today i want to tell you about error "Call to undefined method Illuminate\Database\Query\Builder::lists()" and how to solve this error in Laravel 5.3. When i was working on my Laravel 5.3 application, at that time i require to get lists of email and id of users table for select drop-down. But when .....

By Hardik Savani | September 24, 2016 | Category : Laravel

Laravel 5.3 - whereDate(), whereMonth(), whereDay() and whereYear() examples.

Laravel 5.3 - whereDate(), whereMonth(), whereDay() and whereYear() examples.

Laravel is a very popular PHP framework. Laravel 5.3 release few days ago and there are several new feature added by Laravel. Laravel 5.3 introduce several new where conditions like whereDate(), whereMonth() etc in Query Builder. Today, i am going to show you how to use it in your Laravel Applicati.....

By Hardik Savani | September 6, 2016 | Category : Laravel

Laravel 5 - where condition with two columns example code

Laravel 5 - where condition with two columns example code

Laravel 5 introduce whereColumn() in Query Builder, that way we can compare two column like simple where condition. We sometimes require to check this type of condition. In this example code, i have simple "items" table and i want to get only created_at and updated_at column should equals. So you c.....

By Hardik Savani | July 29, 2016 | Category : Laravel

Group by year month example in Laravel 5 using Query Builder

Group by year month example in Laravel 5 using Query Builder

Sometimes, we have created_at column with timestamp and we wanted to get with group by with month, that way we can use for chart. However, you can do it using mysql MONTH() function. we can use DB raw with mysql function and get group by monthly records. So, you can see bellow query and use it. <s.....

By Hardik Savani | June 20, 2016 | Category : Laravel