<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Er Amit Gupta</title>
    <description>The latest articles on DEV Community by Er Amit Gupta (@eramitgupta).</description>
    <link>https://dev.to/eramitgupta</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2070143%2F38881497-55d8-48e9-a6f2-b4c2d4d7c1e6.jpeg</url>
      <title>DEV Community: Er Amit Gupta</title>
      <link>https://dev.to/eramitgupta</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eramitgupta"/>
    <language>en</language>
    <item>
      <title>🛡️ Say Goodbye to Spam: The Best Laravel Package for Disposable Email Detection</title>
      <dc:creator>Er Amit Gupta</dc:creator>
      <pubDate>Thu, 12 Mar 2026 09:53:27 +0000</pubDate>
      <link>https://dev.to/eramitgupta/say-goodbye-to-spam-the-best-laravel-package-for-disposable-email-detection-29nn</link>
      <guid>https://dev.to/eramitgupta/say-goodbye-to-spam-the-best-laravel-package-for-disposable-email-detection-29nn</guid>
      <description>&lt;p&gt;Building a great product is hard. Dealing with thousands of fake user accounts is even harder. If you’ve ever looked at your user database and seen emails like &lt;code&gt;user@10minutemail.com&lt;/code&gt; or &lt;code&gt;spam@trashmail.org&lt;/code&gt;, you know the frustration.&lt;/p&gt;

&lt;p&gt;Temporary emails ruin your analytics, destroy your email deliverability, and abuse your free trials. That is why I built &lt;strong&gt;Laravel Disposable Email Detection&lt;/strong&gt;—the ultimate shield for your Laravel applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  💎 Why This is the Best Package for the Job
&lt;/h2&gt;

&lt;p&gt;There are many ways to block emails, but this package is designed to be the most comprehensive and developer-friendly tool available.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔥 1. Massive Database: 110,646+ Domains Included
&lt;/h3&gt;

&lt;p&gt;Most validation rules only block a few hundred common domains. This package comes pre-loaded with an industry-leading list of &lt;strong&gt;110,646+ known disposable domains&lt;/strong&gt;. From the moment you run &lt;code&gt;composer require&lt;/code&gt;, your app is protected by one of the largest blacklists on the market.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚡ 2. Built for Performance (Caching)
&lt;/h3&gt;

&lt;p&gt;Checking a list of 110k+ domains could slow down your signup process if done poorly. Our package includes &lt;strong&gt;Smart Caching support&lt;/strong&gt;. Once the list is loaded, lookups happen in milliseconds, ensuring your user experience remains lightning-fast.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔄 3. Auto-Sync: Never Go Out of Date
&lt;/h3&gt;

&lt;p&gt;Spammers create new domains every single day. With a built-in Artisan command, you can automatically sync your local list with remote sources to stay protected against the latest temporary email providers.&lt;/p&gt;

&lt;h3&gt;
  
  
  🛠️ 4. Developer Experience (DX)
&lt;/h3&gt;

&lt;p&gt;Whether you are a fan of clean controllers, custom rules, or Blade templates, we’ve got you covered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Validation:&lt;/strong&gt; Just add &lt;code&gt;disposable_email&lt;/code&gt; to your rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blade:&lt;/strong&gt; Use &lt;code&gt;@disposableEmail&lt;/code&gt; to show/hide UI elements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facade:&lt;/strong&gt; Check emails anywhere in your logic with &lt;code&gt;DisposableEmail::isDisposable()&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 Getting Started in 60 Seconds
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require erag/laravel-disposable-email

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Validate
&lt;/h3&gt;

&lt;p&gt;In your &lt;code&gt;RegisterController&lt;/code&gt; or &lt;code&gt;FormRequest&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|email|disposable_email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it! Your application is now rejecting fake emails and keeping your database clean.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 The Bottom Line
&lt;/h2&gt;

&lt;p&gt;Don't let fake accounts mess up your business growth. Use a tool that is powerful, updated, and easy to use.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;110,646+ domains&lt;/strong&gt; blocked out of the box, this is the only protection your Laravel app needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Star the project on GitHub:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/eramitgupta/laravel-disposable-email" rel="noopener noreferrer"&gt;eramitgupta/laravel-disposable-email&lt;/a&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>security</category>
      <category>showdev</category>
    </item>
    <item>
      <title>🛑 Stop Spam Signups: A Guide to Laravel Disposable Email Detection</title>
      <dc:creator>Er Amit Gupta</dc:creator>
      <pubDate>Thu, 12 Mar 2026 09:38:11 +0000</pubDate>
      <link>https://dev.to/eramitgupta/stop-spam-signups-a-guide-to-laravel-disposable-email-detection-368k</link>
      <guid>https://dev.to/eramitgupta/stop-spam-signups-a-guide-to-laravel-disposable-email-detection-368k</guid>
      <description>&lt;p&gt;Are your Laravel application's analytics being skewed by fake users? Are you tired of "10-minute mail" accounts abusing your free trials?&lt;/p&gt;

&lt;p&gt;If you're a Laravel developer, you know the struggle of maintaining a clean user database. &lt;strong&gt;Disposable (temporary) emails&lt;/strong&gt; are the primary tool for spammers and bots, leading to poor email deliverability and wasted resources.&lt;/p&gt;

&lt;p&gt;Today, we’re looking at a powerful solution: the &lt;strong&gt;Laravel Disposable Email Detection&lt;/strong&gt; package.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧐 Why Should You Block Disposable Emails?
&lt;/h2&gt;

&lt;p&gt;Disposable emails are temporary inboxes that expire after a short period. While they offer privacy for users, they create several headaches for developers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Marketing Waste:&lt;/strong&gt; You can't reach these users with newsletters or updates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trial Abuse:&lt;/strong&gt; Users can infinitely sign up for free trials.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Integrity:&lt;/strong&gt; Your "Total Users" count becomes a meaningless metric.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Domain Reputation:&lt;/strong&gt; Sending emails to expired domains can hurt your SMTP sender score.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 Introducing &lt;code&gt;erag/laravel-disposable-email&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This package is designed to be a "plug-and-play" solution for Laravel 10, 11, and 12. It comes pre-loaded with a massive blacklist and integrates seamlessly into your existing validation logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🔥 &lt;strong&gt;110,000+ Domains:&lt;/strong&gt; Massive built-in database of known temporary providers.&lt;/li&gt;
&lt;li&gt;🧠 &lt;strong&gt;Smart Validation:&lt;/strong&gt; Add a simple rule to your Form Requests.&lt;/li&gt;
&lt;li&gt;🌐 &lt;strong&gt;Auto-Sync:&lt;/strong&gt; Keep your list updated with remote sources automatically.&lt;/li&gt;
&lt;li&gt;⚡ &lt;strong&gt;Zero-Config:&lt;/strong&gt; Works out of the box but remains fully customizable.&lt;/li&gt;
&lt;li&gt;🧩 &lt;strong&gt;Blade Support:&lt;/strong&gt; Includes a custom directive for frontend logic.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠 Quick Start Guide
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Installation
&lt;/h3&gt;

&lt;p&gt;Install the package via Composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require erag/laravel-disposable-email

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Setup
&lt;/h3&gt;

&lt;p&gt;Publish the configuration file to customize your blacklist or caching settings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:install-disposable-email

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates &lt;code&gt;config/disposable-email.php&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  💻 How to Use It
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Validation in Controllers
&lt;/h3&gt;

&lt;p&gt;The easiest way to use this package is within your validation array. Just add the &lt;code&gt;disposable_email&lt;/code&gt; rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|email|disposable_email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Runtime Checks
&lt;/h3&gt;

&lt;p&gt;Need to check an email manually in a Job or Service class? Use the Facade:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;DisposableEmail&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DisposableEmail&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;isDisposable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'test@tempmail.com'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Take action against the spammer&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Blade Directive
&lt;/h3&gt;

&lt;p&gt;You can even use it directly in your views to show or hide content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@disposableEmail('user@trashmail.com')
    &amp;lt;p class="text-red-500"&amp;gt;Please provide a permanent email address.&amp;lt;/p&amp;gt;
@enddisposableEmail

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔄 Keeping the List Fresh
&lt;/h2&gt;

&lt;p&gt;Spammers are constantly creating new domains. This package makes it easy to stay ahead. You can sync the latest domain list with a single command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:sync-disposable-email-list

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can even add your own custom domains by creating a &lt;code&gt;.txt&lt;/code&gt; file in your &lt;code&gt;storage&lt;/code&gt; folder—no coding required!&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Conclusion
&lt;/h2&gt;

&lt;p&gt;A clean database is a healthy database. By integrating &lt;strong&gt;Laravel Disposable Email Detection&lt;/strong&gt;, you ensure that your community is built of real people with real mailboxes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ready to clean up your app?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check out the &lt;a href="https://github.com/eramitgupta/laravel-disposable-email" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt; and give it a star! ⭐&lt;/p&gt;

</description>
      <category>spamprevention</category>
      <category>anonymous</category>
      <category>spamemail</category>
      <category>email</category>
    </item>
    <item>
      <title>🥊 The Ultimate Laravel + Inertia Localization Showdown: Why laravel-lang-sync-inertia Beats the Giants</title>
      <dc:creator>Er Amit Gupta</dc:creator>
      <pubDate>Tue, 10 Mar 2026 12:13:39 +0000</pubDate>
      <link>https://dev.to/eramitgupta/the-ultimate-laravel-inertia-localization-showdown-why-laravel-lang-sync-inertia-beats-the-2f9j</link>
      <guid>https://dev.to/eramitgupta/the-ultimate-laravel-inertia-localization-showdown-why-laravel-lang-sync-inertia-beats-the-2f9j</guid>
      <description>&lt;p&gt;If you are building a multilingual application with Laravel and Inertia.js, you need a way to share your backend PHP translations with your JavaScript frontend.&lt;/p&gt;

