Laravel

Get Last Array Element in PHP and Laravel

This article, guide you through the retrieval of last array element in different ways in Laravel and also in PHP.

Create collection instance for given array in Laravel

This tutorial explains with syntax and an example of how to create a collection instance from provided array with Laravel collect() helper method in the framework.

Get Laravel Version via Command Line

This article, guide you through the retrieval of Laravel version of a project being used.

Laravel's Eloquent whereTime() filtering method

This article, guide you through the usage of Laravel's Eloquent `whereTime()` method. It is used to match a field value against a specific time.

Laravel's Eloquent whereDate() filtering method

This article, guide you through the usage of Laravel's Eloquent `whereDate()` method. It is used to match a field value against a specific date.

Laravel's firstOrCreate Model Method

In this article, we will see Laravel's `firstOrCreate()` model method and how it provides you first instance from table if exists or create new table records if does not exists. You don't need to explicitly save like `firstOrNew()`.

Laravel's firstOrNew Model Method

In this article, we will see Laravel's `firstOrNew()` model method and how it is useful. It provides you first instance from table if exists or create new model instance. You need to explicitly save model instance.

Flatten Array using Arr::flatten() in Laravel

This tutorial explains with syntax and an example of how to flatten a multi-dimensional array based on the value of depth specified in the Laravel framework.

How To Move Record From One Table To Another In Laravel

This tutorial explains with an example of how to move a record from one database table to another in PHP Laravel framework.

How To Drop Composite Indexes With Migration In Laravel

This tutorial explains how to create and drop composite keys with migration in PHP Laravel framework with syntax and example

How To Create Composite Indexes With Migration In Laravel

This tutorial explains how to create composite keys with migration in PHP Laravel framework with syntax and example

Ways to declare unsigned columns in the Laravel migrations

Laravel allows developers to declare unsigned columns in different ways. As it's required to handle the relationship between tables by just associating models with each other.