Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 16, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 16, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 16, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 16, 2025

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025

      Minecraft licensing robbed us of this controversial NFL schedule release video

      May 16, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The power of generators

      May 16, 2025
      Recent

      The power of generators

      May 16, 2025

      Simplify Factory Associations with Laravel’s UseFactory Attribute

      May 16, 2025

      This Week in Laravel: React Native, PhpStorm Junie, and more

      May 16, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025
      Recent

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Access Request Data Fluently in Laravel 11.34

    Access Request Data Fluently in Laravel 11.34

    November 27, 2024

    Access Request Data Fluently in Laravel 11.34

    This week, the Laravel team released v11.34, with a Request::fluent() method, a Number spellOrdinal() helper, conditional route definitions, shorthand fakes for HTTP responses, and more.

    Spell ordinals as words

    Joel Stein contributed the spellOrdinal() to the Number helper to spell ordinals as words:

    'The ' . Number::spellOrdinal(40) . ' president of the United States is Ronald Reagan';
    

    See Pull Request #53661 for more details.

    Add the Conditional trait to routes

    @Boorinio contributed the Conditional trait to the Route class, which allows developers to add conditional logic when defining routes:

    Route::middleware('shop')
        ->domain('{shop}.domain.com')
        ->when(App::isProduction(), function ($route) {
            $route->whereIn('shop', app(ShopService::class)->getShopSlugs());   
        });
    
    

    See Pull Request #53654 for more details.

    Shorthands for fake HTTP responses

    Jason McCreary contributed shorthands when faking HTTP responses. Before v11.34 shorthand arrays were possible, however, this PR adds strings for the response body or an integer for the status code:

    // Before
    Http::fake([
        'google.com' => Http::response('Hello World'),
        'github.com' => Http::response(['foo' => 'bar']),
        'forge.laravel.com' => Http::response(status: 204),
    ]);
    
    // After
    Http::fake([
        'google.com' => 'Hello World',
        'github.com' => ['foo' => 'bar'],
        'forge.laravel.com' => 204,
    ]);
    

    See Pull Request #53663 for more details.

    Add Request::fluent() Method

    Steve Bauman contributed a fluent() method to the HTTP Request class which enables being able to transport input data fluently:

    /** @var IlluminateHttpRequest $request */
    $data = $request->fluent();
    
    $data->title;
    $data->body;
    // etc.
    

    See Pull Request #53662 for more details.

    PHP 8.4 code compatibility

    Mior Muhammad Zaki contributed PHP 8.4 code compatability for Laravel 10.x and well as v11.x during this release:

    • [11.x] Supports PHP 8.4
    • [10.x] PHP 8.4 Code Compatibility

    Release notes

    You can see the complete list of new features and updates below and the diff between 11.33.0 and 11.34.0 on GitHub. The following release notes are directly from the changelog:

    v11.34.0

    • [10.x] Fix append and prepend batch to chain by @Bencute in https://github.com/laravel/framework/pull/53455
    • [11.x] Allow BackedEnum when using fromRoute() in MakesHttpRequests by @wietsewarendorff in https://github.com/laravel/framework/pull/53593
    • [11.x] Test Improvements by @crynobone in https://github.com/laravel/framework/pull/53586
    • [11.x] Move $ownerKey check for null to MorphTo as BelongsTo relationship will always return a string by @crynobone in https://github.com/laravel/framework/pull/53592
    • Unset eloquent model’s cached cast attribute by @adamthehutt in https://github.com/laravel/framework/pull/53583
    • [11.x] Add non-static JsonResource wrapping by @SanderMuller in https://github.com/laravel/framework/pull/53543
    • [10.x] PHP 8.4 Code Compatibility by @crynobone in https://github.com/laravel/framework/pull/53612
    • Add assertCount() for fake storage by @ahmadreza1383 in https://github.com/laravel/framework/pull/53620
    • Fix Paginator __construct parameter typehint for phpstan by @Afrowson in https://github.com/laravel/framework/pull/53615
    • [11.x] Add generics for Arr::last() by @talkinnl in https://github.com/laravel/framework/pull/53619
    • Add typed closure to bootstrappers in console application by @MatusBoa in https://github.com/laravel/framework/pull/53613
    • refactor: Some minor performance & readability enhancements by @dshafik in https://github.com/laravel/framework/pull/53596
    • [11.x] Improve doc blocks for interacting with enum inputs by @axlon in https://github.com/laravel/framework/pull/53625
    • [11.x] Skip object construction if no rebound callbacks are set by @axlon in https://github.com/laravel/framework/pull/53502
    • Make the bearerToken method case-insensitive by @samtlewis in https://github.com/laravel/framework/pull/53627
    • [11.x] Fix attribute inheritance for nested scheduled groups by @istiak-tridip in https://github.com/laravel/framework/pull/53626
    • [11.x] Supports PHP 8.4 by @crynobone in https://github.com/laravel/framework/pull/53468
    • ☁️ by @taylorotwell in https://github.com/laravel/framework/pull/53623
    • [11.x] Fix typo in docblock by @stancl in https://github.com/laravel/framework/pull/53636
    • Add Number::spellOrdinal() to spell ordinals as words. by @joelstein in https://github.com/laravel/framework/pull/53661
    • [11.x] Add PausePrompt fallback by @jwpage in https://github.com/laravel/framework/pull/53660
    • [11.x] Fix SyntaxError on Vite prefetch with empty assets by @jnoordsij in https://github.com/laravel/framework/pull/53659
    • [11.x] Improved class-string types by @timacdonald in https://github.com/laravel/framework/pull/53657
    • [11.x] Use never type for methods that always throws by @tamiroh in https://github.com/laravel/framework/pull/53643
    • [11.x] Adds conditional to routes by @Boorinio in https://github.com/laravel/framework/pull/53654
    • [11.x] Make withoutDefer also return $this by @tamiroh in https://github.com/laravel/framework/pull/53644
    • Add shorthands for fake HTTP responses by @jasonmccreary in https://github.com/laravel/framework/pull/53663
    • Use the environment method instead of the isLocal method by @NaokiTsuchiya in https://github.com/laravel/framework/pull/53638
    • [11.x] Fix: Ensure generated policies return boolean values by @Aluisio-Pires in https://github.com/laravel/framework/pull/53632
    • Bus assertempty by @jasonmccreary in https://github.com/laravel/framework/pull/53664
    • [11.x] Improve schedule group behaviors by @istiak-tridip in https://github.com/laravel/framework/pull/53641
    • [11.x] Add Request::fluent method by @stevebauman in https://github.com/laravel/framework/pull/53662
    • [11.x] Support named in-memory SQLite connections by @stancl in https://github.com/laravel/framework/pull/53635
    • event name & listener callback types by @rudiedirkx in https://github.com/laravel/framework/pull/53642
    • Test cleanup from #53664 by @jasonmccreary in https://github.com/laravel/framework/pull/53672
    • [11.x] Fix: Prevent invalid AWS credentials options being created by @robchett in https://github.com/laravel/framework/pull/53633
    • [11.x] Expand SupportFluent data access and transformation capabilities by @stevebauman in https://github.com/laravel/framework/pull/53665

    The post Access Request Data Fluently in Laravel 11.34 appeared first on Laravel News.

    Join the Laravel Newsletter to get all the latest
    Laravel articles like this directly in your inbox.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleThe Hype Around Signals
    Next Article Efficient Large Dataset Handling in Laravel Using streamJson()

    Related Posts

    Machine Learning

    Salesforce AI Releases BLIP3-o: A Fully Open-Source Unified Multimodal Model Built with CLIP Embeddings and Flow Matching for Image Understanding and Generation

    May 16, 2025
    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 16, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    The 15 best early Amazon Spring Sale laptop deals 2025

    News & Updates

    Fighting osteoporosis before it starts

    Artificial Intelligence

    JetBrains’ new UI is now default across all IDEs in 2024.2 update

    Development

    Mud Soup

    Artificial Intelligence

    Highlights

    CVE-2025-2767 – Arista NG Firewall User-Agent Cross-Site Scripting Remote Code Execution

    April 23, 2025

    CVE ID : CVE-2025-2767

    Published : April 23, 2025, 5:16 p.m. | 1 hour, 42 minutes ago

    Description : Arista NG Firewall User-Agent Cross-Site Scripting Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Arista NG Firewall. Minimal user interaction is required to exploit this vulnerability.

    The specific flaw exists within the processing of the User-Agent HTTP header. The issue results from the lack of proper validation of user-supplied data, which can lead to the injection of an arbitrary script. An attacker can leverage this vulnerability to execute code in the context of root. Was ZDI-CAN-24407.

    Severity: 8.8 | HIGH

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    Microsoft drops a slightly unusual batch of new playable owned gamesforXboxCloud Gaming

    April 30, 2025

    TA558 Hackers Weaponize Images for Wide-Scale Malware Attacks

    April 16, 2024

    Decoding the AI mind: Anthropic researchers peer inside the “black box”

    May 22, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.