&lt;p&gt;For years, developers have defaulted to the "industry standard" packages. But as Inertia.js has evolved, these legacy giants are starting to show their age. They are often bloated, framework-locked, or require frustrating build-step configurations.&lt;/p&gt;

&lt;p&gt;Let’s put the most popular localization packages head-to-head against a powerful newcomer—&lt;strong&gt;&lt;a href="https://github.com/eramitgupta/laravel-lang-sync-inertia" rel="noopener noreferrer"&gt;Laravel Lang Sync Inertia&lt;/a&gt;&lt;/strong&gt;—and see why it’s the ultimate choice for your next project.&lt;/p&gt;




&lt;h2&gt;
  
  
  🏗️ The Heavyweights: &lt;code&gt;vue-i18n&lt;/code&gt; &amp;amp; &lt;code&gt;react-i18next&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;These are the default, massive JavaScript internationalization libraries.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How they work:&lt;/strong&gt; You have to manually export your Laravel translations to JSON, import them into your JS bundle, and set up a complex configuration file in your frontend.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Problem:&lt;/strong&gt; &lt;strong&gt;The Disconnect.&lt;/strong&gt; They don't know Laravel exists. You are forced to write custom Artisan commands or build scripts just to keep your backend &lt;code&gt;.php&lt;/code&gt; files and frontend &lt;code&gt;.json&lt;/code&gt; files in sync. Plus, importing massive JSON dictionaries directly into your JS bundle drastically increases your frontend load time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  👑 The Popular Go-To: &lt;code&gt;laravel-vue-i18n&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This is currently one of the most popular packages for Laravel + Vue developers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How it works:&lt;/strong&gt; It uses a Vite plugin to automatically parse your Laravel translation files and inject them into your Vue app.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Problem:&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Framework Locked:&lt;/strong&gt; As the name implies, it’s for Vue. If you are using React with Inertia, you are out of luck.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Global Loading:&lt;/strong&gt; It typically loads your &lt;em&gt;entire&lt;/em&gt; language directory into the frontend. If your app has thousands of translation keys, your user is downloading megabytes of text they don't even need for the current page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vite Plugin Complexity:&lt;/strong&gt; Relying on Vite plugins can sometimes cause caching issues during development or complex CI/CD pipeline setups.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 The Smart Alternative: &lt;code&gt;laravel-lang-sync-inertia&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;If you are using Inertia.js, you don't need heavy Vite plugins or manual JSON sync scripts. You need a package that uses Inertia's native data-sharing capabilities intelligently.&lt;/p&gt;

&lt;p&gt;Here is why &lt;strong&gt;&lt;a href="https://github.com/eramitgupta/laravel-lang-sync-inertia" rel="noopener noreferrer"&gt;Laravel Lang Sync Inertia&lt;/a&gt;&lt;/strong&gt; is the superior package for this stack:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Granular, Page-by-Page Loading (Zero Bloat)
&lt;/h3&gt;

&lt;p&gt;Instead of forcing the frontend to download your entire translation dictionary, you load &lt;strong&gt;only what is necessary for the current page&lt;/strong&gt; right from your Laravel Controller.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;checkout&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Only sends the checkout and payment translations to the frontend!&lt;/span&gt;
    &lt;span class="nf"&gt;syncLangFiles&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'checkout'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'payment'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Inertia&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Checkout'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The Result:&lt;/strong&gt; Lightning-fast page loads. Your Inertia payload stays incredibly small.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Built for Both Vue AND React
&lt;/h3&gt;

&lt;p&gt;Why lock yourself into one framework? Whether your Inertia app uses Vue 3 or React, this package provides native-feeling companion hooks (&lt;code&gt;vueLang()&lt;/code&gt; and &lt;code&gt;reactLang()&lt;/code&gt;) that give you the exact &lt;code&gt;trans()&lt;/code&gt; and &lt;code&gt;__()&lt;/code&gt; helpers you are used to in Laravel Blade.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Pure Runtime Magic (No Vite Plugins Required)
&lt;/h3&gt;

&lt;p&gt;Because it passes data securely through Inertia’s native props, you don't have to mess with your &lt;code&gt;vite.config.js&lt;/code&gt;. It works out of the box. No background watchers, no complex build steps.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Need Static JSON? It Does That Too.
&lt;/h3&gt;

&lt;p&gt;If you ever decide you &lt;em&gt;want&lt;/em&gt; to use a heavy library like &lt;code&gt;vue-i18n&lt;/code&gt;, this package includes a blazing-fast Artisan command (&lt;code&gt;php artisan erag:generate-lang&lt;/code&gt;) that flawlessly compiles your PHP arrays into perfectly mapped JSON files.&lt;/p&gt;




