<?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: Fazle Rabbi</title>
    <description>The latest articles on DEV Community by Fazle Rabbi (@fazle_rabbi).</description>
    <link>https://dev.to/fazle_rabbi</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%2F3715960%2Fdbf71d62-c898-4048-9734-23e7cdbf7b16.png</url>
      <title>DEV Community: Fazle Rabbi</title>
      <link>https://dev.to/fazle_rabbi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fazle_rabbi"/>
    <language>en</language>
    <item>
      <title>Mask Your Laravel App Eloquent Attributes on Retrieval</title>
      <dc:creator>Fazle Rabbi</dc:creator>
      <pubDate>Mon, 02 Feb 2026 11:35:57 +0000</pubDate>
      <link>https://dev.to/fazle_rabbi/mask-your-laravel-app-eloquent-attributes-on-retrieval-4jnp</link>
      <guid>https://dev.to/fazle_rabbi/mask-your-laravel-app-eloquent-attributes-on-retrieval-4jnp</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/irabbi360/laravel-attribute-mask" rel="noopener noreferrer"&gt;Mask Your Laravel App Eloquent Attributes on Retrieval&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A Laravel package that automatically masks sensitive model attributes on retrieval. Supports email, phone, and text masking with highly configurable rules.&lt;/p&gt;

