MeshWorld India Logo MeshWorld.
Back to Tags
Topic View

#PHP.

33 posts filed under this topic.

Unsigned Columns in Laravel Migrations
Laravel 5 min read

Unsigned Columns in Laravel Migrations

How to declare unsigned integer columns in Laravel migrations using unsignedBigInteger(), foreignId(), and the unsigned() modifier. Updated for Laravel 12.

Vishnu
Vishnu
PHP - LinkedIn Skill Assessments Quizzes with Answers
PHP 5 min read

PHP - LinkedIn Skill Assessments Quizzes with Answers

In this article, you will find LinkedIn Assessment, Questions and Answers for PHP.

Darsh Jariwala
Darsh Jariwala
PHP Cookies 🍪 vs Sessions 🔐: Complete Guide with Code Examples
PHP 5 min read

PHP Cookies 🍪 vs Sessions 🔐: Complete Guide with Code Examples

Learn PHP cookies 🍪 and sessions 🔐 with fun theme park analogies. Manage user data securely with practical PHP code snippets!

Vishnu
Vishnu
PHP Input Validation & Sanitization: Railway Ticket Booking Guide
PHP 5 min read

PHP Input Validation & Sanitization: Railway Ticket Booking Guide

Learn PHP input validation and sanitization with a fun railway ticket booking analogy. Protect your site from SQL injection and XSS with practical examples.

Vishnu
Vishnu
PHP self:: vs static:: Explained: A Simple Guide
PHP 5 min read

PHP self:: vs static:: Explained: A Simple Guide

Learn the key differences between self:: and static:: in PHP. Understand late static binding, class inheritance, and when to use each for cleaner OOP code.

Vishnu
Vishnu
Nested Eager Loading in Laravel Eloquent Explained
Laravel 5 min read

Nested Eager Loading in Laravel Eloquent Explained

Reduce database queries in Laravel using nested eager loading. Learn the syntax, conditional loading, and how to optimize deeply related Eloquent models.

Vishnu
Vishnu
Check Your Laravel Version from the Command Line
Laravel 5 min read

Check Your Laravel Version from the Command Line

How to check your Laravel version using php artisan --version, php artisan about, composer show, and app()->version(). Updated for Laravel 12 in 2026.

Vishnu
Vishnu
Install XAMPP on Ubuntu
HowTo 5 min read

Install XAMPP on Ubuntu

Learn how to install XAMPP on Ubuntu, start and stop it from the terminal, open the manager, and remove it cleanly when needed.

Vishnu
Vishnu
Update a Laravel Record Without Touching Timestamps
Laravel 5 min read

Update a Laravel Record Without Touching Timestamps

Update Laravel records without changing updated_at using four methods: the timestamps property, saveQuietly(), withoutTimestamps(), or the query builder.

Vishnu
Vishnu
PHP Interview Questions
PHP 5 min read

PHP Interview Questions

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.

Vishnu
Vishnu
Get the Last Element of an Array in PHP and Laravel
PHP 5 min read

Get the Last Element of an Array in PHP and Laravel

Five ways to get the last element of a PHP array: Arr::last(), last() helper, end(), array_slice(), and Eloquent collection ->last(). With side-effect warnings.

Vishnu
Vishnu
Create a Laravel Collection from an Array
Laravel 5 min read

Create a Laravel Collection from an Array

Learn how to wrap a plain PHP array in a Laravel Collection using collect() or new Collection(). Covers filter, map, sum, and groupBy with real examples.

Vishnu
Vishnu
Get Last 30 Days Records in Laravel with Carbon
Laravel 5 min read

Get Last 30 Days Records in Laravel with Carbon

Query the last 30 days of records in Laravel using Carbon. Learn three efficient methods including whereBetween() and reusable model query scopes.

Vishnu
Vishnu
Laravel Eloquent whereTime() Method Explained
Laravel 5 min read

Laravel Eloquent whereTime() Method Explained

Filter Laravel records by time using the whereTime() method. Learn syntax, operators, and practical examples for precise time-based Eloquent queries.

Vishnu
Vishnu
Laravel Eloquent whereDate() Method Explained
Laravel 5 min read

Laravel Eloquent whereDate() Method Explained

Filter Laravel records by date while ignoring time using whereDate(). Learn the syntax, comparison operators, and why raw where() calls often fail for dates.

Vishnu
Vishnu
Laravel firstOrCreate(): Find or Create a Record
Laravel 5 min read

Laravel firstOrCreate(): Find or Create a Record

Find the first matching record or create a new one automatically with Laravel's firstOrCreate(). Learn syntax, parameters, and how it differs from firstOrNew().