&lt;h2&gt;
  
  
  📊 The Head-to-Head Comparison
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;laravel-lang-sync-inertia&lt;/code&gt; 🏆&lt;/th&gt;
&lt;th&gt;&lt;code&gt;laravel-vue-i18n&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Standard &lt;code&gt;vue-i18n&lt;/code&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Framework Support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Vue &amp;amp; React&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Vue Only&lt;/td&gt;
&lt;td&gt;Vue Only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Prevents Payload Bloat&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes (Granular Controller Sync)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No (Loads all via Vite)&lt;/td&gt;
&lt;td&gt;No (Manual imports)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Requires Vite Plugins?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;No (Pure Inertia)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Laravel &lt;code&gt;trans()&lt;/code&gt; syntax&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No (Uses &lt;code&gt;$t&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Exports to Static JSON&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes (Built-in Command)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🎯 Final Verdict
&lt;/h2&gt;

&lt;p&gt;If you are building a pure SPA and want to manage translations entirely in JavaScript, the standard &lt;code&gt;vue-i18n&lt;/code&gt; is fine.&lt;/p&gt;

&lt;p&gt;If you want your translations injected via Vite and only use Vue, &lt;code&gt;laravel-vue-i18n&lt;/code&gt; is a solid choice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But if you want the absolute best performance, zero build-step configuration, multi-framework support, and the ability to load translations granularly on a per-page basis, &lt;a href="https://github.com/eramitgupta/laravel-lang-sync-inertia" rel="noopener noreferrer"&gt;Laravel Lang Sync Inertia&lt;/a&gt; is the undisputed winner.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stop sending massive translation files to your frontend. Upgrade to smart syncing today.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Get it on Packagist:&lt;/strong&gt; &lt;code&gt;composer require erag/laravel-lang-sync-inertia&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;NPM Companion:&lt;/strong&gt; &lt;code&gt;npm install @erag/lang-sync-inertia&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;⭐ &lt;strong&gt;Star the Repo:&lt;/strong&gt; &lt;a href="https://github.com/eramitgupta/laravel-lang-sync-inertia" rel="noopener noreferrer"&gt;GitHub - eramitgupta/laravel-lang-sync-inertia&lt;/a&gt;&lt;/p&gt;

</description>
      <category>i18n</category>
      <category>react</category>
      <category>vue</category>
      <category>inertiajs</category>
    </item>
    <item>
      <title>🔁 Automatically Map Request Keys with Laravel Case Mapper Request</title>
      <dc:creator>Er Amit Gupta</dc:creator>
      <pubDate>Tue, 29 Jul 2025 09:12:27 +0000</pubDate>
      <link>https://dev.to/eramitgupta/automatically-map-request-keys-with-laravel-case-mapper-request-2026</link>
      <guid>https://dev.to/eramitgupta/automatically-map-request-keys-with-laravel-case-mapper-request-2026</guid>
      <description>&lt;p&gt;Handling inconsistent key naming from various frontends can be a real headache. Whether it’s camelCase, snake_case, StudlyCase, or even UPPERCASE — mismatched key formats often lead to unnecessary data transformation or validation errors.&lt;/p&gt;

&lt;p&gt;Laravel developers, meet your new best friend:&lt;br&gt;
&lt;strong&gt;&lt;code&gt;Laravel Case Mapper Request&lt;/code&gt;&lt;/strong&gt; — a zero-configuration Laravel package that &lt;strong&gt;automatically maps incoming request keys&lt;/strong&gt; to match your backend validation rules using PHP 8+ Attributes.&lt;/p&gt;


&lt;h2&gt;
  
  
  🎯 Why You Need This
&lt;/h2&gt;

&lt;p&gt;Modern APIs interact with various clients — React, Vue, Angular, mobile apps — all of which may send form data in different key formats. But your Laravel backend expects consistent keys, especially when using &lt;code&gt;FormRequest&lt;/code&gt; validation.&lt;/p&gt;

&lt;p&gt;Instead of writing custom logic to reformat input keys every time, let &lt;strong&gt;Laravel Case Mapper Request&lt;/strong&gt; handle it &lt;strong&gt;automatically&lt;/strong&gt; using clean, expressive attributes.&lt;/p&gt;


&lt;h2&gt;
  
  
  ✨ Key Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;✅ Attribute-based key mapping using &lt;code&gt;#[MapName(...)]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;🔄 Supports multiple naming conventions: &lt;code&gt;snake_case&lt;/code&gt;, &lt;code&gt;camelCase&lt;/code&gt;, &lt;code&gt;StudlyCase&lt;/code&gt;, &lt;code&gt;UPPERCASE&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;🔧 Extensible with your own custom mappers&lt;/li&gt;
&lt;li&gt;🎨 Works with any frontend (React, Vue, etc.)&lt;/li&gt;
&lt;li&gt;📦 Zero configuration, zero hacks&lt;/li&gt;
&lt;li&gt;🧩 Seamlessly integrates with Laravel's &lt;code&gt;FormRequest&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Works with Laravel 10, 11, and 12 — no core modification required.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  ⚙️ Installation
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require erag/laravel-case-mapper-request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;That’s it. No config file, no publishing needed. You’re ready to go.&lt;/p&gt;


&lt;h2&gt;
  
  
  🧩 How It Works — In 3 Simple Steps
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. Create a Form Request
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan make:request ContactRequest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  2. Add the Mapper Attribute &amp;amp; Trait
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;LaravelCaseMapperRequest\Attributes\MapName&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;LaravelCaseMapperRequest\Traits\HasKeyTransformers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;LaravelCaseMapperRequest\Mappers\SnakeCaseMapper&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="na"&gt;#[MapName(SnakeCaseMapper::class)]&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ContactRequest&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;FormRequest&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;HasKeyTransformers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;authorize&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;array&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s1"&gt;'first_name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|string'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'last_name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|string'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'email_address'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  3. Use the Form Request in a Controller
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ContactController&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Controller&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;ContactRequest&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$validated&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validated&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;// Example: Contact::create($validated);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
            &lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Submitted successfully!'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'data'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$validated&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ⚡ Frontend Example (Vue + Inertia)
&lt;/h2&gt;

&lt;p&gt;Let’s say your frontend sends data in &lt;code&gt;camelCase&lt;/code&gt; format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt; &lt;span class="na"&gt;setup&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useForm&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@inertiajs/vue3&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;form&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useForm&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;emailAddress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;submit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/form/snake&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📥 Incoming Request:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"firstName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Amit"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"lastName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Gupta"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"emailAddress"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"amit@example.com"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Automatically Mapped To:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="s1"&gt;'first_name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Amit'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'last_name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Gupta'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'email_address'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'amit@example.com'&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔧 Built-in Case Mappers
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mapper&lt;/th&gt;
&lt;th&gt;Input Format&lt;/th&gt;
&lt;th&gt;Mapped Output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SnakeCaseMapper&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;firstName&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;first_name&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CamelCaseMapper&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;first_name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;firstName&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;StudlyCaseMapper&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;FirstName&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;first_name&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UpperCaseMapper&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;FIRSTNAME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;firstname&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🛠️ Create Your Own Mapper
&lt;/h2&gt;

&lt;p&gt;Need a custom casing logic like &lt;code&gt;kebab-case&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;Just implement the &lt;code&gt;CaseMapperContract&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;LaravelCaseMapperRequest\Contracts\CaseMapperContract&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;KebabCaseMapper&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;CaseMapperContract&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;array&lt;/span&gt; &lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;array&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;mapWithKeys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Str&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;kebab&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$value&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;toArray&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then use it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="na"&gt;#[MapName(KebabCaseMapper::class)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ✅ Who Should Use This?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Laravel backend developers dealing with multiple frontend teams&lt;/li&gt;
&lt;li&gt;Projects with mixed casing inputs (camelCase, snake_case, etc.)&lt;/li&gt;
&lt;li&gt;APIs that require flexible, clean, and consistent request data&lt;/li&gt;
&lt;li&gt;Teams looking to eliminate boilerplate request formatting logic&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧠 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Laravel Case Mapper Request&lt;/strong&gt; is a must-have for teams building robust APIs or multi-client Laravel apps. It simplifies input handling, reduces validation bugs, and keeps your code expressive and DRY — all using modern PHP 8+ attribute syntax.&lt;/p&gt;

&lt;p&gt;No config. No hacks. Just clean input mapping.&lt;/p&gt;




&lt;h2&gt;
  
  
  📦 Install Now
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require erag/laravel-case-mapper-request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📘 &lt;strong&gt;GitHub Repo&lt;/strong&gt; → &lt;a href="https://github.com/eramitgupta/laravel-case-mapper-request" rel="noopener noreferrer"&gt;eramitgupta/laravel-case-mapper-request&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Connect with the Author
&lt;/h2&gt;

&lt;p&gt;Made with ❤️ by &lt;strong&gt;&lt;a href="https://github.com/eramitgupta" rel="noopener noreferrer"&gt;Amit Gupta&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🐦 &lt;a href="https://twitter.com/_eramitgupta" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;💼 &lt;a href="https://linkedin.com/in/eramitgupta" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⭐ Found it useful?
&lt;/h2&gt;

&lt;p&gt;Give it a ⭐ on GitHub and help others discover it too!&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>vue</category>
      <category>react</category>
    </item>
    <item>
      <title>Streamline Your Laravel API with Automatic Request Key Mapping</title>
      <dc:creator>Er Amit Gupta</dc:creator>
      <pubDate>Wed, 23 Jul 2025 04:37:26 +0000</pubDate>
      <link>https://dev.to/eramitgupta/streamline-your-laravel-api-with-automatic-request-key-mapping-11hh</link>
      <guid>https://dev.to/eramitgupta/streamline-your-laravel-api-with-automatic-request-key-mapping-11hh</guid>
      <description>&lt;p&gt;Building modern web applications often means dealing with the &lt;strong&gt;naming convention mismatch&lt;/strong&gt; between frontend and backend systems. Your React or Vue frontend might use camelCase (&lt;code&gt;firstName&lt;/code&gt;, &lt;code&gt;emailAddress&lt;/code&gt;), while your Laravel backend expects snake_case (&lt;code&gt;first_name&lt;/code&gt;, &lt;code&gt;email_address&lt;/code&gt;). This disconnect creates friction in development and requires manual transformation logic that clutters your codebase.&lt;/p&gt;

&lt;p&gt;Enter the &lt;strong&gt;Laravel Case Mapper Request&lt;/strong&gt; package—a elegant solution that automatically transforms incoming request keys to match your validation expectations using PHP 8+ attributes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Frontend-Backend Naming Convention Conflicts
&lt;/h2&gt;

&lt;p&gt;Modern frontend frameworks like React and Vue.js typically follow camelCase naming conventions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Doe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="na"&gt;emailAddress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;john@example.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;phoneNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;123-456-7890&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, Laravel and PHP generally follow snake_case conventions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$rules&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="s1"&gt;'first_name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|string'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'last_name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|string'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="s1"&gt;'email_address'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'phone_number'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|string'&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Traditionally, developers solve this by manually transforming keys in controllers or middleware, leading to repetitive code and potential inconsistencies across the application.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Attribute-Based Request Mapping
&lt;/h2&gt;

&lt;p&gt;The Laravel Case Mapper Request package introduces a &lt;strong&gt;clean, declarative approach&lt;/strong&gt; using PHP 8+ attributes. Simply annotate your FormRequest classes with the desired mapping strategy, and the package handles the transformation automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero Configuration&lt;/strong&gt;: No config files to publish or core modifications required&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Attribute-Based Syntax&lt;/strong&gt;: Clean, declarative mapping using &lt;code&gt;#[MapName(...)]&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiple Case Formats&lt;/strong&gt;: Support for camelCase, snake_case, StudlyCase, and UPPERCASE&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seamless Integration&lt;/strong&gt;: Works directly with Laravel FormRequest validation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extensible&lt;/strong&gt;: Create custom mappers for specialized transformation logic&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Framework Agnostic&lt;/strong&gt;: Compatible with any frontend framework (React, Vue, Angular, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Supported Case Transformations
&lt;/h2&gt;

&lt;p&gt;The package includes four built-in mappers to handle common naming convention scenarios:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mapper Class&lt;/th&gt;
&lt;th&gt;Input Format&lt;/th&gt;
&lt;th&gt;Output Format&lt;/th&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SnakeCaseMapper&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;firstName&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;first_name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Frontend camelCase → Backend snake_case&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CamelCaseMapper&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;first_name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;firstName&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Backend snake_case → Frontend camelCase&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;StudlyCaseMapper&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;FirstName&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;first_name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;PascalCase → snake_case&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UpperCaseMapper&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;FIRSTNAME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;firstname&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;UPPERCASE → lowercase&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Implementation Guide
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;Install the package via Composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require erag/laravel-case-mapper-request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No additional configuration or publishing steps required—the package is ready to use immediately.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Create a Form Request
&lt;/h3&gt;

&lt;p&gt;Generate a new FormRequest using Laravel's artisan command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan make:request ContactRequest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Configure the Mapping
&lt;/h3&gt;

&lt;p&gt;Add the required trait and attribute to your FormRequest class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt; &lt;span class="s1"&gt;'required|string|max:255'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'last_name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|string|max:255'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'email_address'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'phone_number'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'nullable|string'&lt;/span&gt;
        &lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;#[MapName(SnakeCaseMapper::class)]&lt;/code&gt; attribute tells the package to transform incoming camelCase keys to snake_case before validation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Use in Controller
&lt;/h3&gt;

&lt;p&gt;Your controller remains clean and focused on business logic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nf"&gt;validated&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="nv"&gt;$contact&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Contact&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$validated&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
            &lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Contact created successfully!'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'data'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$contact&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Frontend Implementation
&lt;/h3&gt;

&lt;p&gt;Your frontend can maintain its preferred naming convention. Here's a Vue.js example using Inertia:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;











      Submit Contact





import { useForm } from '@inertiajs/vue3'

const form = useForm({
  firstName: '',
  lastName: '',
  emailAddress: '',
  phoneNumber: ''
})

function submitForm() {
  form.post('/contacts')
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Magic: Automatic Transformation
&lt;/h2&gt;

&lt;p&gt;When the form is submitted, the package automatically transforms the request data:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Frontend sends:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"firstName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"John"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"lastName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Doe"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; 
  &lt;/span&gt;&lt;span class="nl"&gt;"emailAddress"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"john@example.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"phoneNumber"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"123-456-7890"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Backend receives for validation:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="s1"&gt;'first_name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'John'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'last_name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Doe'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'email_address'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'john@example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="s1"&gt;'phone_number'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'123-456-7890'&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The transformation happens &lt;strong&gt;before validation&lt;/strong&gt;, ensuring your validation rules work seamlessly with the expected key names.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Custom Mappers
&lt;/h2&gt;

&lt;p&gt;For specialized transformation requirements, you can create custom mappers by implementing the &lt;code&gt;CaseMapperContract&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nf"&gt;mapWithKeys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="nc"&gt;Str&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;kebab&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$value&lt;/span&gt;
            &lt;span class="p"&gt;])&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;toArray&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then apply it to any FormRequest:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="na"&gt;#[MapName(KebabCaseMapper::class)]&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ProductRequest&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;FormRequest&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;HasKeyTransformers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Implementation...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Advanced Use Cases
