M
MeshWorld.
Back to Tags
Topic View

#PHP.

34 posts filed under this topic.

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 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 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 website from SQL injection and XSS with practical code examples!

Vishnu
Vishnu
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 5 min read

Understanding `self::` vs `static::` in PHP: A Simple Guide for Everyone! πŸš€

Learn the difference between self:: and static:: in PHP with easy-to-understand examples! This beginner-friendly guide uses fun illustrations and emojis to make programming concepts clear for everyone.

Vishnu
Vishnu
Laravel 5 min read

Nested Eager Loading in Laravel Explained

Learn how nested eager loading in Laravel Eloquent reduces database queries for deeply related models. Covers syntax, conditional loading, practical examples, and when to use it.

Vishnu
Vishnu
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
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
Laravel 5 min read

Update a Laravel Record Without Touching Timestamps

Four ways to update a Laravel Eloquent record without changing updated_at: timestamps property, saveQuietly(), withoutTimestamps(), and the query builder. With version notes.

Vishnu
Vishnu
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
PHP 5 min read

PHP - Ternary Operator

PHP - Ternary Operator

Vishnu
Vishnu
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
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
Laravel 5 min read

Get Last 30 Days Records in Laravel with Carbon

Three ways to query the last 30 days of records in Laravel using Carbon β€” simple where(), whereBetween(), and a reusable query scope. Works on Laravel 10, 11, and 12.

Vishnu
Vishnu
Laravel 5 min read

Laravel Eloquent whereTime() Method Explained

Learn how Laravel's whereTime() method filters records by the time portion of a datetime column. Covers syntax, all operators, and practical examples for time-based queries.

Vishnu
Vishnu
Laravel 5 min read

Laravel Eloquent whereDate() Method Explained

Learn how Laravel's whereDate() method filters records by date, ignoring the time component. Covers syntax, operators, examples, and why raw where() fails for dates.

Vishnu
Vishnu
Laravel 5 min read

Laravel firstOrCreate(): Find or Create a Record

Learn how Laravel's firstOrCreate() finds the first matching record or creates a new one automatically. Covers syntax, parameters, real examples, and comparison with firstOrNew().

Vishnu
Vishnu
Laravel 5 min read

Laravel firstOrNew(): Find or Prepare a Record

Learn how Laravel's firstOrNew() finds the first matching record or returns an unsaved model instance. Covers syntax, when to use it over firstOrCreate(), and real examples.

Vishnu
Vishnu
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 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 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
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
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
Laravel 5 min read

Drop Composite Indexes in Laravel Migrations

How to drop a composite index in Laravel migrations using dropIndex() with a column array or a named index string. Updated for Laravel 12 anonymous class syntax.

Vishnu
Vishnu
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
Laravel 5 min read

Route Model Binding in Laravel Explained

Route model binding in Laravel automatically resolves Eloquent models from URL parameters. Covers implicit binding, custom keys, scoped bindings, and soft deletes.

Vishnu
Vishnu
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
Laravel 5 min read

Change Laravel Model Timestamp Column Names

How to rename created_at and updated_at in a Laravel Eloquent model using CREATED_AT and UPDATED_AT constants. Covers disabling timestamps and custom date formats too.

Vishnu
Vishnu
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
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
Laravel 5 min read

Get an Array of IDs from an Eloquent Collection

Three ways to extract an array of IDs from a Laravel Eloquent collection: pluck(), modelKeys(), and querying direct. Covers when to use each and performance considerations.

Vishnu
Vishnu
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
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
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