Vishnu
Vishnu
How to Use Laravel firstOrNew() to Find or Prepare Records
Laravel 5 min read

How to Use Laravel firstOrNew() to Find or Prepare Records

Learn how Laravel's firstOrNew() finds a matching record or returns a new instance. Compare it with firstOrCreate() and see real-world examples for your app.

Vishnu
Vishnu
Laravel RequiredIf Validation: Pass a Condition Directly
Laravel 5 min read

Laravel RequiredIf Validation: Pass a Condition Directly

Four ways to use Laravel's required_if validation rule — rule strings, booleans, closures, and Rule::when() — with a full Form Request example and gotchas.

Vishnu
Vishnu
Laravel Validation: Allow Only Past Dates Before Today
Laravel 5 min read

Laravel Validation: Allow Only Past Dates Before Today

How to validate that a date input is in the past in Laravel — birthday fields, start dates, and any field where future dates shouldn't be accepted.

Vishnu
Vishnu
Laravel Arr::flatten(): Flatten Nested Arrays
Laravel 5 min read

Laravel Arr::flatten(): Flatten Nested Arrays

How to flatten multi-dimensional PHP arrays with Laravel's Arr::flatten(). Covers the depth parameter, key discard behavior, and comparison with plain PHP.

Vishnu
Vishnu
Move Records Between Tables in Laravel
Laravel 5 min read

Move Records Between Tables in Laravel

How to move a database record from one table to another in Laravel using replicate(), setTable(), and DB::transaction() to keep the operation atomic and safe.

Vishnu
Vishnu
Remove Elements from a Laravel Collection
Laravel 5 min read

Remove Elements from a Laravel Collection

How to remove items from a Laravel Collection using reject(), filter(), and forget(). Covers closures, key-based removal, and Eloquent collection examples.

Vishnu
Vishnu
Drop Composite Indexes in Laravel Migrations
Laravel 5 min read

Drop Composite Indexes in Laravel Migrations

Drop composite indexes in Laravel migrations using dropIndex() with column arrays or named strings. Updated for the latest Laravel 12 anonymous class syntax.

Vishnu
Vishnu
Create Composite Indexes in Laravel Migrations
Laravel 5 min read

Create Composite Indexes in Laravel Migrations

How to create composite (multi-column) indexes in Laravel migrations using anonymous migration syntax. Covers naming, column order rules, and how to drop them.

Vishnu
Vishnu
Route Model Binding in Laravel Explained
Laravel 5 min read

Route Model Binding in Laravel Explained

Automatically resolve Eloquent models from URL parameters in Laravel. Learn about implicit binding, custom keys, scoped bindings, and soft deletes.

Vishnu
Vishnu
Create Database Indexes in Laravel Migrations
Laravel 5 min read

Create Database Indexes in Laravel Migrations

How to add single, unique, full-text, and primary key indexes in Laravel migrations. Includes naming, dropping, and when each index type makes sense.

Vishnu
Vishnu
Change Laravel Model Timestamp Column Names
Laravel 5 min read

Change Laravel Model Timestamp Column Names

Rename created_at and updated_at in Laravel using model constants. Learn how to customize timestamp names, disable them, or change date formats easily.

Vishnu
Vishnu
How to build query string from an array with http_build_query in PHP
PHP 5 min read

How to build query string from an array with http_build_query in PHP

How to build query string from an array with http_build_query in PHP

Vishnu
Vishnu
Convert Hex Color to RGB or RGBA in PHP
PHP 5 min read

Convert Hex Color to RGB or RGBA in PHP

A PHP helper function that converts any hex color code to rgb() or rgba() — handles 3-char shorthand, optional opacity, and the # prefix. With usage examples.

Vishnu
Vishnu
Get an Array of IDs from an Eloquent Collection
Laravel 5 min read

Get an Array of IDs from an Eloquent Collection

Extract an array of IDs from a Laravel Eloquent collection using pluck(), modelKeys(), or direct queries. Find the most efficient method for your needs.

Vishnu
Vishnu
What’s New in PHP 7.4
PHP 5 min read

What’s New in PHP 7.4

PHP 7.4 is coming with new features, deprecations, and a boost in performance. Find out the new PHP 7.4 features in this guide.

Vishnu
Vishnu
How to find the array index key of multi-dimensional array
PHP 5 min read

How to find the array index key of multi-dimensional array

How to find the array index key of multi-dimensional array

Vishnu
Vishnu
How to Get Values from Multi-dimensional Arrays with array_column()
PHP 5 min read

How to Get Values from Multi-dimensional Arrays with array_column()

array_column() is an inbuilt PHP function which is used to get the values from a single column from the multi-dimensional array or an array of objects.

Vishnu
Vishnu