&lt;/h2&gt;

&lt;h3&gt;
  
  
  API Versioning
&lt;/h3&gt;

&lt;p&gt;Different API versions might require different naming conventions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// v1 API - snake_case&lt;/span&gt;
&lt;span class="na"&gt;#[MapName(SnakeCaseMapper::class)]&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;V1UserRequest&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;FormRequest&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// v2 API - camelCase  &lt;/span&gt;
&lt;span class="na"&gt;#[MapName(CamelCaseMapper::class)]&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;V2UserRequest&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;FormRequest&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Multi-Platform Support
&lt;/h3&gt;

&lt;p&gt;Support different client platforms with varying conventions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Mobile app requests (camelCase)&lt;/span&gt;
&lt;span class="na"&gt;#[MapName(SnakeCaseMapper::class)]&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MobileUserRequest&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;FormRequest&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Legacy system integration (UPPERCASE)&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;MapName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;UpperCaseMapper&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;  
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LegacyUserRequest&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;FormRequest&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Performance Considerations
&lt;/h2&gt;

&lt;p&gt;The package performs key transformation during the request lifecycle, specifically before validation. The overhead is minimal since it's a simple array key mapping operation using Laravel's efficient Collection methods.&lt;/p&gt;

&lt;p&gt;For high-traffic applications, the transformation cost is negligible compared to database operations and other request processing overhead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits for Development Teams
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Consistency Across Projects&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Standardize how different naming conventions are handled across your Laravel applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Reduced Boilerplate Code&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Eliminate repetitive key transformation logic in controllers and services.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Better Developer Experience&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Frontend developers can use their preferred naming conventions without backend constraints.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Maintainable Codebase&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Centralized transformation logic makes updates and changes easier to manage.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Type Safety&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Works seamlessly with Laravel's validation system and IDE autocompletion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Choose the Right Mapper
&lt;/h3&gt;

&lt;p&gt;Select mappers based on your primary frontend framework:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;React/Vue.js&lt;/strong&gt;: Use &lt;code&gt;SnakeCaseMapper&lt;/code&gt; to convert camelCase to snake_case&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Legacy systems&lt;/strong&gt;: Use &lt;code&gt;UpperCaseMapper&lt;/code&gt; for UPPERCASE transformations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mixed environments&lt;/strong&gt;: Create custom mappers for specific transformation rules&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Consistent Application
&lt;/h3&gt;

&lt;p&gt;Apply the same mapping strategy across related FormRequests to maintain consistency in your API.&lt;/p&gt;

&lt;h3&gt;
  
  
  Documentation
&lt;/h3&gt;

&lt;p&gt;Document your chosen naming conventions in API documentation to help frontend developers understand the expected formats.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The Laravel Case Mapper Request package solves a common pain point in modern web development by providing a clean, attribute-based solution for handling naming convention mismatches between frontend and backend systems.&lt;/p&gt;

&lt;p&gt;By eliminating the need for manual key transformation and providing a declarative syntax, it helps teams maintain cleaner codebases while supporting flexible naming conventions across different platforms and frameworks.&lt;/p&gt;

&lt;p&gt;Whether you're building a new Laravel API or refactoring an existing one, this package offers a &lt;strong&gt;zero-configuration solution&lt;/strong&gt; that integrates seamlessly with Laravel's existing FormRequest validation system.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>vue</category>
      <category>react</category>
    </item>
    <item>
      <title>🚫 Stop Disposable Emails in Laravel: The Ultimate `laravel-disposable-email` Guide</title>
      <dc:creator>Er Amit Gupta</dc:creator>
      <pubDate>Fri, 11 Jul 2025 07:02:47 +0000</pubDate>
      <link>https://dev.to/eramitgupta/stop-disposable-emails-in-laravel-the-ultimate-laravel-disposable-email-guide-141p</link>
      <guid>https://dev.to/eramitgupta/stop-disposable-emails-in-laravel-the-ultimate-laravel-disposable-email-guide-141p</guid>
      <description>&lt;p&gt;Are you tired of spam or temporary emails like &lt;code&gt;tempmail.com&lt;/code&gt;, &lt;code&gt;10minutemail.com&lt;/code&gt;, or &lt;code&gt;mailinator.com&lt;/code&gt; messing up your Laravel application?&lt;/p&gt;

&lt;p&gt;Let me introduce you to &lt;strong&gt;&lt;a href="https://github.com/eramitgupta/laravel-disposable-email" rel="noopener noreferrer"&gt;laravel-disposable-email&lt;/a&gt;&lt;/strong&gt; – a lightweight yet powerful Laravel package that detects and blocks disposable email addresses using validation rules, runtime checks, Blade directives, and more.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;✅ Already includes &lt;strong&gt;over 106,000+ disposable email domains&lt;/strong&gt; – updated regularly!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🔍 Why Block Disposable Emails in Laravel?
&lt;/h2&gt;

