Laravel 12.16.0 - New Features for Developers
June 3, 2025Laravel 12.16.0 - New Features for Developers
1. New Validation Rule: in_array_keys
You can now validate that an array contains at least one of the specified keys:
Validator::make($request->all(), [
'config' => 'array|in_array_keys:api_key,access_token,oauth_token',
'config.api_key' => 'nullable|string|min:32|max:64',
// ...
]);
This in_array_keys rule checks for the presence of any given key.
2. Fluent Rule Method: Rule::contains()
This gives you a cleaner and more expressive way to check array contents:
Validator::make($request->all(), [
'roles' => [
'required',
'array',
Rule::contains([Role::Admin, Role::Editor]),
],
]);
This replaces the older string-based contains: validation rule.
3. New Helper: Arr::hasAll()
use Illuminate\Support\Arr;
$array = ['name'=>'Taylor','language'=>'php'];
Arr::hasAll($array, ['name']); // true
Arr::hasAll($array, ['name','language']); // true
Arr::hasAll($array, ['name','ide']); // false
You're able to check if an array has *all* specified keys.
4. toUri() on Stringable
$sentence = 'Go to {https://euhosting.com/support} for support.';
$uri = str($sentence)->between('{','}')->toUri();
return $uri->value();
This converts a string segment into a URI object easily.
5. Additional Fixes & Enhancements
- Added option to always defer cache operations.
- Bug fixes around RedisStore, TestResponse, ResponseFactory, and more.
Blog
Mastering Modern CSS: The Power of if(), Popover Hints, and Smart Styling
Jul 16, 2025
🌐 Mastering Modern CSS: The Power of if(), Popover Hints, and Smart Styling CSS is getting smarter. In this guide, we’ll explore how the new...
Mastering Laravel 12 Conditional Validation
Jul 07, 2025
Mastering Laravel 12 Conditional Validation Laravel 12's validation system is super powerful, and conditional validation makes your forms...
How to Make Your Website Blazing Fast – Step by Step
Jul 30, 2025
Why Performance Is Non-Negotiable In today’s fast-paced world, no one has time to wait for a slow-loading website. On mobile, users abandon...
Top Laravel & PHP Updates for Cleaner, Faster Code
Aug 17, 2025
Laravel Global Scopes: Automatic Query Filtering Eloquent Importance: Enforce consistent filters across all model queries (e.g., Soft Del...
Explore the Most Powerful Modern Laravel Tools: Inertia.js, View Creators, and HLS — Step by Step
Jul 27, 2025
Here’s a complete breakdown of essential tools to level up your Laravel development: Inertia.js v2, View Creators, and the Laravel HLS package...
Essential React Native UI & Interaction Components
Jul 01, 2025
Essential React Native UI & Interaction Components React Native provides a powerful set of built-in components for creating native mobile apps....