Laravel 5.5


How to retrieve random records in Laravel 5.6?

Hi guys, A few days ago I was working on my new laravel 5.6 application and I require to get random products rows from MySQL database using laravel eloquent. I was thinking to use rand() of mysql in laravel but i checked laravel 5 documentation and i found that laravel provide inRandomOrder(). inRandomOrder() will help to retrieve random rows from database table. we can simple use like use get(),.....

Posted On May 23, 2018

Laravel 5.6 - Login with Google with Socialite

Hi Developer, In this example, I will let you how to login with google account on your laravel website. in this example I will use Socialite composer package for sign in with google gmail account. so just follow bellow all step for auth with google in you laravel application. Laravel 5.6 provide us Socialite package that is help to social authentication. Let's follow bellow step: <img src="/uploa.....

Posted On April 7, 2018

Laravel - Where null and Where not null eloquent query example

if you are a starter or learner laravel then you have in mind how to check where null or where not null condition using laravel eloquent model when you are writing eloquent query. if you write query for SQL then it is very easy syntax and families with where null and not null condition. In this small tutorial i will let you know how you can write query for where null and where not null conditio.....

Posted On April 2, 2018

PHP Laravel 5 Eloquent where between two dates from Database

I will show you example of get records between two dates from database using laravel Eloquent whereBetween method. whereBetween helps to get data between 2 dates from database. here also show you example for retrieve records using where between two columns of database table. Here i am getting records from users table and get all data of given $start and $end date between records. So you can see f.....

Posted On March 21, 2018

Laravel cors middleware using barryvdh/laravel-cors example

If you want to add cors middleware in your laravel application then you are a right place. here i will quick guide to add cors middleware using barryvdh/laravel-cors composer package in laravel 5.6 application. cors is important to prevent other domain browsing request. In this example we will use barryvdh/laravel-cors composer package and you will have cors middleware for your every api route .....

Posted On March 15, 2018

Laravel - How to handle "No query results for model" Error

Laravel - How to handle "No query results for model" Error Yesterday, I was just working on my restful API with User model and I found following error on show method: "No query results for the model [App\\User] 1", first I search on google about No query results for a model issue and fix that. but I want to understand why this error comes. i found why No query results for the model is an error on.....

Posted On March 14, 2018

How to get routes lists in Laravel 5 ?

Hi Guys, in this article, I will explain how to get all routes lists using getRoutes() in Laravel 5 app. we can simply get registered routes in laravel 5.6 application. we will use Route facade with getRoutes() method for getting all list of routes. If you require to generate and get all list of routes then you can get it by using this way : "Route::getRoutes()" , Then you can simply get follow.....

Posted On February 27, 2018

Laravel 5 CRUD Generator Example

If you are laravel expert developer then you must choose something tools for crud generator in laravel 5 app. in this tutorial I will show you how to generate crud module using InfyOm CRUD Generator package. using InfyOm package you can simply create admin panel with crud generator. As I write above, if you expert in laravel then you should use something amazing for generate crud module for your .....

Posted On January 23, 2018

Laravel db raw where clause example

If you need to use sql aggregate function with where clause in laravel query builder then you can do it using db raw or whereraw function of laravel eloquent. here you will learn how to use db raw with where clause. In this small tutorial i will give two way to use sql aggregate function with where clause. there are two way : 1) DB::raw() and 2) whereRaw(). So here basically i will give you very .....

Posted On January 18, 2018

Laravel 5 - Database seeder with insert sample user data example

This Wednesday, i will let you know how to create seeder file and why we require to create seed file in laravel. you will learn to create database seeder in your laravel application by following this article. here we will use php artisan make:seeder command for create and php artisan db:seed command for run seeder. If you thinking why we require to create seed in laravel 5 application then i will.....

Posted On January 17, 2018