&lt;p&gt;Disposable or temporary email services are used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bypass email verification&lt;/li&gt;
&lt;li&gt;Spam your app with fake signups&lt;/li&gt;
&lt;li&gt;Skew analytics and user data&lt;/li&gt;
&lt;li&gt;Abuse trial-based services or coupons&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By using this package, you can &lt;strong&gt;keep your user base clean and your analytics real&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ Key Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;✅ 106,000+ disposable email domains included&lt;/li&gt;
&lt;li&gt;🧠 Smart validation rule (&lt;code&gt;new DisposableEmailRule()&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;🧩 Blade directive: &lt;code&gt;@disposableEmail(...)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;💡 Runtime check using helper or facade&lt;/li&gt;
&lt;li&gt;⚡ Optional cache support for high-performance&lt;/li&gt;
&lt;li&gt;🔁 Auto-sync with open-source blocklists&lt;/li&gt;
&lt;li&gt;🧠 Add your own custom domains without coding&lt;/li&gt;
&lt;li&gt;🛠 Laravel 10, 11, and 12 support&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 Installation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require erag/laravel-disposable-email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then publish the config and domain file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:install-disposable-email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ✅ How to Use in Laravel
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔒 1. Validate in Form Requests
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Object Rule:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;EragLaravelDisposableEmail\Rules\DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'required'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  String Rule:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|email|disposable_email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ⚡ 2. Runtime Check
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;DisposableEmail&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DisposableEmail&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;isDisposable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'test@10minutemail.com'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Block or log user&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🧩 3. Blade Directive
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@disposableEmail('fake@mailinator.com')
    &amp;lt;p class="text-red-600"&amp;gt;Disposable email detected!&amp;lt;/p&amp;gt;
@else
    &amp;lt;p class="text-green-600"&amp;gt;Looks good!&amp;lt;/p&amp;gt;
@enddisposableEmail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔄 Sync Disposable Domains
&lt;/h2&gt;

&lt;p&gt;This package fetches updated disposable domain lists from trusted open-source sources like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/disposable/disposable-email-domains" rel="noopener noreferrer"&gt;https://github.com/disposable/disposable-email-domains&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/7c/fakefilter" rel="noopener noreferrer"&gt;https://github.com/7c/fakefilter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Update list manually with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:sync-disposable-email-list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🧠 Add Your Own Domains (Custom Blacklist)
&lt;/h2&gt;

&lt;p&gt;Just add domain names (one per line) to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;storage/app/blacklist_file/disposable_domains.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fakemail.org
trashbox.io
noemail.net
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No commands needed — the package automatically reads them.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚡ Enable Caching (Recommended for Performance)
&lt;/h2&gt;

&lt;p&gt;In &lt;code&gt;config/disposable-email.php&lt;/code&gt;, set:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="s1"&gt;'cache_enabled'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="s1"&gt;'cache_ttl'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// minutes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clear cache if needed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan cache:clear
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  💻 Compatible With Laravel 10, 11, 12
&lt;/h2&gt;

&lt;p&gt;Whether you’re using Laravel 10, 11, or 12, this package works flawlessly.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 GitHub &amp;amp; Packagist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🔗 GitHub: &lt;a href="https://github.com/eramitgupta/laravel-disposable-email" rel="noopener noreferrer"&gt;eramitgupta/laravel-disposable-email&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📦 Packagist: &lt;a href="https://packagist.org/packages/erag/laravel-disposable-email" rel="noopener noreferrer"&gt;erag/laravel-disposable-email&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🙌 Conclusion
&lt;/h2&gt;

&lt;p&gt;If you're serious about &lt;strong&gt;stopping fake signups&lt;/strong&gt;, &lt;strong&gt;improving user data quality&lt;/strong&gt;, and &lt;strong&gt;securing your Laravel app&lt;/strong&gt;, &lt;code&gt;laravel-disposable-email&lt;/code&gt; is a must-have.&lt;/p&gt;

&lt;p&gt;It’s simple, powerful, and ready to use in minutes. Install today and protect your application like a pro.&lt;/p&gt;

&lt;h2&gt;
  
  
  📢 Share this with your Laravel community
&lt;/h2&gt;

&lt;p&gt;If you found this useful, give it a ⭐ on GitHub and share the package with your dev team or community. Every spam-free app makes the web better!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>🌐 Easy Laravel Translation Sync for Inertia (Vue.js / React)</title>
      <dc:creator>Er Amit Gupta</dc:creator>
      <pubDate>Mon, 19 May 2025 07:43:41 +0000</pubDate>
      <link>https://dev.to/eramitgupta/easy-laravel-translate-sync-inertia-vuejs-react-402g</link>
      <guid>https://dev.to/eramitgupta/easy-laravel-translate-sync-inertia-vuejs-react-402g</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffj1to0slahzpsk8wkcvk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffj1to0slahzpsk8wkcvk.png" alt="Untitled design" width="800" height="254"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel Lang Sync Inertia&lt;/strong&gt; helps you add different languages to your Laravel app with Vue or React. It makes translations easy! &lt;/p&gt;

&lt;h2&gt;
  
  
  ✨ Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;⚙️ Inertia.js integration with automatic sharing&lt;/li&gt;
&lt;li&gt;📂 Load single or multiple language files&lt;/li&gt;
&lt;li&gt;🔄 Dynamic replacement support in translations&lt;/li&gt;
&lt;li&gt;🧩 Supports both Vue.js and React&lt;/li&gt;
&lt;li&gt;🧵 Built-in middleware for automatic sharing&lt;/li&gt;
&lt;li&gt;🛠️ Helper functions like &lt;code&gt;trans()&lt;/code&gt; and &lt;code&gt;__()&lt;/code&gt; for frontend usage&lt;/li&gt;
&lt;li&gt;🌍 Automatically switches language folder based on current Laravel locale&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📦 Installation
&lt;/h2&gt;

&lt;p&gt;To install the package, run the following command via Composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require erag/laravel-lang-sync-inertia
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🛠️ Publish Configuration &amp;amp; Composables
&lt;/h2&gt;

&lt;p&gt;To publish the configuration and composables, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:install-lang
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will publish:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;code&gt;config/inertia-lang.php&lt;/code&gt; — for customizing the language path&lt;/li&gt;
&lt;li&gt;✅ &lt;code&gt;resources/js/composables/useLang.ts&lt;/code&gt; — for Vue (if selected)&lt;/li&gt;
&lt;li&gt;✅ &lt;code&gt;resources/js/hooks/useLang.tsx&lt;/code&gt; — for React (if selected)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;During installation, you'll be prompted to choose either &lt;strong&gt;Vue&lt;/strong&gt; or &lt;strong&gt;React&lt;/strong&gt; for your frontend framework.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 Usage Guide: &lt;code&gt;syncLangFiles()&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;syncLangFiles()&lt;/code&gt; function is a Laravel helper provided by this package. Use it inside your &lt;strong&gt;controller methods&lt;/strong&gt; to load translation files and automatically &lt;strong&gt;share them with your Vue or React frontend via Inertia.js&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;✅ Think of &lt;code&gt;syncLangFiles()&lt;/code&gt; as a bridge between Laravel’s backend translations and your Inertia-powered frontend.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  🧪 How It Works
&lt;/h3&gt;

&lt;p&gt;Suppose you have the following language file:&lt;/p&gt;

&lt;p&gt;📁 &lt;strong&gt;&lt;code&gt;resources/lang/en/auth.php&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'welcome'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Welcome, {name}!'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'greeting'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Hello!'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you want to show &lt;code&gt;auth.welcome&lt;/code&gt; and &lt;code&gt;auth.greeting&lt;/code&gt; on the frontend using Vue or React.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔁 Step-by-Step Example
&lt;/h3&gt;

&lt;h4&gt;
  
  
  🔹 1. Load Translations in Controller
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Inertia\Inertia&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;login&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Load the auth.php language file&lt;/span&gt;
    &lt;span class="nf"&gt;syncLangFiles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'auth'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Inertia&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Login'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧠 This loads the file &lt;code&gt;resources/lang/en/auth.php&lt;/code&gt; based on the current Laravel locale and shares its content with Inertia.&lt;/p&gt;




&lt;h3&gt;
  
  
  💡 Frontend Usage
&lt;/h3&gt;

&lt;h4&gt;
  
  
  ✅ Vue Example
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{{&lt;/span&gt; &lt;span class="nf"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;auth.greeting&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="si"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{{&lt;/span&gt; &lt;span class="nx"&gt;trans&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;auth.welcome&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="si"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/template&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;setup&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useLang&lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@/composables/useLang&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;trans&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;__&lt;/span&gt; &lt;span class="err"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useLang&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  ✅ React Example
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useLang&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@/hooks/useLang&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Login&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;trans&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;__&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useLang&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;auth.greeting&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;trans&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;auth.welcome&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  📤 Output on Page
&lt;/h3&gt;

&lt;p&gt;When the above code is rendered, this will be the output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello!
Welcome, John!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🧠 Notes on &lt;code&gt;trans()&lt;/code&gt; vs &lt;code&gt;__()&lt;/code&gt;
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;trans()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Advanced&lt;/td&gt;
&lt;td&gt;Use when you need to pass dynamic placeholders like &lt;code&gt;{name}&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;__()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Simple&lt;/td&gt;
&lt;td&gt;Shortcut for quick access to translated strings&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;✅ You can use them interchangeably for basic translations.&lt;br&gt;
✅ Both support placeholder replacement.&lt;/p&gt;


&lt;h3&gt;
  
  
  🛠 Example with Plain String
&lt;/h3&gt;

&lt;p&gt;Sometimes, you might want to append something without a key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;auth.welcome&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Vue Developer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;// Output: "Welcome, {name}! Vue Developer" (if placeholder is not used)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But recommended usage is always with an object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;trans&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;auth.welcome&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Amit&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="c1"&gt;// Output: "Welcome, Amit!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  📡 Access Inertia Shared Props
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vue:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;usePage&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@inertiajs/vue3&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;lang&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;usePage&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;React:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;usePage&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@inertiajs/react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;lang&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;usePage&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can directly access the full language object shared by Inertia.&lt;/p&gt;




&lt;h2&gt;
  
  
  🗂️ Translation File Location
&lt;/h2&gt;

&lt;p&gt;Language files are loaded based on the current Laravel locale. By default, Laravel uses &lt;code&gt;resources/lang/{locale}&lt;/code&gt; structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;resources/lang/
├── en/
│   └── auth.php
├── hi/
│   └── auth.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When calling:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nf"&gt;syncLangFiles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'auth'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It dynamically loads &lt;code&gt;resources/lang/{locale}/auth.php&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ Configuration
&lt;/h2&gt;

&lt;p&gt;You can customize the language directory by modifying &lt;code&gt;config/inertia-lang.php&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'lang_path'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;lang_path&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="c1"&gt;// Default: /resources/lang&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🧩 Composables Location
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vue:&lt;/strong&gt; &lt;code&gt;resources/js/composables/useLang.ts&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React:&lt;/strong&gt; &lt;code&gt;resources/js/hooks/useLang.tsx&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can modify the location or structure of these files by adjusting the published files.&lt;/p&gt;




&lt;h2&gt;
  
  
  📄 License
&lt;/h2&gt;

&lt;p&gt;This package is licensed under the &lt;a href="https://opensource.org/licenses/MIT" rel="noopener noreferrer"&gt;MIT License&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤝 Contributing
&lt;/h2&gt;

&lt;p&gt;Pull requests and issues are welcome!&lt;br&gt;
Let’s work together to improve localization in Laravel! 💬&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Best Laravel Disposable Email Detection Package for Your Projects</title>
      <dc:creator>Er Amit Gupta</dc:creator>
      <pubDate>Sat, 26 Apr 2025 16:38:24 +0000</pubDate>
      <link>https://dev.to/eramitgupta/the-best-laravel-disposable-email-detection-package-for-your-projects-df6</link>
      <guid>https://dev.to/eramitgupta/the-best-laravel-disposable-email-detection-package-for-your-projects-df6</guid>
      <description>&lt;p&gt;If you're developing a Laravel application that requires user registrations, you've likely encountered the issue of disposable email addresses. These temporary email services can lead to spam, fake accounts, and security concerns for your platform. Today, I'm excited to share what I believe is the best Laravel package for handling this common problem: Laravel Disposable Email Detection by Erag.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why You Need Disposable Email Detection
&lt;/h2&gt;

&lt;p&gt;Before diving into the package details, let's understand why detecting disposable emails matters:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Reduced Spam&lt;/strong&gt;: Temporary emails are often used by spammers to bypass verification&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Better User Quality&lt;/strong&gt;: Real email addresses typically indicate more genuine user interest&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced Security&lt;/strong&gt;: Limiting disposable emails can reduce fraudulent accounts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cleaner Database&lt;/strong&gt;: Your user list contains higher quality, reachable contacts&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Introducing Laravel Disposable Email Detection
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://github.com/eramitgupta/laravel-disposable-email" rel="noopener noreferrer"&gt;Laravel Disposable Email Detection&lt;/a&gt; package stands out for several reasons. Let's explore what makes it exceptional:&lt;/p&gt;

&lt;h3&gt;
  
  
  Impressive Domain Coverage
&lt;/h3&gt;

&lt;p&gt;This package comes pre-loaded with over 106,580 known disposable email domains. That's an extensive database that will catch the vast majority of temporary email services right out of the box.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flexible Implementation Options
&lt;/h3&gt;

&lt;p&gt;What I particularly love about this package is its flexibility. You can integrate it into your application in multiple ways:&lt;/p&gt;

&lt;h4&gt;
  
  
  Form Request Validation
&lt;/h4&gt;

&lt;p&gt;You can validate emails directly in your form requests using either a custom rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;EragLaravelDisposableEmail\Rules\DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'required'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or use the simpler string-based rule format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|email|disposable_email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Runtime Checking
&lt;/h4&gt;

&lt;p&gt;For situations where you need to check emails programmatically during execution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;EragLaravelDisposableEmail\Rules\DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DisposableEmailRule&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;isDisposable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'test@tempmail.com'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Handle disposable email logic&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or via the provided facade:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;DisposableEmail&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DisposableEmail&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;isDisposable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'agedmail.com'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Handle disposable email logic&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Blade Directive Support
&lt;/h4&gt;

&lt;p&gt;The package even includes a Blade directive for your views:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@disposableEmail('amit@0-mail.com')
    &amp;lt;p class="text-red-600"&amp;gt;Disposable email detected!&amp;lt;/p&amp;gt;
@else
    &amp;lt;p class="text-green-600"&amp;gt;Valid email.&amp;lt;/p&amp;gt;
@enddisposableEmail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Easy Installation and Setup
&lt;/h3&gt;

&lt;p&gt;Getting started is straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install via Composer:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require erag/laravel-disposable-email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run the installation command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:install-disposable-email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! The package works with zero configuration, though you can customize it to your needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Regular Updates and Remote Sync
&lt;/h3&gt;

&lt;p&gt;The package allows you to keep your disposable domain list up-to-date with a simple command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:sync-disposable-email-list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This syncs with remote domain lists to ensure you're always protected against the newest disposable email services.&lt;/p&gt;

&lt;h3&gt;
  
  
  Custom Domain Blacklisting
&lt;/h3&gt;

&lt;p&gt;Need to add your own disposable domains? The package makes this simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create or edit &lt;code&gt;storage/app/blacklist_file/disposable_domains.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add your custom domains, one per line&lt;/li&gt;
&lt;li&gt;No additional commands needed - it automatically detects your changes&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Broad Laravel Compatibility
&lt;/h3&gt;

&lt;p&gt;The package works with Laravel 8, 9, 10, 11, and 12, making it suitable for both older and the latest Laravel projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Implementation
&lt;/h2&gt;

&lt;p&gt;In a recent project, I integrated this package to clean up our user registration process. Within the first month, we saw:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;15% reduction in fake account creation&lt;/li&gt;
&lt;li&gt;Improved deliverability of our marketing emails&lt;/li&gt;
&lt;li&gt;Better overall engagement metrics from registered users&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The implementation was seamless, and the performance impact was negligible despite the large domain database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;If you're looking for a disposable email detection solution for your Laravel project, this package offers the perfect combination of extensive domain coverage, flexible implementation options, and ease of use. &lt;/p&gt;

&lt;p&gt;The ability to customize and extend the domain list makes it adaptable to your specific needs, while the simple validation rules make implementation a breeze.&lt;/p&gt;

&lt;p&gt;For a clean, spam-resistant user database, I highly recommend giving the Laravel Disposable Email Detection package a try in your next project.&lt;/p&gt;

&lt;p&gt;Have you implemented disposable email detection in your applications? What benefits have you seen? I'd love to hear about your experiences in the comments below!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Laravel PWA Master Guide: Build App-Like Experiences with Laravel in 5 Minutes</title>
      <dc:creator>Er Amit Gupta</dc:creator>
      <pubDate>Sat, 26 Apr 2025 08:22:02 +0000</pubDate>
      <link>https://dev.to/eramitgupta/laravel-pwa-master-guide-build-app-like-experiences-with-laravel-in-5-minutes-2k16</link>
      <guid>https://dev.to/eramitgupta/laravel-pwa-master-guide-build-app-like-experiences-with-laravel-in-5-minutes-2k16</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcpof2ra7kr1djjgrqmo2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcpof2ra7kr1djjgrqmo2.png" alt="Laravel PWA Integration Banner" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In today's mobile-first world, Progressive Web Applications (PWAs) have revolutionized how users interact with websites. For Laravel developers looking to enhance user experience, PWAs offer the perfect solution by combining the best features of web and mobile applications. This guide will walk you through integrating PWA functionality into your Laravel projects using the powerful &lt;code&gt;erag/laravel-pwa&lt;/code&gt; package.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are Progressive Web Applications?
&lt;/h2&gt;

&lt;p&gt;Progressive Web Applications are websites that function like native mobile applications. They offer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Offline Access&lt;/strong&gt;: Users can access your application even without an internet connection&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast Loading&lt;/strong&gt;: PWAs load quickly, even on slow networks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Home Screen Installation&lt;/strong&gt;: Users can add your app to their home screen&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Native-Like Experience&lt;/strong&gt;: Smooth transitions and responsive design&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Add PWA to Your Laravel Project?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced User Experience&lt;/strong&gt;: Provide a seamless, app-like experience&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Increased Engagement&lt;/strong&gt;: Users spend 40% more time on PWAs than on regular websites&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Better Conversion Rates&lt;/strong&gt;: PWAs have shown to increase conversions by up to 36%&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduced Development Costs&lt;/strong&gt;: Build once for all platforms instead of separate native apps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved SEO&lt;/strong&gt;: Google ranks mobile-friendly websites higher&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started with Laravel PWA Integration
&lt;/h2&gt;

&lt;p&gt;Let's transform your Laravel application into a PWA with the &lt;code&gt;erag/laravel-pwa&lt;/code&gt; package.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Install the Package
&lt;/h3&gt;

&lt;p&gt;Begin by installing the package via Composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require erag/laravel-pwa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Run the Installation Command
&lt;/h3&gt;

&lt;p&gt;Once installed, publish the PWA configuration files using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:install-pwa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command creates the necessary configuration files and sets up the PWA foundation for your application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Configure Your PWA
&lt;/h3&gt;

&lt;p&gt;The installation creates a &lt;code&gt;config/pwa.php&lt;/code&gt; file where you can customize all aspects of your PWA:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'install-button'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Control visibility of the install button&lt;/span&gt;

    &lt;span class="s1"&gt;'manifest'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Your App Name'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'short_name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'App'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'background_color'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'#6777ef'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'display'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'fullscreen'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'description'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Your app description here'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'theme_color'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'#6777ef'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'icons'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="s1"&gt;'src'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'logo.png'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s1"&gt;'sizes'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'512x512'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s1"&gt;'type'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'image/png'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;

    &lt;span class="s1"&gt;'debug'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;env&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'APP_DEBUG'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Update Your Layout Files
&lt;/h3&gt;

&lt;p&gt;To integrate PWA functionality, add the following Blade directives to your layout file:&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; section:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@PwaHead
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before the closing &lt;code&gt;&amp;lt;/body&amp;gt;&lt;/code&gt; tag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@RegisterServiceWorkerScript
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5: Update the Manifest
&lt;/h3&gt;

&lt;p&gt;After customizing your configuration, update the manifest file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:update-manifest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This generates a &lt;code&gt;manifest.json&lt;/code&gt; file in your public directory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: Add a Custom Logo
&lt;/h3&gt;

&lt;p&gt;For the best user experience, add a custom logo:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a form with a file input field named "logo"&lt;/li&gt;
&lt;li&gt;Process the upload with the provided utility method:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Http\Controllers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="no"&gt;EragLaravelPwa\Core\PWA&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Http\Request&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Routing\Controller&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SettingsController&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Controller&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;uploadLogo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Request&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;PWA&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;processLogo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'status'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;back&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'success'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'message'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;back&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;withErrors&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'errors'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Advanced Configuration Options
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Customizing the Install Button
&lt;/h3&gt;

&lt;p&gt;You can control the visibility of the install button globally in the config file or conditionally in your views:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@if(auth()-&amp;gt;user()-&amp;gt;isPremium())
    @PwaInstallButton
@endif
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Offline Page Customization
&lt;/h3&gt;

&lt;p&gt;The package automatically generates an offline page. You can customize this by creating your own offline template in &lt;code&gt;resources/views/vendor/pwa/offline.blade.php&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Service Worker Strategies
&lt;/h3&gt;

&lt;p&gt;For advanced users, you can modify the caching strategies in the service worker file:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Publish the service worker template&lt;/li&gt;
&lt;li&gt;Adjust caching rules for different file types&lt;/li&gt;
&lt;li&gt;Implement custom fetch handlers&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Testing Your PWA
&lt;/h2&gt;

&lt;p&gt;Before deployment, test your PWA thoroughly:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Lighthouse Audit&lt;/strong&gt;: Use Chrome's Lighthouse to audit your PWA&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline Testing&lt;/strong&gt;: Test functionality without an internet connection&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Installation Flow&lt;/strong&gt;: Verify the app installs correctly on various devices&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: Check loading times and responsiveness&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Common Issues and Solutions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  HTTPS Requirement
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: PWAs require HTTPS to function correctly.&lt;br&gt;
&lt;strong&gt;Solution&lt;/strong&gt;: Set up SSL certificates for your production environment. For local development, use Laravel Valet or Laravel Homestead which provide HTTPS support.&lt;/p&gt;

&lt;h3&gt;
  
  
  Service Worker Not Registering
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: The service worker fails to register.&lt;br&gt;
&lt;strong&gt;Solution&lt;/strong&gt;: Ensure the service worker path is correct and accessible. Check browser console for errors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Manifest Not Found
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: Browser cannot find the manifest file.&lt;br&gt;
&lt;strong&gt;Solution&lt;/strong&gt;: Verify the manifest.json is in the public directory and properly referenced in your HTML.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compatibility
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;erag/laravel-pwa&lt;/code&gt; package supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Laravel 8, 9, 10, 11, and 12&lt;/li&gt;
&lt;li&gt;All major browsers (Chrome, Firefox, Safari, Edge)&lt;/li&gt;
&lt;li&gt;Mobile and desktop devices&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Implementing PWA functionality in your Laravel application enhances user experience dramatically while potentially boosting engagement and conversion rates. With the &lt;code&gt;erag/laravel-pwa&lt;/code&gt; package, this integration becomes straightforward, allowing you to focus on building great features rather than wrestling with PWA complexities.&lt;/p&gt;

&lt;p&gt;Take your Laravel application to the next level by transforming it into a Progressive Web App today. Your users will thank you with increased engagement and loyalty.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Updated: April 2025 | Laravel PWA Implementation Guide&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Laravel Disposable Email Detection: Block Temporary Emails and Improve User Verification</title>
      <dc:creator>Er Amit Gupta</dc:creator>
      <pubDate>Sat, 26 Apr 2025 08:18:20 +0000</pubDate>
      <link>https://dev.to/eramitgupta/laravel-disposable-email-detection-block-temporary-emails-and-improve-user-verification-2280</link>
      <guid>https://dev.to/eramitgupta/laravel-disposable-email-detection-block-temporary-emails-and-improve-user-verification-2280</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcpof2ra7kr1djjgrqmo2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcpof2ra7kr1djjgrqmo2.png" alt="Laravel Disposable Email Detection" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why You Need to Block Disposable Email Addresses
&lt;/h2&gt;

&lt;p&gt;Disposable email addresses present a significant challenge for web applications. These temporary email services allow users to register with throwaway addresses that expire after a short time, often leading to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Increased spam&lt;/strong&gt; in your application&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fraudulent accounts&lt;/strong&gt; that bypass verification&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lost communication&lt;/strong&gt; with users when emails expire&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduced quality&lt;/strong&gt; of your user database&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fortunately, Laravel developers now have an elegant solution with the &lt;strong&gt;Laravel Disposable Email Detection&lt;/strong&gt; package by Erag.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Makes This Package Stand Out
&lt;/h2&gt;

&lt;p&gt;The Laravel Disposable Email Detection package offers a robust solution with several impressive features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Massive Database&lt;/strong&gt;: Contains over 106,580 known disposable email domains&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiple Integration Methods&lt;/strong&gt;: Form validation, runtime checking, and Blade directives&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto-Sync Capability&lt;/strong&gt;: Keeps your blacklist updated from remote sources&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Blacklisting&lt;/strong&gt;: Easily add your own domains to block&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero Configuration&lt;/strong&gt;: Works out of the box with sensible defaults&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Laravel Compatibility&lt;/strong&gt;: Works with Laravel 8, 9, 10, 11, and 12&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation and Setup (Quick Start)
&lt;/h2&gt;

&lt;p&gt;Getting started with the package is straightforward:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Install via Composer
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require erag/laravel-disposable-email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Publish the Configuration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:install-disposable-email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a &lt;code&gt;config/disposable-email.php&lt;/code&gt; file where you can customize the package's behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation Methods (with Code Examples)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Method 1: Form Validation Rules
&lt;/h3&gt;

&lt;p&gt;The package provides multiple ways to validate email addresses in your forms:&lt;/p&gt;

&lt;h4&gt;
  
  
  Using the Custom Rule Object:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;EragLaravelDisposableEmail\Rules\DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'required'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Using String-Based Validation:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|email|disposable_email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Method 2: Runtime Email Checking
&lt;/h3&gt;

&lt;p&gt;You can programmatically check email domains anywhere in your application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;EragLaravelDisposableEmail\Rules\DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DisposableEmailRule&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;isDisposable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'user@tempmail.com'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// This is a disposable email - handle accordingly&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or use the convenient facade:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;DisposableEmail&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DisposableEmail&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;isDisposable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'temporarymail.org'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Block registration, show warning, etc.&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Method 3: Blade Directive for Templates
&lt;/h3&gt;

&lt;p&gt;The package includes a Blade directive for conditional rendering:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@disposableEmail('support@example.com')
    &amp;lt;div class="alert alert-danger"&amp;gt;
        This appears to be a disposable email address. Please use your primary email.
    &amp;lt;/div&amp;gt;
@else
    &amp;lt;div class="alert alert-success"&amp;gt;
        Email address accepted!
    &amp;lt;/div&amp;gt;
@enddisposableEmail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Maintaining Your Disposable Email Database
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Automatic Synchronization
&lt;/h3&gt;

&lt;p&gt;Keep your disposable email list current by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:sync-disposable-email-list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command fetches the latest known disposable domains from remote sources defined in your config file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding Custom Domains
&lt;/h3&gt;

&lt;p&gt;You can easily extend the blacklist with your own domains:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to &lt;code&gt;storage/app/blacklist_file/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create or edit &lt;code&gt;disposable_domains.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add domains (one per line):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   throwaway-domain.com
   temporary-mail.net
   fakeuser.org
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Real-World Implementation Examples
&lt;/h2&gt;

&lt;h3&gt;
  
  
  User Registration Form
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Http\Controllers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Models\User&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Http\Request&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;EragLaravelDisposableEmail\Rules\DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;RegistrationController&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Controller&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Request&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$validated&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
            &lt;span class="s1"&gt;'name'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|string|max:255'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'required'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'unique:users'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
            &lt;span class="s1"&gt;'password'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|min:8|confirmed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;]);&lt;/span&gt;

        &lt;span class="c1"&gt;// Create user if validation passes&lt;/span&gt;
        &lt;span class="nv"&gt;$user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$validated&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Continue with registration...&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Email Change Verification
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;updateEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Request&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
        &lt;span class="s1"&gt;'new_email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'required'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'unique:users,email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'disposable_email'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;]);&lt;/span&gt;

    &lt;span class="c1"&gt;// Process email change...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configuration Options
&lt;/h2&gt;

&lt;p&gt;The package is highly customizable through the &lt;code&gt;config/disposable-email.php&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'blacklist_file'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;storage_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'app/blacklist_file'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;

    &lt;span class="s1"&gt;'remote_url'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'https://raw.githubusercontent.com/disposable/disposable-email-domains/master/domains.txt'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'https://raw.githubusercontent.com/7c/fakefilter/refs/heads/main/txt/data.txt'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can modify these settings to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change the location of your blacklist file&lt;/li&gt;
&lt;li&gt;Add or modify remote sources for disposable domains&lt;/li&gt;
&lt;li&gt;Customize validation error messages&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Performance Considerations
&lt;/h2&gt;

&lt;p&gt;The package maintains an optimal balance between accuracy and performance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses efficient file caching for domain lists&lt;/li&gt;
&lt;li&gt;Performs fast string comparisons for email validation&lt;/li&gt;
&lt;li&gt;Minimal impact on application performance&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion: Protecting Your Application's Integrity
&lt;/h2&gt;

&lt;p&gt;Implementing the Laravel Disposable Email Detection package provides a powerful layer of protection for your application. By preventing disposable email registrations, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure reliable communication with your users&lt;/li&gt;
&lt;li&gt;Reduce spam and fraudulent accounts&lt;/li&gt;
&lt;li&gt;Maintain a higher quality user database&lt;/li&gt;
&lt;li&gt;Improve overall platform security&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whether you're building a new Laravel application or enhancing an existing one, this package offers an elegant solution to the persistent problem of throwaway email addresses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Packagist&lt;/strong&gt;: &lt;a href="https://packagist.org/packages/erag/laravel-disposable-email" rel="noopener noreferrer"&gt;erag/laravel-disposable-email&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/eramitgupta/laravel-disposable-email" rel="noopener noreferrer"&gt;eramitgupta/laravel-disposable-email&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Best Laravel Disposable Email Detector Package (2025) — Block Temporary Emails Easily</title>
      <dc:creator>Er Amit Gupta</dc:creator>
      <pubDate>Sat, 26 Apr 2025 08:17:28 +0000</pubDate>
      <link>https://dev.to/eramitgupta/best-laravel-disposable-email-detector-package-2025-block-temporary-emails-easily-4j0i</link>
      <guid>https://dev.to/eramitgupta/best-laravel-disposable-email-detector-package-2025-block-temporary-emails-easily-4j0i</guid>
      <description>&lt;h1&gt;
  
  
  Best Laravel Disposable Email Detector Package (2025)
&lt;/h1&gt;

&lt;p&gt;Are you tired of fake or temporary email signups in your Laravel app?&lt;br&gt;&lt;br&gt;
Meet &lt;strong&gt;&lt;code&gt;erag/laravel-disposable-email&lt;/code&gt;&lt;/strong&gt;, the &lt;strong&gt;best Laravel package&lt;/strong&gt; to detect and block disposable email addresses during form validation or runtime checks!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;✅ Already covers &lt;strong&gt;106,000+ disposable domains&lt;/strong&gt; and supports &lt;strong&gt;Laravel 8, 9, 10, 11, 12&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  🚀 Why You Need a Disposable Email Detection Package?
&lt;/h2&gt;

&lt;p&gt;Disposable emails are used to bypass real email verification, spam systems, and create fake accounts.&lt;br&gt;&lt;br&gt;
Blocking them can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Improve your user quality&lt;/li&gt;
&lt;li&gt;Protect your platform from spammers&lt;/li&gt;
&lt;li&gt;Reduce fake registrations&lt;/li&gt;
&lt;li&gt;Maintain a clean email database&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🌟 Why &lt;code&gt;erag/laravel-disposable-email&lt;/code&gt; Is the Best Choice?
&lt;/h2&gt;

&lt;p&gt;Here’s why developers love it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔥 &lt;strong&gt;106,580+ known disposable domains&lt;/strong&gt; already included&lt;/li&gt;
&lt;li&gt;🧠 &lt;strong&gt;Smart validation rule&lt;/strong&gt; for quick integration&lt;/li&gt;
&lt;li&gt;⚙️ &lt;strong&gt;Runtime checking&lt;/strong&gt; via helper and facade&lt;/li&gt;
&lt;li&gt;🧩 &lt;strong&gt;Blade directive&lt;/strong&gt; for easy frontend conditionals&lt;/li&gt;
&lt;li&gt;🌐 &lt;strong&gt;Auto-sync&lt;/strong&gt; from trusted remote sources&lt;/li&gt;
&lt;li&gt;✏️ &lt;strong&gt;Custom blacklist support&lt;/strong&gt; (no coding needed)&lt;/li&gt;
&lt;li&gt;⚡ &lt;strong&gt;Zero-configuration&lt;/strong&gt; setup with artisan command&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Optimized for performance&lt;/strong&gt; even with a huge domain list&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  📦 How to Install in Laravel?
&lt;/h2&gt;

&lt;p&gt;Installation is super easy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require erag/laravel-disposable-email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then publish the configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:install-disposable-email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Done! 🎯&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ How to Use It?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Form Request Validation
&lt;/h3&gt;

&lt;p&gt;Use the &lt;strong&gt;custom rule&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;EragLaravelDisposableEmail\Rules\DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'required'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or use &lt;strong&gt;string-based&lt;/strong&gt; validation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|email|disposable_email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. Check Directly at Runtime
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;DisposableEmail&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DisposableEmail&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;isDisposable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'test@tempmail.com'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Do something&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  3. Blade Directive (Frontend Condition)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@disposableEmail('amit@0-mail.com')
    &amp;lt;p class="text-red-600"&amp;gt;Disposable email detected!&amp;lt;/p&amp;gt;
@else
    &amp;lt;p class="text-green-600"&amp;gt;Valid email.&amp;lt;/p&amp;gt;
@enddisposableEmail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔄 How to Sync Disposable Domain List?
&lt;/h2&gt;

&lt;p&gt;You can manually update the disposable domain list anytime:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:sync-disposable-email-list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will fetch fresh domains from trusted remote sources automatically.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 How to Add Your Own Disposable Domains?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;📌 &lt;strong&gt;No Coding Needed!&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Just create a file:&lt;br&gt;&lt;br&gt;
&lt;code&gt;storage/app/blacklist_file/disposable_domains.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and add domains like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tempmail.com
fakemail.org
trashmail.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each line = one domain name.&lt;br&gt;&lt;br&gt;
The package will &lt;strong&gt;automatically detect&lt;/strong&gt; your custom domains.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✨ Conclusion
&lt;/h2&gt;

&lt;p&gt;If you are building a serious Laravel app in 2025,&lt;br&gt;&lt;br&gt;
&lt;strong&gt;blocking disposable emails is a must&lt;/strong&gt; to ensure real, quality users.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;erag/laravel-disposable-email&lt;/code&gt;, you can easily:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Validate emails at registration&lt;/li&gt;
&lt;li&gt;Prevent fake signups&lt;/li&gt;
&lt;li&gt;Keep your system clean &amp;amp; secure&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🚀 Install it today and protect your Laravel application in minutes!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🔗 Install Now:
&lt;/h2&gt;

&lt;p&gt;👉 &lt;a href="https://packagist.org/packages/erag/laravel-disposable-email" rel="noopener noreferrer"&gt;Packagist Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/eramitgupta/laravel-disposable-email" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Laravel disposable email validation&lt;/li&gt;
&lt;li&gt;Best Laravel package block disposable email&lt;/li&gt;
&lt;li&gt;Laravel email validation temporary&lt;/li&gt;
&lt;li&gt;Block temp email Laravel&lt;/li&gt;
&lt;li&gt;Laravel fake email detector&lt;/li&gt;
&lt;li&gt;Disposable email checker Laravel&lt;/li&gt;
&lt;/ul&gt;




</description>
    </item>
    <item>
      <title>Laravel Disposable Email Detection Package 2025</title>
      <dc:creator>Er Amit Gupta</dc:creator>
      <pubDate>Sat, 19 Apr 2025 13:23:07 +0000</pubDate>
      <link>https://dev.to/eramitgupta/laravel-disposable-email-detection-package-2025-4n9l</link>
      <guid>https://dev.to/eramitgupta/laravel-disposable-email-detection-package-2025-4n9l</guid>
      <description>&lt;h1&gt;
  
  
  Laravel Disposable Email Detection
&lt;/h1&gt;

&lt;center&gt;
    &lt;img alt="Screenshot 2024-10-04 at 10 34 23 PM" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fuser-attachments%2Fassets%2F2b187de0-d5cc-4871-9c5d-ce0ffbb5a26c" width="800" height="255"&gt;
&lt;/center&gt;

&lt;p&gt;&lt;a href="https://github.com/eramitgupta/laravel-disposable-email/blob/main/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FLicence-MIT-blue" alt="Packagist License" width="82" height="20"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://packagist.org/packages/erag/laravel-disposable-email" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fpackagist%2Fv%2Ferag%2Flaravel-disposable-email%3Flabel%3DStable" alt="Latest Stable Version" width="90" height="20"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://packagist.org/packages/erag/laravel-disposable-email" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fpackagist%2Fdt%2Ferag%2Flaravel-disposable-email.svg%3Flabel%3DDownloads" alt="Total Downloads" width="106" height="20"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A Laravel package to detect and block disposable (temporary) email addresses during validation or runtime logic.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Already contains 106,580+ disposable email domains!&lt;/strong&gt; 🔥&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🚀 Installation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require erag/laravel-disposable-email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🛠 Configuration
&lt;/h2&gt;

&lt;p&gt;Publish the config file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; php artisan erag:install-disposable-email  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create &lt;code&gt;config/disposable-email.php&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙ Usage
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Form Request Validation&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  ✅ Custom Rule:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;EragLaravelDisposableEmail\Rules\DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'required'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  ✅ String-based Rule:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'email'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'required|email|disposable_email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. &lt;strong&gt;Direct Runtime Check&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;EragLaravelDisposableEmail\Rules\DisposableEmailRule&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DisposableEmailRule&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;isDisposable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'test@tempmail.com'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Do something if email is disposable&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or via facade:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;DisposableEmail&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DisposableEmail&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;isDisposable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'agedmail.com'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Do something&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  3. &lt;strong&gt;Blade Directive&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@disposableEmail('amit@0-mail.com')
    &amp;lt;p class="text-red-600"&amp;gt;Disposable email detected!&amp;lt;/p&amp;gt;
@else
    &amp;lt;p class="text-green-600"&amp;gt;Valid email.&amp;lt;/p&amp;gt;
@enddisposableEmail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  📦 Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;106,580+ known disposable domains out-of-the-box&lt;/li&gt;
&lt;li&gt;Uses latest community sources&lt;/li&gt;
&lt;li&gt;Supports auto-syncing from remote URLs&lt;/li&gt;
&lt;li&gt;Custom validation rule&lt;/li&gt;
&lt;li&gt;Facade and Blade support&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔄 Sync From Remote (Optional)
&lt;/h2&gt;

&lt;p&gt;Update the list manually&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan erag:sync-disposable-email-list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🔗 Config Options (config/disposable-email.php)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'blacklist_file'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;storage_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'app/blacklist_file),

    '&lt;/span&gt;&lt;span class="n"&gt;remote_url&lt;/span&gt;&lt;span class="s1"&gt;' =&amp;gt; [
        '&lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="o"&gt;://&lt;/span&gt;&lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="n"&gt;githubusercontent&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;disposable&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;disposable&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;domains&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;master&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;domains&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="n"&gt;txt&lt;/span&gt;&lt;span class="s1"&gt;',
        '&lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="o"&gt;://&lt;/span&gt;&lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="n"&gt;githubusercontent&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;fakefilter&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;refs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;heads&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;txt&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="n"&gt;txt&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;✅ &lt;strong&gt;Note:&lt;/strong&gt; The &lt;code&gt;.txt&lt;/code&gt; files from &lt;code&gt;remote_url&lt;/code&gt; must follow this format:&lt;br&gt;&lt;br&gt;
Each line should contain &lt;strong&gt;only a domain name&lt;/strong&gt;, like:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0-00.usa.cc
0-30-24.com
0-attorney.com
0-mail.com
00-tv.com
00.msk.ru
00.pe
00000000000.pro
000728.xyz
000777.info
00082cc.com
00082dd.com
00082ss.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the file contains anything other than plain domains (like comments or extra data), it may cause parsing issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧩 Add Your Own Disposable Domains
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;✅ &lt;strong&gt;Want to block additional disposable domains?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
You can &lt;strong&gt;easily extend the list manually&lt;/strong&gt; — no coding, no command required!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🔹 &lt;strong&gt;1&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Go to the following path: &lt;br&gt;&lt;strong&gt;&lt;code&gt;storage/app/blacklist_file/&lt;/code&gt;&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🔹 &lt;strong&gt;2&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Create or edit this file: &lt;br&gt;&lt;strong&gt;&lt;code&gt;disposable_domains.txt&lt;/code&gt;&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🔹 &lt;strong&gt;3&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Add your custom domains like:&lt;br&gt;&lt;code&gt;abakiss.com&lt;/code&gt;&lt;br&gt;&lt;code&gt;fakemail.org&lt;/code&gt;&lt;br&gt;&lt;code&gt;trashbox.io&lt;/code&gt;&lt;br&gt;&lt;em&gt;(one per line)&lt;/em&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;blockquote&gt;
&lt;p&gt;📌 &lt;strong&gt;Important Notes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each line must contain &lt;strong&gt;only the domain name&lt;/strong&gt; – no extra symbols, no comments.&lt;/li&gt;
&lt;li&gt;The package will &lt;strong&gt;automatically detect and use&lt;/strong&gt; the domains from this file.&lt;/li&gt;
&lt;li&gt;You &lt;strong&gt;do not&lt;/strong&gt; need to run any Artisan command. 🧙‍♂️&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  ⚙️ Ensure File Path Matches Configuration
&lt;/h3&gt;

&lt;p&gt;Your file path &lt;strong&gt;must match&lt;/strong&gt; the one defined in &lt;code&gt;config/disposable-email.php&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="s1"&gt;'blacklist_file'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;storage_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'app/blacklist_file'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the path or filename is different, the package will &lt;strong&gt;not load&lt;/strong&gt; your custom list. ✅&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
