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»A New Validation Rule and the Ability to Manually Fail a Command in Laravel 11.8

    A New Validation Rule and the Ability to Manually Fail a Command in Laravel 11.8

    May 22, 2024

    This week, the Laravel team released v11.8, with a new validation rule, the ability to fail a command outside the handle() method, create a view during make:mail, and more.

    Show Events in the model:show Command

    Wendell Adriel contributed an Events section to the model:show command that displays any events defined on the $dispatchesEvents property:

    New contains Validation Rule

    Andrew Brown contributed a contains validation rule that checks to make sure expected values are included in the given array of input:

    return [
    ‘allowed_ips’ => [‘present’, ‘nullable’, ‘array’, ‘contains:’ . $request->ip()],
    ‘allowed_ips.*’ => [‘required’, ‘ip’],
    ];

    In the PR’s description, this example ensures that the user’s IP is in the allowed_ips array. You can also pass multiple parameters, which would require that all parameters are present in the array of data. See Pull Request #51348 for more details.

    Ability to Manually Fail a Command

    Len Woodward contributed the ability to manually fail an Artisan command outside of the handle() method. Like the Queue’s $this->fail() convenience method, commands can now manually fail a job:

    public function handle()
    {
    $this->trigger_failure();
    }

    protected function trigger_failure()
    {
    $this->fail(‘Whoops!’);
    }

    See Pull Request #51435 for implementation details and examples of how this method could be useful over a few other existing approaches to failing early in a command.

    Create a Blade View With make:mail

    Ryan Chandler contributed a –view flag to the make:mail command that will create an empty Blade file and configure the created Mailable to use it by default. It works the same way as the existing –markdown option and saves the manual step of creating and wiring up a Blade mail template.

    php artisan make:mail OrderShipped –view=mail.orders.shipped

    Release notes

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

    v11.8.0

    [11.x] Update PendingRequest.php by @foremtehan in https://github.com/laravel/framework/pull/51338

    Add unshift method to Collection by @timkelty in https://github.com/laravel/framework/pull/51344

    [11.x] Synchronizing cache configuration file with updated laravel v11.0.7 by @dvlpr91 in https://github.com/laravel/framework/pull/51336

    [11.x] Utilize null-safe operator instead of conditional check by @saMahmoudzadeh in https://github.com/laravel/framework/pull/51328

    [11.x] Add the events to be displayed on the model:show command by @WendellAdriel in https://github.com/laravel/framework/pull/51324

    [11.x] fix: remove use of Redis::COMPRESSION_ZSTD_MIN by @calebdw in https://github.com/laravel/framework/pull/51346

    [10.x] Backport: Fix SesV2Transport to use correct EmailTags argument by @Tietew in https://github.com/laravel/framework/pull/51352

    [11.x] feat: use phpredis 6 in ci by @calebdw in https://github.com/laravel/framework/pull/51347

    [11.x] create new “has” validation rule by @browner12 in https://github.com/laravel/framework/pull/51348

    [11.x] Add support for previous apps keys in signed URL verification by @Krisell in https://github.com/laravel/framework/pull/51222

    [11.x] Allow setting exit code in migrate:status –pending by @brecht-vermeersch in https://github.com/laravel/framework/pull/51341

    [11.x] Fix array rule typehint by @erik-perri in https://github.com/laravel/framework/pull/51372

    [11.x] Test Improvements by @crynobone in https://github.com/laravel/framework/pull/51365

    [10.x] Fix PHPDoc typo by @staudenmeir in https://github.com/laravel/framework/pull/51390

    [11.x] Fix return type hint of resolveRouteBindingQuery by @philbates35 in https://github.com/laravel/framework/pull/51392

    [11.x] Allow adding array or string for web and api routes in bootstrap/app.php by @mrthito in https://github.com/laravel/framework/pull/51356

    [ 11.x ] Adds ability to manually fail a command from outside the handle() method by @ProjektGopher in https://github.com/laravel/framework/pull/51435

    [10.x] Fix apa on non ASCII characters by @faissaloux in https://github.com/laravel/framework/pull/51428

    [11.x] Compare lowercased column names in getColumnType by @chady in https://github.com/laravel/framework/pull/51431

    [11.x] Use contracts instead of concrete type for resolveRouteBindingQuery() by @crynobone in https://github.com/laravel/framework/pull/51425

    [11.x] Set the value of $this in macro closures by @simonwelsh in https://github.com/laravel/framework/pull/51401

    [11.x] Add missing roundrobin transport driver config by @u01jmg3 in https://github.com/laravel/framework/pull/51400

    [11.x] Remove unused namespace by @saMahmoudzadeh in https://github.com/laravel/framework/pull/51436

    [11.x] Fixes doc block in Connector.php by @saMahmoudzadeh in https://github.com/laravel/framework/pull/51440

    [10.x] Fixes view engine resolvers leaking memory by @nunomaduro in https://github.com/laravel/framework/pull/51450

    [11.x] Add some tests to SupportStrTest by @saMahmoudzadeh in https://github.com/laravel/framework/pull/51437

    [11.x] Add isCurrentlyOwnedBy function to lock by @gazben in https://github.com/laravel/framework/pull/51393

    [11.x] Collection average/avg optimization by @bert-w in https://github.com/laravel/framework/pull/51512

    [11.x] Introduce MixManifestNotFoundException for handling missing Mix manifests by @xurshudyan in https://github.com/laravel/framework/pull/51502

    [11.x] MailMakeCommand: Add new –view option by @ryangjchandler in https://github.com/laravel/framework/pull/51411

    [11.x] Replace all backed enums with values when building URLs by @stefanvdlugt in https://github.com/laravel/framework/pull/51524

    [10.x] Do not use app() Foundation helper on ViewServiceProvider by @rodrigopedra in https://github.com/laravel/framework/pull/51522

    Fixes explicit route binding with BackedEnum by @crynobone in https://github.com/laravel/framework/pull/51525

    [11.x] Add query method to UrlGenerator contract docblock by @hjanos-bc in https://github.com/laravel/framework/pull/51515

    The post A New Validation Rule and the Ability to Manually Fail a Command in Laravel 11.8 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 

    Hostinger
    Facebook Twitter Reddit Email Copy Link
    Previous ArticleLearn Laravel and Vite : Customizing Laravel’s Vite Plugin
    Next Article New Perficient Research Reveals Mid-Market Priorities for Order Management Selection

    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

    Hostinger

    Continue Reading

    I upgrade my iPhone every year, but iPhone 16 worries me – here’s why

    Development

    Rilasciato PeaZip 10.2: Correzioni e Miglioramenti

    Development

    SnoopGod Linux – Ubuntu-based penetration testing distribution

    Development

    TimeMaster

    Development

    Highlights

    Development

    Exploring Data Mapping as a Search Problem

    May 18, 2024

    Data mapping is a critical process in data management, enabling the integration and transformation of…

    Why Conversational AI Chatbots Are a Game-Changer for Your Business

    August 16, 2024

    Overwatch 2 joins up with Street Fighter 6 in this dream-come-true collaboration

    May 10, 2025

    SpeechVerse: A Multimodal AI Framework that Enables LLMs to Follow Natural Language Instructions for Performing Diverse Speech-Processing Tasks

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

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