Tag : Laravel Eloquent

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




How to use whereHas with orWhereHas in Laravel?

How to use whereHas with orWhereHas in Laravel?

Here, we will learn how to use orwherehas in laravel. we can use eloquent wherehas than orwherehas when we used relationship in laravel application. some time we require to use query orwherehas in laravel 6. In this example i will show you how to use whereHas and orWhereHas in laravel application......

By Hardik Savani | Views: 191 | October 19, 2019 | Category : Laravel

Laravel concat two columns with example

Laravel concat two columns with example

If you need to concat two columns with laravel query builder then i will give you example of how to concat two columns in laravel 6 application. we will concat columns in select statement and using laravel eloquent scope. I will give you two way solution for concatenate columns in laravel 6. both w.....

By Hardik Savani | Views: 1925 | September 23, 2019 | Category : Laravel


Laravel Order By Relationship Sum Column Example

Laravel Order By Relationship Sum Column Example

If you are looking for how to laravel order by relation sum then i will help you how to create sum of eloquent relationships model and order by in laravel 6 and laravel 5 application. you can sum relationship column and orderby using subquery in laravel 6 and laravel 5 project. Laravel provide rela.....

By Hardik Savani | Views: 3231 | September 14, 2019 | Category : Laravel

How to use if condition in laravel select query?

How to use if condition in laravel select query?

We will learn how to use if condition in laravel select query. we can use mysql case when statement with db raw in laravel. If you want to use mysql function then you must have to use db raw function. in this example i will show you laravel select query with if condition. In minor case we need to u.....

By Hardik Savani | Views: 18150 | May 29, 2019 | Category : Laravel MySql

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 | Views: 38464 | September 18, 2018 | Category : PHP Laravel

laravel 5.4 New Feature - Add eloquent whereKey method

laravel 5.4 New Feature - Add eloquent whereKey method

Yesterday release Laravel 5.4 new version with new features and many upgrade. Laravel also provide documentation for Laravel 5.4 on their website. There are several update in Laravel 5.4 like in collections, mail, factory helper, Bootstrappers etc. In this post we are going to see whereKey method.....

By Hardik Savani | Views: 44986 | January 25, 2017 | Category : Laravel

How to disable model timestamps in Laravel 5.3?

How to disable model timestamps in Laravel 5.3?

Sometimes we require to disable created_at and updated_at timestamps on Model on Laravel, so we can do it simply by using <strong class="path">$timestamps</strong> variable of model. It is very small things but important to understand and how to use it. When you create new item or user using model.....

By Hardik Savani | Views: 55268 | October 12, 2016 | Category : Laravel

How to get table name from model in Laravel 5?

How to get table name from model in Laravel 5?

If you need to get table name from model in your laravel application then this post can help you to get table name. Laravel based on MVC. So, we require to create model for every table that way we can write database logic on model. But if you require to get table name from model then you can get usi.....

By Hardik Savani | Views: 60877 | August 22, 2016 | Category : Laravel

How to use groupby having with DB::raw in Laravel Query Builder?

How to use groupby having with DB::raw in Laravel Query Builder?

We most probably require to use group by having because if you work on small project then it's not need to use generally. But if you work with big project like e-commerce, social or ERP level project then you may require to use having clause. having clause, we can use simply if we have to compare .....

By Hardik Savani | Views: 57754 | July 6, 2016 | Category : Laravel

How to insert multiple records in Laravel 5?

How to insert multiple records in Laravel 5?

If we work on big project and then we maybe require to add multiple rows on database using laravel eloquent. Laravel provide insert method for bulk records create on db. In bellow example you can see i use multidimensional $myItems array variable and that insert multiple records same time using DB.....

By Hardik Savani | Views: 73411 | June 13, 2016 | Category : Laravel