&lt;p&gt;This is the Github Repository. &lt;a href="https://github.com/irabbi360/laravel-attribute-mask" rel="noopener noreferrer"&gt;https://github.com/irabbi360/laravel-attribute-mask&lt;/a&gt;&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Automatic attribute masking on retrieval&lt;/li&gt;
&lt;li&gt;Email, phone, and text masking support&lt;/li&gt;
&lt;li&gt;Configurable mask character and visibility&lt;/li&gt;
&lt;li&gt;Global or per-attribute masking rules&lt;/li&gt;
&lt;li&gt;Auto-detection of phone fields by column name&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 irabbi360/laravel-attribute-mask
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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 vendor:publish &lt;span class="nt"&gt;--tag&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"attribute-mask-config"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;The default configuration (&lt;code&gt;config/attribute-mask.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;'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;'mask_char'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'*'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="s1"&gt;'email_masking'&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;'show_domain'&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;'show_start'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'show_end'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;

    &lt;span class="s1"&gt;'phone_masking'&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;'show_start'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'show_end'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'patterns'&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;'phone'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'phone_number'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'mobile'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'mobile_number'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&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;'text_masking'&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;'show_start'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'show_end'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&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;
  
  
  Usage
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Define Maskable Attributes
&lt;/h3&gt;

&lt;p&gt;Add the &lt;code&gt;HasMaskedAttributes&lt;/code&gt; trait and define maskable attributes using the &lt;code&gt;maskables()&lt;/code&gt; method:&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;Irabbi360\LaravelAttributeMask\Concern\HasMaskedAttributes&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\Database\Eloquent\Model&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;User&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Model&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;HasMaskedAttributes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="cd"&gt;/**
     * Get the attributes that should be masked.
     */&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;maskables&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;'email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'phone'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'phone_number'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ssn'&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;Alternatively, use the &lt;code&gt;$maskable&lt;/code&gt; property:&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="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Model&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;HasMaskedAttributes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="kt"&gt;array&lt;/span&gt; &lt;span class="nv"&gt;$maskable&lt;/span&gt; &lt;span class="o"&gt;=&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;'phone'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ssn'&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;
  
  
  Masking Behavior
&lt;/h3&gt;

&lt;p&gt;Attributes are automatically masked on retrieval:&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;$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;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;       &lt;span class="c1"&gt;// t**t@example.com&lt;/span&gt;
&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;       &lt;span class="c1"&gt;// 123****90&lt;/span&gt;
&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;ssn&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;         &lt;span class="c1"&gt;// 123***789&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Retrieving Original Values
&lt;/h3&gt;

&lt;p&gt;Get the unmasked value using &lt;code&gt;getOriginal()&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;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getOriginal&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="c1"&gt;// test@example.com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or temporarily disable masking:&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;config&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'attribute-mask.enabled'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="nv"&gt;$original&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'attribute-mask.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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Email Masking
&lt;/h3&gt;

&lt;p&gt;Configure email masking behavior:&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;'email_masking'&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;'show_domain'&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;// Show domain part&lt;/span&gt;
    &lt;span class="s1"&gt;'show_start'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;          &lt;span class="c1"&gt;// Show first 2 characters&lt;/span&gt;
    &lt;span class="s1"&gt;'show_end'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;            &lt;span class="c1"&gt;// Show last 2 characters&lt;/span&gt;
&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;test@example.com&lt;/code&gt; → &lt;code&gt;te**t@example.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;john.doe@example.com&lt;/code&gt; → &lt;code&gt;jo**oe@example.com&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Phone Masking
&lt;/h3&gt;

&lt;p&gt;Phone fields are auto-detected by column name. Configure visibility:&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;'phone_masking'&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;'show_start'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'show_end'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;2&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;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;1234567890&lt;/code&gt; → &lt;code&gt;123****90&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;+1-555-123-4567&lt;/code&gt; → &lt;code&gt;+15-***-67&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add custom phone patterns:&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;'phone_masking'&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;'patterns'&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;'phone'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'mobile'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'whatsapp'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'fax'&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;
  
  
  Text Masking
&lt;/h3&gt;

&lt;p&gt;For other text attributes:&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;'text_masking'&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;'show_start'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'show_end'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&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;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;secretpassword&lt;/code&gt; → &lt;code&gt;sec********rd&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;API_KEY_12345&lt;/code&gt; → &lt;code&gt;API***345&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Custom Mask Character
&lt;/h3&gt;

&lt;p&gt;Change the mask character globally:&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;'mask_char'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'#'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="c1"&gt;// Result: test@example.com → t##t@example.com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Disable Masking
&lt;/h3&gt;

&lt;p&gt;Disable globally:&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;'enabled'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or temporarily:&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;config&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'attribute-mask.enabled'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// Returns unmasked value&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Testing
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://github.com/irabbi360/laravel-attribute-mask" rel="noopener noreferrer"&gt;Find here source code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you like this package give a star on &lt;a href="https://github.com/irabbi360/laravel-attribute-mask" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Wordpress Secure ShareLink – Generate, manage, secure temporary share links for files, 301 Redirect</title>
      <dc:creator>Fazle Rabbi</dc:creator>
      <pubDate>Sun, 25 Jan 2026 03:29:12 +0000</pubDate>
      <link>https://dev.to/fazle_rabbi/wordpress-secure-sharelink-generate-manage-secure-temporary-share-links-for-files-301-redirect-328p</link>
      <guid>https://dev.to/fazle_rabbi/wordpress-secure-sharelink-generate-manage-secure-temporary-share-links-for-files-301-redirect-328p</guid>
      <description>&lt;p&gt;&lt;strong&gt;Secure ShareLink – Generate, manage, and secure temporary share links for files, 301 Redirect, and add data preview.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://wordpress.org/plugins/secure-sharelink/advanced/" rel="noopener noreferrer"&gt;https://wordpress.org/plugins/secure-sharelink/advanced/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://wordpress.org/plugins/secure-sharelink/advanced/" rel="noopener noreferrer"&gt;Secure ShareLink&lt;/a&gt;&lt;/strong&gt; is a WordPress plugin that allows you to generate secure, time-limited sharing links for files, routes, or model data. It includes advanced security features such as password protection, IP filtering, burn-after-read, and usage limits, along with comprehensive auditing. Perfect for sharing sensitive content or providing temporary access to resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features&lt;/strong&gt;&lt;br&gt;
🔗 Multiple Resource Types – Share files, URLs, 301 Redirect, or text/data seamlessly&lt;/p&gt;

&lt;p&gt;⏰ Time-Limited Access – Set expiration dates and usage limits&lt;/p&gt;

&lt;p&gt;🔒 Password Protection – Protect links with a secure password&lt;/p&gt;

&lt;p&gt;🚫 IP Filtering – Restrict access to specific IP addresses&lt;/p&gt;

&lt;p&gt;🔥 Burn After Reading – One-time access links that self-destruct&lt;/p&gt;

&lt;p&gt;📊 Comprehensive Auditing – Track access patterns and usage&lt;/p&gt;

&lt;p&gt;🎯 Flexible Delivery – Supports file downloads and URL redirection&lt;/p&gt;

&lt;p&gt;💻 Admin UI – Create, edit, manage, and monitor links from WordPress admin&lt;/p&gt;

&lt;p&gt;🧪 Secure – Passwords are hashed, preventing exposure in the database&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;br&gt;
Creating a Link&lt;/p&gt;

&lt;p&gt;Go to &lt;a href="https://wordpress.org/plugins/secure-sharelink/" rel="noopener noreferrer"&gt;ShareLink&lt;/a&gt; → Add New.&lt;/p&gt;

&lt;p&gt;Choose the resource type: File, URL, or Text.&lt;/p&gt;

&lt;p&gt;If selecting a file, use the Media Library picker.&lt;/p&gt;

&lt;p&gt;Optionally configure:&lt;/p&gt;

&lt;p&gt;Password protection&lt;/p&gt;

&lt;p&gt;Expiration date/time&lt;/p&gt;

&lt;p&gt;Maximum uses&lt;/p&gt;

&lt;p&gt;IP whitelist&lt;/p&gt;

&lt;p&gt;Burn after reading&lt;/p&gt;

&lt;p&gt;Click Create Link. You will get a secure URL like:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://yourdomain.com/shareurl/82ddae9522c4dd0a40bcdfd036c5f56f" rel="noopener noreferrer"&gt;http://yourdomain.com/shareurl/82ddae9522c4dd0a40bcdfd036c5f56f&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Accessing a Link&lt;/p&gt;

&lt;p&gt;Visiting the link will:&lt;/p&gt;

&lt;p&gt;Prompt for a password if set.&lt;/p&gt;

&lt;p&gt;Enforce IP whitelist and max uses.&lt;/p&gt;

&lt;p&gt;Expire after the specified date or after the configured number of uses.&lt;/p&gt;

&lt;p&gt;Automatically delete if burn-after-reading is enabled.&lt;/p&gt;

&lt;p&gt;Users can download files or view content directly depending on the resource type.&lt;/p&gt;

&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%2Fjosx6kv3kgdioz5zfbot.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%2Fjosx6kv3kgdioz5zfbot.png" alt=" " width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&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%2Fq9kjth77fld1pawmhuly.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%2Fq9kjth77fld1pawmhuly.png" alt=" " width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>Laravel API Inspector - Auto Generate API Documentation</title>
      <dc:creator>Fazle Rabbi</dc:creator>
      <pubDate>Sat, 17 Jan 2026 05:52:20 +0000</pubDate>
      <link>https://dev.to/fazle_rabbi/laravel-api-inspector-auto-generate-api-documentation-56fd</link>
      <guid>https://dev.to/fazle_rabbi/laravel-api-inspector-auto-generate-api-documentation-56fd</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/irabbi360/laravel-api-inspector" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19u5lzr0lwy8cemoqfac.png" alt=" " width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Laravel API Inspector automatically generates API documentation from your Laravel routes, FormRequest validation rules, and API Resources. It's like Postman + Swagger combined, but deeply integrated with Laravel.&lt;/p&gt;

&lt;p&gt;This is the git repository &lt;a href="https://github.com/irabbi360/laravel-api-inspector" rel="noopener noreferrer"&gt;https://github.com/irabbi360/laravel-api-inspector&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✨ Auto-Parse FormRequest Rules - Converts Laravel validation rules into comprehensive documentation&lt;br&gt;
📮 Generate Postman Collections - Create ready-to-use Postman collections with examples&lt;br&gt;
📖 OpenAPI/Swagger Specs - Export to OpenAPI 3.0 format for tools like Swagger UI and Redoc&lt;br&gt;
📄 HTML Documentation - Beautiful, auto-generated HTML documentation with examples&lt;br&gt;
🔍 API Resource Detection - Extract response structures from your API Resources&lt;br&gt;
💾 Save Response Examples - Automatically save JSON responses to files&lt;br&gt;
🔐 Authentication Support - Automatically detect protected routes and add auth headers&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installation&lt;/strong&gt;&lt;br&gt;
Requirements&lt;/p&gt;

&lt;p&gt;PHP: 8.1 or higher&lt;br&gt;
Laravel: 10.0 or higher&lt;br&gt;
Database: MySQL 5.7+ / PostgreSQL 10+ / SQLite 3.8+&lt;br&gt;
Get up and running in just two commands:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require irabbi360/laravel-api-inspector&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run the interactive installer&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan api-inspector:install&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Quick Start&lt;br&gt;
View Documentation in Browser&lt;br&gt;
After generating documentation, visit:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;http://localhost:8000/api-docs&lt;/code&gt;&lt;br&gt;
Create a FormRequest with Validation Rules&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreUserRequest extends FormRequest
{
    public function rules()
    {
        return [
            'name' =&amp;gt; 'required|string|max:255',
            'email' =&amp;gt; 'required|email|unique:users',
            'password' =&amp;gt; 'required|min:8|confirmed',
            'age' =&amp;gt; 'integer|min:18|max:100',
        ];
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use FormRequest in Your Controller&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\Http\Controllers;

use App\Http\Requests\StoreUserRequest;

class UserController extends Controller
{
    public function store(StoreUserRequest $request)
    {
        return response()-&amp;gt;json([
            'success' =&amp;gt; true,
            'message' =&amp;gt; 'User created successfully',
            'data' =&amp;gt; User::create($request-&amp;gt;validated()),
        ], 201);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use Actions in Your Controller&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\Http\Controllers;

use App\Actions\CreateUser;

class UserController extends Controller
{
    public function store(Request $request, CreateUser $action)
    {
        $action-&amp;gt;create($request-&amp;gt;all());

        return response()-&amp;gt;json([
            'success' =&amp;gt; true,
            'message' =&amp;gt; 'User created successfully',
        ], 201);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Auto Response Schema generate. You can now add the annotation to your controller methods:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
    /**
     * Get user profile
     * @LAPIresponsesSchema ProfileResource
     */
    public function show(User $user)
    {
        return new ProfileResource($user);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or without the annotation, it will auto-detect from the return type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
    public function show(User $user): ProfileResource
    {
        return new ProfileResource($user);
    }
&amp;lt;?php
    /**
     * Get users list with pagination
     * @LAPIpagination
     */
    public function index()
    {
        $users = User::latest()-&amp;gt;paginate();
        return ProfileResource::collection($users);
    }
Query parameters
&amp;lt;?php
/**
 * Get users list
 * @LAPIQueryParams {
 *   "name": {"type": "string", "required": true, "description": "Filter by user name"},
 *   "page": {"type": "integer", "required": false, "example": 1},
 *   "limit": {"type": "integer", "required": false}
 * }
 */
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;public function index(Request $request) { ... }&lt;br&gt;
or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
/**
 * Get users list
 * @LAPIQueryParams name:string required, page:integer optional, limit:integer optional
 */
public function index(Request $request) { ... }
or

&amp;lt;?php
/**
 * // Simple format (new)
 * @LAPIQueryParams name, page, per_page, status
 */
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;public function index(Request $request) { ... }&lt;br&gt;
✅ Parse @LAPIresponsesSchema ResourceName from docblocks&lt;br&gt;
✅ Parse @LAPIpagination Pagination from docblocks&lt;br&gt;
✅ Parse @LAPIQueryParams query params from docblocks&lt;br&gt;
✅ Display response schema as JSON format&lt;br&gt;
✅ Recursively handle nested resources&lt;br&gt;
✅ Support unqualified resource names with auto-namespace resolution&lt;br&gt;
✅ Prevent infinite recursion with depth limit&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;View in Browser
After generating, automatically view your documentation:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="http://localhost:8000/api-docs" rel="noopener noreferrer"&gt;http://localhost:8000/api-docs&lt;/a&gt;&lt;br&gt;
That's it! 🎉 Your API is now documented and accessible via browser.&lt;/p&gt;

&lt;p&gt;Generate or Download API Collection&lt;br&gt;
The command generates documentation in three formats:&lt;/p&gt;

&lt;p&gt;API Stats - &lt;a href="http://localhost:8000/api-docs/stats" rel="noopener noreferrer"&gt;http://localhost:8000/api-docs/stats&lt;/a&gt; (view in browser) From Stats page download the Postman API Collections &amp;amp; OpenAPI Specification&lt;br&gt;
Files are also saved to storage/api-docs/ directory for backup.&lt;/p&gt;

&lt;p&gt;Configuration&lt;br&gt;
Edit config/api-inspector.php:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return [
    'enabled' =&amp;gt; true,

    'save_responses' =&amp;gt; true,        // Save example responses to JSON

    'save_responses_driver' =&amp;gt; 'json', // 'cache' or 'json' - Phase 2

    'middleware_capture' =&amp;gt; true,    // Capture real responses - Phase 2

    'response_ttl' =&amp;gt; 3600,          // Cache TTL in seconds (1 hour) - Phase 2

    'auth' =&amp;gt; [
        'type' =&amp;gt; 'bearer',
        'header' =&amp;gt; 'Authorization'
    ],

    'response_path' =&amp;gt; storage_path('api-docs'),
];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Runtime Response Capture &amp;amp; Caching&lt;br&gt;
Middleware Response Capture&lt;br&gt;
Automatically capture real API responses from your running endpoints:&lt;/p&gt;

&lt;p&gt;// The middleware automatically captures successful (2xx) JSON responses&lt;br&gt;
// Configuration in config/api-inspector.php:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'middleware_capture' =&amp;gt; true,  // Enable response capture
'save_responses_driver' =&amp;gt; 'json', // Store in files or cache
'response_ttl' =&amp;gt; 3600,       // Cache expiration time
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Features:&lt;/p&gt;

&lt;p&gt;✅ Captures real API responses automatically&lt;br&gt;
✅ Only captures successful (2xx) responses&lt;br&gt;
✅ Only targets API routes (configurable prefix)&lt;br&gt;
✅ Saves responses to JSON files or Laravel cache&lt;br&gt;
✅ Includes capture timestamp for freshness tracking&lt;br&gt;
✅ Graceful error handling (doesn't break your API)&lt;br&gt;
Using ResponseCache Class&lt;br&gt;
Programmatically manage cached responses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use Irabbi360\LaravelApiInspector\Support\ResponseCache;

class YourController extends Controller
{
    public function someAction(ResponseCache $responseCache)
    {
        // Store a response
        $responseCache-&amp;gt;store('api/users/index', 200, [
            'data' =&amp;gt; [/* ... */],
            'success' =&amp;gt; true
        ]);

        // Retrieve a cached response
        $cached = $responseCache-&amp;gt;get('api/users/index', 200);

        // Check if response is cached
        if ($responseCache-&amp;gt;has('api/users/index', 200)) {
            // Use cached response
        }

        // Get all responses for a route
        $allResponses = $responseCache-&amp;gt;getForRoute('api/users');

        // Clear responses for a route
        $responseCache-&amp;gt;clearForRoute('api/users');

        // Clear all cached responses
        $responseCache-&amp;gt;clearAll();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Storage Drivers&lt;br&gt;
JSON Driver (recommended for development/production)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'save_responses_driver' =&amp;gt; 'json'
// Stores in storage/api-docs/cached-responses/
// Persists across cache flushes
// Better for team sharing
Cache Driver (recommended for performance)

'save_responses_driver' =&amp;gt; 'cache'
// Uses your configured cache backend (redis, memcached, etc.)
// Faster access
// Configurable TTL per response
Example Workflow
Enable middleware capture:
// config/api-inspector.php
'middleware_capture' =&amp;gt; true,
Make requests to your API:
curl -X GET http://localhost:8000/api/users
curl -X POST http://localhost:8000/api/users \
  -H "Content-Type: application/json" \
  -d '{"name":"John","email":"john@example.com"}'
Responses are automatically captured:
storage/api-docs/cached-responses/
├── api_response:api_users:200.json
├── api_response:api_users:201.json
└── ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use captured responses in documentation:&lt;br&gt;
Postman collection now includes real example responses&lt;br&gt;
OpenAPI spec contains actual response schemas&lt;br&gt;
HTML docs show real data from your API&lt;br&gt;
Phase 3: Dashboard, Analytics &amp;amp; Advanced Features&lt;br&gt;
API Analytics &amp;amp; Monitoring&lt;br&gt;
Automatically track and monitor API performance:&lt;/p&gt;

&lt;p&gt;// Enable analytics in config/api-inspector.php&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'analytics' =&amp;gt; [
    'enabled' =&amp;gt; true,
    'track_response_time' =&amp;gt; true,
    'track_memory_usage' =&amp;gt; true,
    'track_errors' =&amp;gt; true,
    'retention_days' =&amp;gt; 30,
    'track_only_uri_start_with' =&amp;gt; 'api/',
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After enabling, the package will log request metrics to the database. You need add the middleware to your API routes:&lt;/p&gt;

&lt;p&gt;Irabbi360\LaravelApiInspector\Middleware\ApiInspectorAnalyticsMiddleware;&lt;br&gt;
Features:&lt;/p&gt;

&lt;p&gt;✅ Real-time request tracking&lt;br&gt;
✅ Response time analytics&lt;br&gt;
✅ Memory usage monitoring&lt;br&gt;
✅ Error rate calculation&lt;br&gt;
✅ Performance trends and insights&lt;br&gt;
✅ Automatic data retention management&lt;br&gt;
Web UI Dashboard&lt;br&gt;
Access the Telescope-like dashboard at /api-docs/stats:&lt;/p&gt;

&lt;p&gt;Dashboard Includes:&lt;/p&gt;

&lt;p&gt;Real-time request metrics&lt;br&gt;
Response time distribution charts&lt;br&gt;
Error rate monitoring&lt;br&gt;
Status code statistics&lt;br&gt;
Top slow routes identification&lt;br&gt;
Recent errors tracking&lt;br&gt;
Route-level performance analytics&lt;br&gt;
Customizable time ranges (1h, 24h, 7d, 30d)&lt;br&gt;
'dashboard' =&amp;gt; [&lt;br&gt;
    'enabled' =&amp;gt; true,&lt;br&gt;
    'auth_middleware' =&amp;gt; ['web'], // Protect dashboard access&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;A beautiful, responsive documentation site with:&lt;/p&gt;

&lt;p&gt;Request/response examples&lt;br&gt;
Parameter descriptions&lt;br&gt;
Authentication indicators&lt;br&gt;
Search and navigation&lt;br&gt;
Examples&lt;br&gt;
FormRequest to Documentation&lt;br&gt;
Your FormRequest:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
'email' =&amp;gt; 'required|email',
'age' =&amp;gt; 'integer|min:18|max:100'
Generated Documentation:

{
  "email": {
    "name": "email",
    "type": "string",
    "format": "email",
    "required": true,
    "example": "user@example.com",
    "description": "Email"
  },
  "age": {
    "name": "age",
    "type": "integer",
    "required": false,
    "min": 18,
    "max": 100,
    "example": 25,
    "description": "Age"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Validation Rules Mapping&lt;br&gt;
Laravel Rule    Generated Type  Format  Notes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;email   string  email   -
date    string  date    -
url string  uri -
numeric integer -   -
integer integer -   -
boolean boolean -   -
array   array   -   -
file    string  binary  -
image   string  binary  -
min:N   -   minLength: N    Works with strings, numbers, arrays
max:N   -   maxLength: N    Works with strings, numbers, arrays
size:N  -   -   Exact size for strings/numbers/arrays
regex:PATTERN   string  -   Regex pattern validation
in:val1,val2,...    -   enum    Creates enum values
confirmed   -   -   Requires {field}_confirmation field
same:field  -   -   Must match another field's value
different:field -   -   Must be different from another field
in_array:field.*    -   -   Values must be in another field's array
before:field    date    -   Must be before another field/date
after:field date    -   Must be after another field/date
before_or_equal:field   date    -   Must be ≤ another field/date
after_or_equal:field    date    -   Must be ≥ another field/date
required    -   -   Field is required
nullable    -   -   Field can be null
json    -   json    -
uuid    string  uuid    -
ipv4    string  ipv4    -
ipv6    string  ipv6    -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Relational Validation Rules&lt;br&gt;
When using relational rules like confirmed, same, different, etc., the generated documentation includes metadata about the relationship:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'password' =&amp;gt; ['required', 'string', 'min:8', 'confirmed']
Generated schema:

{
  "password": {
    "name": "password",
    "required": true,
    "type": "string",
    "min": 8,
    "confirmed": true,
    "requires_field": "password_confirmation",
    "description": "Password (must match password_confirmation)"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example: Complex Validation Rules&lt;br&gt;
Here's a real-world example with multiple relational validation rules:&lt;/p&gt;

&lt;p&gt;// In your FormRequest class&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function rules(): array
{
    return [
        'email' =&amp;gt; ['required', 'email'],
        'token' =&amp;gt; ['required', 'string'],
        'password' =&amp;gt; ['required', 'string', 'min:8', 'confirmed'],
        'password_confirmation' =&amp;gt; ['required', 'same:password'],
        'start_date' =&amp;gt; ['required', 'date', 'before:end_date'],
        'end_date' =&amp;gt; ['required', 'date', 'after:start_date'],
        'status' =&amp;gt; ['required', 'in:active,inactive,pending'],
    ];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generated documentation will include:&lt;/p&gt;

&lt;p&gt;✅ password field with requires_field: password_confirmation&lt;br&gt;
✅ password_confirmation field with same_as: password&lt;br&gt;
✅ start_date field with relationship to end_date&lt;br&gt;
✅ end_date field with relationship to start_date&lt;br&gt;
✅ status field with enum values: ['active', 'inactive', 'pending']&lt;br&gt;
Testing&lt;br&gt;
composer test          # Run all tests&lt;br&gt;
composer test-coverage # With code coverage&lt;br&gt;
composer analyse       # PHPStan static analysis&lt;br&gt;
composer format        # Format code with Pint&lt;br&gt;
Troubleshooting&lt;br&gt;
Routes not appearing&lt;br&gt;
Ensure routes have the api middleware&lt;br&gt;
Check that API_INSPECTOR_ENABLED=true in your .env&lt;br&gt;
Validation rules not extracted&lt;br&gt;
Make sure you're using FormRequest in the controller method&lt;br&gt;
Validate that the method name matches rules()&lt;br&gt;
Files not generating&lt;br&gt;
Check that storage/api-docs directory is writable&lt;br&gt;
Verify config settings in config/api-inspector.php&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>api</category>
      <category>php</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
