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.
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()`.
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.
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.
This tutorial explains with an example of how to move a record from one database table to another in PHP Laravel framework.
This tutorial explains how to create and drop composite keys with migration in PHP Laravel framework with syntax and example
This tutorial explains how to create composite keys with migration in PHP Laravel framework with syntax and example
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.
There will be a situation where you’ve to continue using your old or legacy database which might differ with Laravel’s way of naming column names in tables.
Laravel provides few default timestamps fields such as created_at, updated_at and deleted_at.
Laravel provide a helper Arr::query() to build query string from an array, an alternative to core php http_build_query() method.
Tested with Laravel versions 5.8, 6 and 7.
Kindly check for your version on official helpers page.
Get an array of ids from Eloquent collection in Laravel using pluck() and modelKeys() function