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»New String Helpers and ServeCommand Improvements in Laravel 11.14

    New String Helpers and ServeCommand Improvements in Laravel 11.14

    July 3, 2024

    The Laravel team released v11.13 mid-week last week and v11.14 this week. These releases add new string methods like chopStart and chopEnd, Commonmark extension support with Laravel’s String markdown method, a Number::pairs() method, and more.

    String chopStart and chopEnd (v11.13)

    Tim MacDonald contributed two string methods for chopping characters off the beginning or end of a string. The chopStart and chopEnd methods are available using the Str o Stringable` class:

    Str::chopEnd(‘path/to/file.php’, ‘.php’);

    // “path/to/file”

    Str::chopStart(‘https://laravel.com’, [‘https://’, ‘http://’]);

    // laravel.com

    Add Support for Extensions to Str::markdown() and the Stringable Class

    Tony Lea contributed support for passing Commonmark extensions as a third parameter to the the Str::markdown() method:

    $html = Str::markdown($markdown_contents, [], [
    new AttributesExtension(),
    new TaskListExtension(),
    ]);

    In Laravel 11.14, Luke Downing followed up Tony Lea’s contribution by adding support for Commonmark extensions to the Stringable class:

    $html = str(‘# My Heading’)->markdown(
    extensions: [new HeadingPermalinksExtension()]
    );

    Macroable TokenGuard (v11.13)

    @Iman added the Macroable trait in the TokenGuard class to support custom macros on this guard. See Pull Request #51922 for details.

    Add Number::pairs() (v11.13)

    Adam Campbell contributed the Number::pairs() method that ” provides the ability to ‘split’ a number into pairs of min/max values. It’s sort of like sliding, except the method will determine the values for you.”:

    $output = Number::pairs(25, 10);

    // [[1, 10], [11, 20], [21, 25]]

    $output = Number::pairs(25, 10, 0);

    // [[0, 10], [10, 20], [20, 25]]

    $output = Number::pairs(10, 2.5, 0)

    // [[0, 2.5], [2.5, 5.0], [5.0, 7.5], [7.5, 10.0]]

    Mark Sensitive Parameters with PHP’s SensitiveParameter Attribute (v11.14)

    Philip Iezzi contributed updates to Laravel to attempt to mark sensitive parameters with PHP >= 8.2’s SensitiveParameter attribute. This is an excellent reminder to leverage this attribute in application code if you run PHP >= 8.2.

    See Pull Request #51940 for details.

    Improvements to the artisan serve Command

    Seth Phat contributed improvements to the artisan serve command:

    Print out a better request time, for requests that take less than 1 second, ~0s doesn’t seem so helpful at all.
    Show the request’s route instead of “………”

    Requests that take less than 1 second now print the time in milliseconds instead of 0s:

    Release notes

    Laravel 11.13 was released mid-week last week so the following release notes are from both versions. You can see the complete list of new features and updates below and the diff between 11.12.0 and 11.14.0 on GitHub. The following release notes are directly from the changelog:

    v11.14.0

    Adding Pest stubs to publish command by @bartdenhoed in https://github.com/laravel/framework/pull/51933

    [11.x] Added attempts() method to FakeJob by @JamesFreeman in https://github.com/laravel/framework/pull/51951

    [11.x] Run all Workflows on Ubuntu 24.04 by @Jubeki in https://github.com/laravel/framework/pull/51946

    [11.x] Improve PHPDoc for mapSpread Method in Arr Class & Remove Warning from IDE by @lmottasin in https://github.com/laravel/framework/pull/51952

    Bump braces from 3.0.2 to 3.0.3 in /src/Illuminate/Foundation/resources/exceptions/renderer by @dependabot in https://github.com/laravel/framework/pull/51955

    [11.x] Remove unreachable code in AssertableJsonString by @seriquynh in https://github.com/laravel/framework/pull/51943

    [11.x] Fix TestResponseAssert docblock by @seriquynh in https://github.com/laravel/framework/pull/51942

    [11.x] feat: add more specific types and tests for helpers by @calebdw in https://github.com/laravel/framework/pull/51938

    [11.x] Mark sensitive params with SensitiveParameter attribute by @onlime in https://github.com/laravel/framework/pull/51940

    [11.x] Adds support for Markdown extensions to the Stringable class. by @lukeraymonddowning in https://github.com/laravel/framework/pull/51932

    [11.x] Add secret method declaration to ComponentsFactory class by @seriquynh in https://github.com/laravel/framework/pull/51949

    [11.x] Run Workflows on Windows 2022 and with bash instead of powershell by @Jubeki in https://github.com/laravel/framework/pull/51958

    [11.x] Fix duplicated return type PHPDoc by @chu121su12 in https://github.com/laravel/framework/pull/51965

    [11.x] Fix test failure message by @nshiro in https://github.com/laravel/framework/pull/51974

    [11.x] Update tests to ensure mail Message implements the fluent interface pattern by @seriquynh in https://github.com/laravel/framework/pull/51969

    [11.x] Set previous exception on HttpResponseException by @hafezdivandari in https://github.com/laravel/framework/pull/51968

    [11.x] Fix typo in SupportCollectionTest by @zbundy in https://github.com/laravel/framework/pull/51966

    [11.x] Improvements for the ServeCommand (add more loves & elevate DX) by @sethsandaru in https://github.com/laravel/framework/pull/51957

    [11.x] Adds support for using castAsJson with a MariaDb connection by @haniha in https://github.com/laravel/framework/pull/51963

    [11.x] Add support for acting on attributes through container by @innocenzi in https://github.com/laravel/framework/pull/51934

    [11.x] Fix Component::resolveComponentsUsing test by @seriquynh in https://github.com/laravel/framework/pull/51988

    [11.x] Update composer.json files to provide PSR implementations by @seriquynh in https://github.com/laravel/framework/pull/51983

    [11.x] add queued closure type for soft delete events by @hpiaia in https://github.com/laravel/framework/pull/51982

    [11.x] Fix using container nesting to make the same ‘abstract’ in different context by @guiqibusixin in https://github.com/laravel/framework/pull/51989

    [11.x] Fix sync is running touch query twice by @Tofandel in https://github.com/laravel/framework/pull/51984

    v11.13.0

    [11.x] Add Support for Extensions in Str::markdown Method by @tnylea in https://github.com/laravel/framework/pull/51907

    [11.x] Update config:show command by @seriquynh in https://github.com/laravel/framework/pull/51902

    [11.x] Fix console prompt docblock by @seriquynh in https://github.com/laravel/framework/pull/51913

    [11.x] Fix prohibit docblock by @seriquynh in https://github.com/laravel/framework/pull/51916

    [11.x] Mark $queue as nullable by @timacdonald in https://github.com/laravel/framework/pull/51912

    use Macroable trait on TokenGuard by @imanghafoori1 in https://github.com/laravel/framework/pull/51922

    [11.x] Update Command::fail() dockblock and tests by @seriquynh in https://github.com/laravel/framework/pull/51914

    Revert and add test by @jasonmccreary in https://github.com/laravel/framework/pull/51924

    [11.x] Display view creation messages by @nshiro in https://github.com/laravel/framework/pull/51925

    [11.x] Introduce Str::chopStart and Str::chopEnd by @timacdonald in https://github.com/laravel/framework/pull/51910

    feat: Add Number::pairs by @hotmeteor in https://github.com/laravel/framework/pull/51904

    [11.x] Fixes escaping path via Process given commands as array by @crynobone in https://github.com/laravel/framework/pull/51926

    [11.x] Make MultipleInstanceManager driver field customizable by @princejohnsantillan in https://github.com/laravel/framework/pull/51905

    [11.x] Account for long strings on new Laravel error page by @shengslogar in https://github.com/laravel/framework/pull/51880

    The post New String Helpers and ServeCommand Improvements in Laravel 11.14 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 ArticleParasoft’s latest release offers several new automated features for testing Java, C#, .NET apps
    Next Article What’s Now, New, Next in D2C for Manufacturers and Distributors?

    Related Posts

    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 17, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2024-47893 – VMware GPU Firmware Memory Disclosure

    May 17, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Implementing DevSecOps Automation: A Step-by-Step Guide

    Development

    Monitoring and optimizing website performance

    Development

    Eliminating Fixed Learning Rate Schedules in Machine Learning: How Schedule-Free AdamW Optimizer Achieves Superior Accuracy and Efficiency Across Diverse Applications

    Development

    U.S. Navy Punishes Senior Enlisted Leader for Operating Wi-Fi Network On Ship

    Development
    GetResponse

    Highlights

    Development

    Weekly Vulnerability Report: Cyble Urges Fixes in Rockwell Automation, Microsoft and Rejetto

    July 14, 2024

    Cyble Research & Intelligence Labs (CRIL) analyzed 21 vulnerabilities in its weekly vulnerability report for…

    Data & Dragons: Perficient Attends Data + AI Summit

    June 4, 2024

    My TestNG BeforeMethod and AfterMethod annotations are not executing before or after the @Test annotated method

    July 28, 2024

    CodeSOD: A Secure Item

    February 27, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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