Newslurp

<< Stories

Laravel Nightwatch Announced 🌌, 5 Ways to Extract Value from Overmocked Tests 🧪, How Property Hooks Happened 🪝, SOLO 📦

The Laralist <hello@thelaralist.com>

November 10, 11:27 am

Laravel Nightwatch Announced 🌌, 5 Ways to Extract Value from Overmocked Tests 🧪, How Property Hooks Happened 🪝, SOLO 📦
Taylor announces Laravel’s Nightwatch, a new tool that provides valuable insights into your app’s performance. It helps identify slow routes, track queued job performance, and diagnose user-specific issues. With fast log search capabilities and server health monitoring, Nightwatch offers actionable data to help optimize your application.
The Laralist
10th of November, 2024
🧱
Laravel

Taylor announces Laravel’s Nightwatch, a new tool that provides valuable insights into your app’s performance. It helps identify slow routes, track queued job performance, and diagnose user-specific issues. With fast log search capabilities and server health monitoring, Nightwatch offers actionable data to help optimize your application.

Explore the power of Laravel's Macroable trait, which allows developers to extend built-in classes like Stringable with custom methods. This guide walks through creating a fromJson method, illustrating the process and benefits of using macros to enhance Laravel's functionality.

💡
Tip of the Week

The back() helper generates a redirect response to the previous URL, providing an easy way to navigate users back with optional parameters for status, headers, and fallback.

// Redirects with a 302 status by default
return back();

// Redirects with a custom status, headers, and a fallback URL if the previous location is not available
return back(301, ['X-Custom-Header' => 'value'], '/fallback');
🐘
PHP

Dive into the decade-long journey that led to the development of property hooks in PHP. This feature emerged from extensive community discussions and contributions. The article offers insights into the collaborative process behind PHP’s continuous evolution and highlights the Foundation’s role in fostering innovations that shape the language’s future.

This PHP RFC will enable persistent curl share handles to improve performance by allowing data sharing across multiple requests, without re-establishing connections for each new SAPI request, by modifying the signature of curl_share_init to accept a persistent ID: curl_share_init(?array $share_options, ?string $persistent_id)

This PHP RFC outlines a structured policy for referencing and using third-party PHP code, balancing non-endorsement with practical needs. It proposes clear inclusion criteria, such as being a de facto standard or having a stable release, as well as exclusion criteria and pre-approved libraries like Composer and xDebug. Finally, it provides guidelines for conflict resolution. Full details can be found in the PR.

📦
Package of the Week

The SOLO package in Laravel streamlines local development by running multiple commands, like queue management or log monitoring, simultaneously in separate tabs. It replaces repetitive tasks run during each development cycle with a single command, helping to optimize your workflow.

Misc

Explore the capabilities of the Document Picture-in-Picture API to create floating windows in web apps, keeping elements like text areas accessible while interacting with other parts of the page. This tutorial demonstrates how to turn a Notepad app’s textarea into a floating, interactive window, improving multitasking and usability on web pages.

Tomas Votruba’s article discusses enhancing PHP testing by reducing over-reliance on mocks. He suggests simplifying mocks, using stubs instead of mocks when suitable, and favoring real objects in tests for clearer, more maintainable code. The article also emphasizes the importance of assertions over verifications and improving overall test coverage to focus on system output rather than internal interactions. These methods aim to create more efficient, less complex tests while maintaining clarity and accuracy in testing behaviors.

We value your thoughts and feedback. Feel free to hit reply and share your ideas with us.
If you find our content helpful, please consider forwarding it to your friends and colleagues.
Thank you for reading,
Mario & Javi
If you prefer not to receive future editions of The Laralist, please unsubscribe.