Laravel Tricks

Browse latest tricks and tips on Laravel.

Using multiple Where clause Query in Laravel.

How to Create Multiple Where Clause Query Using Laravel Eloquent?Simply add an array of condition in where function of laravel Eloquent to create multiple where clause.Here is an e ...
published on : 1 day ago 12 Comments

Image Manipulation in Laravel 5

An introduction to Intervention ImageIntervention Image is an open source PHP library for image handling and manipulation.Intervention image provides image cropping, editing, compo ...
published on : 17 minutes ago 12 Comments

Laravel get ip address

How can we get the IP address of the user in LaravelHello friend in this post I going to show you how to get users IP address in Laravel 5.8 and save it is database.Different Metho ...
published on : 40 minutes ago 12 Comments

findorFail method in Laravel

How to use findOrFail() method?Sometimes you may wish to throw an exception if a specific record is not found. To do this, you may use the findOrFail method in Laravel findOrFail m ...
published on : 10 hours ago 12 Comments

Step by step guide to display wordpress posts in Laravel 5

Fetching WordPress posts in LaravelSometimes we have two different databases in our application one for Laravel and other for WordPress to manage our website blog.In this post, we ...
published on : 41 minutes ago 12 Comments

Installing specific version of Laravel with Composer

How to Install specific version of Laravel.To install specific version of Laravel please run below command on your terminalcomposer create-project laravel/laravel=version-to-instal ...
published on : 42 minutes ago 12 Comments

DB prefix in Lumen Framework.

How to use db prefix in Lumen? To use db prefix in Lumen, In your .env file add new constant “DB_PREFIX”Usage: DB_PREFIX=your_prefix_ ...
published on : 1 day ago 12 Comments

Ajax code to delete file in laravel

Deleting a file from public directory in LaravelBelow is a simple code to unlink a file in laravel.AJAX Code in your view filevar CSRF_TOKEN  =  "{{csrf_token()}}"; var ...
published on : 43 minutes ago 12 Comments

Class ‘DB’ not found in Lumen

Fixing Class 'DB' not foundBy defaults Facades are not enabled in Lumen, To use DB Facade functions un-comment $app->withFacades(); line from your bootstrap/app.php file. ...
published on : 57 minutes ago 12 Comments

Using Session in Laravel

Getting,Setting and Destroying session in LaravelSessions are used to store and pass information to one page to another page on website. It is a temporary storage and hold data for ...
published on : 19 minutes ago 12 Comments