Newslurp

<< Stories

Laravel 12.16, Prism Relay, whenHas Method, and more! - №567

Laravel News <hello@laravel-news.com>

June 8, 6:31 am

Laravel 12.16, Prism Relay, whenHas Method, and more! - №567
Your Laravel week in review ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Your Laravel week in review

Week 567

Cast Model Properties to a Uri Instance in 12.17

The Laravel team released v12.16.0, with an "AsUri" model cast, contextual service container binding using PHP 8 attributes, and more.

Sponsor

Build Backend, Win Front-row Rewards

Do you spend your days crafting APIs, managing migrations, or optimizing database queries? The Developer Nation Survey wants your take on modern backend workflows, from tools and frameworks to deployment habits. Share your insights in just a few minutes and unlock a chance to win a Keychron keyboard, $300 toward your favorite AI tool, Gift Cards, and more. Everyone who completes the survey also gets access to the Virtual Goody Bag packed with dev resources and discounts.

By participating in the New Developer Nation Survey you are actively supporting freeCodeCamp, Open Sourcing Mental Illness (OSMI), and Charity Water

Join forces with thousands of developers worldwide!

Prism Relay

A seamless integration between Prism and Model Context Protocol (MCP) servers that empowers your AI applications with powerful, external tool capabilities.

Clean Up Your Code with the whenHas Method

Feeling overwhelmed by the clutter of managing optional form fields? The 'When Has' method is your solution. It streamlines your code, letting you easily check and update fields like email frequency without the mess. Plus, it provides a fallback for missing data with default settings. Once you try it, you'll appreciate the simplicity it brings to your code.

Laravel Jobs

The official Laravel job board connecting the best jobs with top talent.

Now hiring

Post a job on LaraJobs and it'll be featured here next week.

Fathom Analytics Events for Laravel Livewire

The Fathom Analytics package for Laravel Livewire provides Alpine.js directives and helpers for seamless Fathom Analytics event tracking in Blade templates and Livewire components.

▶️

Frontend hooks, birthdays, and passkeys

This week Jake and Michael discuss Frontend hooks, birthdays, and passkeys

Simplify API Responses with Fluent Methods

Tired of constantly wrestling with type errors in API responses? Fluent methods offer a type-safe, boilerplate-free way to streamline your API handling. Forget cumbersome checks—fluent methods handle data retrieval with ease and built-in defaults. Once you try fluent, you'll wonder how you ever coded without it!

Replace String Prefixes Precisely with Laravel's replaceStart Method

Laravel's Str::replaceStart method enables precise prefix replacement by modifying strings only when they begin with specific content. This utility excels in URL normalization, path cleanup, and configuration processing where conditional string manipulation is required.

Laravel OpenRouter

The OpenRouter package for Laravel helps you integrate OpenRouter into your Laravel applications. OpenRouter is a unified interface for Large Language Models (LLMs) that allows you to interact with various AI models through a single API.

Enable Flexible Pattern Matching with Laravel's Case-Insensitive Str::is Method

Laravel's Str::is method now supports case-insensitive pattern matching through a third boolean parameter. This enhancement enables more flexible string comparisons with wildcard patterns, improving user experience in file validation, routing, and configuration management scenarios.

Simplify Negative Relation Queries with Laravel's whereDoesntHaveRelation Methods

Laravel's whereDoesntHaveRelation methods simplify querying records that lack specific relationships. These utilities eliminate complex closure syntax for negative relation queries, making code more readable while supporting both standard and polymorphic relationships with clean, intuitive syntax.

Efficiently remove expired cache data with Laravel Cache Evict

Efficiently remove expired cache data with Laravel Cache Evict.

Test Job Failures Precisely with Laravel's assertFailedWith Method

Laravel's assertFailedWith method enables precise testing of job failures by verifying specific exception types, messages, and error codes. This enhancement makes job testing more reliable by confirming exactly how jobs fail rather than just detecting failure occurrence.

Enhance Collection Validation with containsOneItem() Closure Support

Laravel's containsOneItem() method now supports closures for custom condition validation, enabling verification that exactly one collection item meets specific criteria. This enhancement improves business rule validation by providing precise control over collection constraints beyond simple size checking.

Laravel News PO Box 196 Cramerton NC, 28032
Send us a postcard! You are receiving this because you joined the Laravel News weekly digest. If you know someone who would enjoy this newsletter please consider sharing it.

View Online | Opt out of the weekly email | Unsubscribe