<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Devrabiul on Medium]]></title>
        <description><![CDATA[Stories by Devrabiul on Medium]]></description>
        <link>https://medium.com/@devrabiul?source=rss-e345510e7dd8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5RJSrw1ANMyXjbjLz4A46w.png</url>
            <title>Stories by Devrabiul on Medium</title>
            <link>https://medium.com/@devrabiul?source=rss-e345510e7dd8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 22:52:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@devrabiul/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Web to Desktop with NativePHP: A Laravel Developer’s Real Journey]]></title>
            <link>https://medium.com/@devrabiul/from-web-to-desktop-with-nativephp-a-laravel-developers-real-journey-a5d04c156a54?source=rss-e345510e7dd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5d04c156a54</guid>
            <category><![CDATA[build-app-with-php]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[nativephp-setup-guide]]></category>
            <category><![CDATA[nativephp]]></category>
            <dc:creator><![CDATA[Devrabiul]]></dc:creator>
            <pubDate>Sun, 08 Feb 2026 03:59:17 GMT</pubDate>
            <atom:updated>2026-02-08T03:59:17.161Z</atom:updated>
            <content:encoded><![CDATA[<h3>From Web to Desktop with NativePHP</h3><p>A Laravel Developer’s Journey, Real Experience, and Lessons Learned</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*PmOhgLXyGaec9TYYWNR_NQ.png" /><figcaption>From Web to Desktop with NativePHP</figcaption></figure><h3>Introduction — When PHP Left the Browser</h3><p>For most of my career as a PHP and Laravel developer, my world lived inside the browser. Web apps, APIs, dashboards, SaaS platforms — that was my comfort zone. Whenever someone mentioned <strong>desktop applications</strong>, my brain automatically jumped to Electron, C#, Java, or something far away from PHP.</p><p>Then I discovered <strong>NativePHP</strong>.</p><p>At first, I didn’t believe it.<br> “PHP… running as a desktop app? Without a server?”</p><p>Curiosity won. I decided to test NativePHP by converting one of my small Laravel projects — a simple CRM — into a desktop application.</p><p>What happened next surprised me more than I expected.</p><p>In this article, I’ll share:</p><ul><li>What NativePHP really is (in simple terms)</li><li>How I converted my Laravel project into a desktop app</li><li>The real pros, cons, and lessons I learned</li><li>When NativePHP is worth using — and when it’s not</li></ul><p>If you’re a PHP/Laravel developer, this might open a completely new door for you.</p><h3>Part 1 — Understanding NativePHP (Beyond the Hype)</h3><p>NativePHP is a framework that allows Laravel developers to <strong>package web applications as real desktop apps</strong> for Windows, macOS, and Linux — using PHP.</p><p>Instead of running your code on a remote server, NativePHP bundles:</p><ul><li>A PHP runtime</li><li>Your Laravel application</li><li>A frontend (HTML/CSS/JS)</li><li>A native desktop shell (Electron or Tauri)</li></ul><p>All of this becomes a <strong>single installable desktop application</strong>.</p><p>No Apache.<br> No PHP installation.<br> No browser required.</p><p>Just download → install → run.</p><p>For someone who has always used PHP on servers, this felt revolutionary.</p><h3>Why It Feels Natural for Laravel Developers</h3><p>NativePHP doesn’t force you to learn a new ecosystem. You still use:</p><ul><li>Blade templates</li><li>Eloquent ORM</li><li>Laravel routing</li><li>Controllers &amp; middleware</li><li>Livewire / Inertia (optional)</li></ul><p>It’s still Laravel — just not in the browser anymore.</p><p>That familiarity is what makes NativePHP powerful.</p><h3>Part 2 — My Hands-On Experience (Turning a Laravel CRM into Desktop)</h3><p>I wanted real experience, not theory. So I picked a small project — a <strong>basic CRM</strong>:</p><ul><li>Client list</li><li>Add/edit client form</li><li>Search &amp; filter</li><li>SQLite database</li></ul><p>It worked fine as a web app, but one client once asked:</p><blockquote><em>“Can I use this without opening a browser?”</em></blockquote><p>That question brought me to NativePHP.</p><h3>Step 1 — Installing NativePHP</h3><p>I started fresh:</p><pre>composer create-project laravel/laravel my-crm<br>composer require nativephp/electron<br>php artisan native:install</pre><p>This installed:</p><ul><li>Electron runtime</li><li>Node dependencies</li><li>NativePHP bridge</li></ul><p>Then I ran:</p><pre>php artisan native:serve</pre><p>And suddenly…</p><p>A desktop window opened.<br> My Laravel CRM was running as a desktop application.</p><p>No browser.<br> No server.</p><p>That moment genuinely impressed me.</p><h3>Step 2 — Making It Feel Like a Real Desktop App</h3><p>I didn’t want it to feel like just a web page inside a box. So I customized it.</p><p>In NativeAppServiceProvider:</p><pre>use Native\Laravel\Facades\Window;<br>use Native\Laravel\Facades\Menu;</pre><pre>public function boot(): void<br>{<br>    Window::open()<br>        -&gt;width(1000)<br>        -&gt;height(720)<br>        -&gt;title(&#39;My CRM Desktop&#39;);</pre><pre>    Menu::new()<br>        -&gt;add(&#39;Quit&#39;, fn () =&gt; app()-&gt;quit())<br>        -&gt;register();<br>}</pre><p>Changes I made:</p><ul><li>Bigger window</li><li>Custom title</li><li>Tray menu</li><li>Dark theme UI</li><li>Larger buttons (desktop friendly)</li></ul><p>Now it felt like a <strong>real product</strong>, not a web clone.</p><h3>Step 3 — Building the Installable App</h3><p>After testing, I packaged it:</p><pre>php artisan native:build</pre><p>Results:</p><ul><li>.exe for Windows</li><li>.dmg for macOS</li><li>.AppImage for Linux</li></ul><p>I sent it to my client.</p><p>They installed it like any normal software — no setup, no hosting, no browser.</p><p>Their reaction:</p><blockquote><em>“This feels faster and more professional than the web version.”</em></blockquote><p>That made the experiment worth it.</p><h3>Part 3 — Real Pros and Cons (Honest Developer View)</h3><p>After using NativePHP in a real scenario, here’s the truth.</p><h3>The Pros</h3><h4>1. Extremely Easy for Laravel Developers</h4><p>If you know Laravel, you already know 80% of NativePHP. No new language, no steep learning curve.</p><h4>2. Convert Web Apps to Desktop Fast</h4><p>A few commands and small tweaks — your web app becomes installable software.</p><h4>3. Cross-Platform from One Codebase</h4><p>Windows, macOS, Linux — same code, no rewriting.</p><h4>4. Expands PHP Beyond the Web</h4><p>For the first time, PHP can be used for desktop tools, internal software, offline apps, and SaaS clients.</p><h4>5. Clients Love Installable Apps</h4><p>Non-technical users prefer “Download &amp; Install” over “Open browser &amp; login”.</p><h3>The Cons</h3><h4>1. Still Young / Not Fully Mature</h4><p>Occasional bugs, build issues, and dependency problems (especially Node/Electron versions).</p><h4>2. Large App Size (Electron)</h4><p>My small CRM became <strong>~120 MB</strong>. That’s normal for Electron, but still heavy.</p><h4>3. Database Limitations</h4><p>SQLite works best. Using MySQL/Postgres requires extra configuration.</p><h4>4. Performance Isn’t Native-Level</h4><p>Not as fast as C++/Rust apps. But for CRUD, dashboards, and tools — totally fine.</p><h4>5. Desktop UX Requires Thought</h4><p>Web UI ≠ Desktop UX. You may need UI adjustments for real desktop feel.</p><h3>Lessons I Learned</h3><ul><li>PHP is no longer limited to the web.</li><li>Laravel knowledge becomes more valuable with NativePHP.</li><li>Desktop apps don’t require a completely new tech stack anymore.</li><li>Not every project needs NativePHP — but some benefit greatly.</li><li>Electron size is a tradeoff for simplicity.</li><li>NativePHP is <strong>perfect for internal tools, SaaS clients, and business apps</strong>.</li></ul><h3>When You Should Use NativePHP</h3><p>Use it if:</p><ul><li>You are a Laravel developer</li><li>You want a desktop version of your web app</li><li>You need offline capability</li><li>You build internal/company tools</li><li>You want faster development over maximum performance</li></ul><p>Avoid if:</p><ul><li>You need ultra-lightweight apps</li><li>You need heavy graphics / game-level performance</li><li>You want ultra-native UI control</li></ul><h3>Final Thoughts — Why NativePHP Excites Me</h3><p>Trying NativePHP changed how I see PHP.</p><p>For years, PHP meant <strong>server → browser → web app</strong>.<br> Now it can mean <strong>desktop software</strong> too.</p><p>My small CRM experiment proved:</p><ul><li>It’s practical</li><li>It’s powerful</li><li>It’s surprisingly simple</li></ul><p>Yes, NativePHP still has rough edges — but the potential is huge.</p><p>For Laravel developers, this isn’t just a tool.<br> It’s a new direction.</p><h3>What About You?</h3><p>Have you tried NativePHP yet?<br> Would you convert one of your Laravel apps into a desktop app?</p><p>I’d love to hear your experience and thoughts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5d04c156a54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ PHP 8.5 Just Changed the Game — Here’s Why Everyone’s Talking About It]]></title>
            <link>https://medium.com/@devrabiul/php-8-5-just-changed-the-game-heres-why-everyone-s-talking-about-it-1ceaf3ff0ce9?source=rss-e345510e7dd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ceaf3ff0ce9</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Devrabiul]]></dc:creator>
            <pubDate>Sat, 01 Nov 2025 05:59:31 GMT</pubDate>
            <atom:updated>2025-11-16T04:33:57.291Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 <strong>PHP 8.5 Just Leveled Up the Entire Language — The Features You Can’t Ignore</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y_zjHMXYZMHT00WdZOz9eg.png" /><figcaption>PHP 8.5 Just Changed the Game — Here’s Why Everyone’s Talking About It</figcaption></figure><h3>🚀 Introduction: A New Era for PHP Developers</h3><p>Let’s be honest — PHP has been through a lot.<br> For years, it carried the weight of old memes about being “outdated.” But with every new release, PHP has quietly reinvented itself — and <strong>PHP 8.5</strong> is where that transformation hits full stride.</p><p>This version doesn’t just polish the edges — it <em>changes the way we write PHP</em>.<br> Cleaner syntax. Smarter debugging. A brand-new pipe operator.<br> If you’re a developer building anything from Laravel apps to REST APIs, PHP 8.5 is about to make your life a lot easier.</p><p>Let’s dive into the updates that have the PHP world buzzing.</p><h3>🧩 The Pipe Operator (|&gt;) — Simplicity at Its Best</h3><p>Say goodbye to messy, nested function calls.<br> The <strong>pipe operator</strong> is here, and it’s an absolute game-changer for writing clean, readable PHP.</p><h3>Before PHP 8.5:</h3><pre>$user = ucfirst(strtolower(trim($username)));</pre><h3>Now, in PHP 8.5:</h3><pre>$user = $username<br>    |&gt; trim(...)<br>    |&gt; strtolower(...)<br>    |&gt; ucfirst(...);</pre><p>It’s expressive. It’s readable. And it’s <em>very</em> satisfying to write.</p><p>This new operator lets you chain transformations in a logical, left-to-right order — perfect for pipelines, data sanitization, or string transformations.</p><blockquote><em>💡 Think of it like Laravel’s collection pipelines, but now built right into the language itself.</em></blockquote><h3>⚙️ Small Things That Make a Big Difference</h3><p>Sometimes it’s the tiny things that change your daily coding experience.<br> PHP 8.5 introduces two small but incredibly handy functions:</p><pre>array_first($users);<br>array_last($users);</pre><p>That’s it.<br> No reset(), no end(), no weird pointer juggling.<br> Just straight-to-the-point array handling.</p><p><strong>array_first()</strong> and <strong>array_last()</strong> will quickly become part of your muscle memory.</p><h3>🧠 Debugging That Doesn’t Make You Cry</h3><p>PHP 8.5 brings a new level of transparency when things break.</p><h3>🪄 Full Stack Traces for Fatal Errors</h3><p>Fatal errors used to stop everything dead with zero context.<br> Now you get <strong>complete stack traces</strong>, even for those fatal issues — which means you can actually <em>see</em> where the problem started.</p><h3>🔍 New Tools for Error Handlers</h3><p>You can now introspect active handlers with:</p><pre>get_error_handler();<br>get_exception_handler();</pre><p>This makes debugging custom frameworks, event systems, or middleware logic much more predictable.</p><h3>⚡ Bonus Tip</h3><p>Run:</p><pre>php --ini=diff</pre><p>to instantly see configuration differences between your setup and PHP’s defaults.<br> This one’s a lifesaver when you’re debugging inconsistent environments.</p><h3>🌍 Smarter Internationalization</h3><p>If you’re building global apps, PHP 8.5 gives you new tools to handle languages and locales with elegance.</p><h3>New Locale Direction Detection</h3><pre>if (locale_is_right_to_left(&#39;ar&#39;)) {<br>    // Adjust layout for RTL languages<br>}</pre><h3>Meet IntlListFormatter</h3><pre>$formatter = new IntlListFormatter(&#39;en&#39;, IntlListFormatter::TYPE_AND);<br>echo $formatter-&gt;format([&#39;apples&#39;, &#39;bananas&#39;, &#39;cherries&#39;]);<br>// Output: apples, bananas, and cherries</pre><p>Localization just became a whole lot easier — no more hardcoding string joins or guessing text direction.</p><h3>🧰 Modern Language Improvements</h3><h3>🔹 Closures in Constant Expressions</h3><p>You can now use closures and first-class callables in constant expressions or attributes — perfect for metaprogramming and configuration-driven code.</p><h3>🔹 Final Property Promotion</h3><p>Constructor property promotion is now even better:</p><pre>class User {<br>    public function __construct(<br>        public final string $name,<br>        public final string $email<br>    ) {}<br>}</pre><p>Cleaner. Immutable. Modern.</p><h3>🌐 New URI Extension: A Welcome Addition</h3><p>PHP 8.5 adds a new <strong>URI</strong> extension based on modern web standards (RFC 3986 and WHATWG URL).<br> This makes parsing and working with URLs both safer and more consistent.</p><pre>use Php\Uri\Uri;</pre><pre>$url = new Uri(&#39;https://example.com/profile?id=42&#39;);<br>echo $url-&gt;getHost(); // example.com</pre><p>No more fragile regex or parse_url() surprises.</p><h3>⚠️ What’s Deprecated — and How to Prepare</h3><p>Every evolution leaves something behind.<br> Here’s what’s being phased out in PHP 8.5:</p><ul><li>(integer), (double), (boolean), (binary) → use (int), (float), (bool), (string)</li><li>Resource-based APIs continue moving toward object-based replacements.</li><li>Output buffering handlers must return <strong>strings</strong> only.</li></ul><p>✅ <strong>Migration Tip:</strong><br> Run your app through <strong>PHPStan</strong> or <strong>Psalm</strong> before upgrading, and test dependencies using the latest 8.5 RC build.</p><h3>🧩 Why PHP 8.5 Feels Different</h3><p>PHP 8.5 isn’t just another version number — it’s proof that PHP has truly matured.<br> It’s faster, smarter, and designed with developer happiness in mind.</p><p>From the pipe operator to cleaner error reporting, everything in this release feels purposeful — like the language is finally catching up to how we actually <em>think</em> when coding.</p><blockquote><em>“PHP 8.5 isn’t reinventing PHP — it’s refining it into something developers genuinely enjoy using.”</em></blockquote><h3>🎯 Final Thoughts</h3><p>If you’ve been waiting for the “right” time to upgrade, this is it.<br> PHP 8.5 delivers a perfect balance between performance, simplicity, and modern syntax.</p><p>Whether you’re scaling a Laravel SaaS, writing APIs, or maintaining legacy systems — this update gives you more control, less clutter, and a whole new appreciation for PHP’s evolution.</p><p>So yes, <strong>PHP 8.5 Just Leveled Up the Entire Language — The Features You Can’t Ignore</strong> — and it’s time to join the conversation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ceaf3ff0ce9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Translate 10,000 messages in under 100 seconds — easy, fast, lightweight with Laravel GeoGenius]]></title>
            <link>https://medium.com/@devrabiul/translate-10-000-messages-in-under-100-seconds-easy-fast-lightweight-with-laravel-geogenius-f555242bcb38?source=rss-e345510e7dd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/f555242bcb38</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[package]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Devrabiul]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 03:59:40 GMT</pubDate>
            <atom:updated>2025-09-18T03:59:40.454Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 Translate 10,000 messages in under 100 seconds — easy, fast, lightweight with Laravel GeoGenius</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GZNzdkG4xEfASxNQ6hGizw.png" /><figcaption>Laravel GeoGenius</figcaption></figure><h3>🌍 Laravel GeoGenius — Supercharge Your Laravel App with Geo-Location, Multilingual Translations, and Smarter Automation</h3><p>Building modern applications means going <strong>beyond CRUD</strong>. Today’s users expect <strong>personalized experiences</strong> — whether that’s content in their own language, the right currency for their country, or smart defaults based on location.</p><p>That’s where <a href="https://github.com/devrabiul/laravel-geo-genius"><strong>Laravel GeoGenius</strong></a> comes in.<br> A developer-friendly Laravel package designed to handle <strong>geo-location, translations, multilingual workflows, and global user experience</strong> — all in one place.</p><h3>🚀 Why Laravel GeoGenius?</h3><p>Laravel GeoGenius was built with one goal:<br> 👉 <strong>Make Laravel apps truly global, without complexity.</strong></p><p>Instead of piecing together multiple libraries and writing endless boilerplate, GeoGenius offers an <strong>integrated solution</strong> for:</p><ul><li>🌐 Geo-IP detection (location, timezone, country, currency)</li><li>📝 Automatic translation workflows</li><li>⚡ Powerful artisan commands for multilingual apps</li><li>📦 Developer-friendly tools for real-world production</li></ul><h3>✨ Key Features</h3><p>Let’s break down what Laravel GeoGenius brings to the table:</p><h3>🌍 1. Smart Geo-Location Services</h3><p>Automatically detect your visitors’ <strong>location, timezone, currency, and country</strong> with zero configuration.</p><ul><li>🕒 <strong>Timezone detection</strong> — Adjust app behavior based on user’s region.</li><li>💱 <strong>Currency auto-detection</strong> — Show users the right currency symbol (USD, EUR, BDT, etc.) instantly.</li><li>📍 <strong>Country code support</strong> — Useful for eCommerce, analytics, or personalization.</li><li>🔌 <strong>Plug &amp; play integration</strong> — Works seamlessly with Laravel’s session and middleware stack.</li></ul><h3>🗣 2. Multilingual &amp; Translation System</h3><p>Global apps need <strong>multiple languages</strong>. GeoGenius provides a <strong>complete translation workflow</strong> that removes friction.</p><ul><li>📝 <strong>Translate helper</strong> — Use translate(&#39;Hello World&#39;) anywhere in your app.</li><li>📂 <strong>Language files auto-management</strong> — Messages are stored in resources/lang/{locale}/messages.php.</li><li>🔎 <strong>Auto-detect missing translations</strong> — If a string isn’t translated, it’s added to new-messages.php.</li><li>⚡ <strong>Batch translation commands</strong> — Translate hundreds of strings automatically using artisan.</li></ul><h3>🛠 3. Artisan Commands for Productivity</h3><p>GeoGenius introduces <strong>developer-first artisan commands</strong> to make translations painless.</p><p>CommandDescriptiongeo:add-language {locale}Create a new language directory with starter files.geo:translations-generate --locale={locale}Scan your project for translate(&#39;...&#39;) calls and auto-generate messages.php.geo:translate-language {locale} --count={n}Translate up to n messages from new-messages.php into messages.php.geo:translate-language-batch {locale} --count={n}Translate a fixed batch of messages at a time.geo:translate-language-all {locale} --count={n}Keep translating until all messages are processed.</p><p>💡 With these commands, the workflow becomes:</p><ol><li>Add a language</li><li>Generate messages from codebase</li><li>Translate missing strings in batches</li></ol><p>No more manual file editing.</p><h3>🧩 4. Developer Experience Optimized</h3><p>GeoGenius isn’t just feature-rich — it’s <strong>developer-focused</strong>.</p><ul><li>📂 Automatic file handling (creates messages.php and new-messages.php if missing).</li><li>🔧 Configurable translation limits (--count option).</li><li>✅ Clear console feedback (progress, warnings, success/fail messages).</li><li>🔄 Backward compatible with Laravel’s native translation system (__() function still works).</li><li>🔌 Works with <strong>Livewire, Blade, Vue, or any frontend stack</strong>.</li></ul><h3>💡 5. Real-World Use Cases</h3><p>Here’s where Laravel GeoGenius really shines:</p><ul><li><strong>E-Commerce apps</strong> → Detect user’s country, auto-apply correct currency, and show localized product descriptions.</li><li><strong>SaaS platforms</strong> → Handle global customers with timezone-aware scheduling and multilingual dashboards.</li><li><strong>Content-driven websites</strong> → Auto-detect visitor language and serve translated content.</li><li><strong>Analytics &amp; Reporting</strong> → Track users by region, country, or timezone.</li></ul><h3>⚡ Getting Started</h3><p>Install via Composer:</p><pre>composer require devrabiul/laravel-geo-genius</pre><p>Publish assets:</p><pre>php artisan vendor:publish --provider=&quot;Devrabiul\\LaravelGeoGenius\\LaravelGeoGeniusServiceProvider&quot;</pre><p>Add a new language:</p><pre>php artisan geo:add-language en</pre><p>Generate messages from your codebase:</p><pre>php artisan geo:translations-generate --locale=en</pre><p>Translate missing strings:</p><pre>php artisan geo:translate-language-all en --count=300</pre><p>And that’s it — your app is <strong>location-aware and multilingual</strong> 🎉</p><h3>🔄 What’s New in v1.3</h3><p>Laravel GeoGenius keeps evolving.<br> The latest release (v1.3) introduces:</p><ul><li>📝 geo:translations-generate → Auto-generate messages.php by scanning your entire app.</li><li>🔄 geo:translate-language-all → Translate all missing strings in one go.</li><li>📦 Smarter file handling and improved developer experience.</li></ul><p>Full changelog: <a href="https://github.com/devrabiul/laravel-geo-genius/releases/tag/v1.3">v1.3 Release Notes</a></p><h3>🎯 Final Thoughts</h3><p>Building <strong>truly global apps</strong> in Laravel no longer needs to be complex.<br> With Laravel GeoGenius, you get:</p><ul><li>🌍 Geo-location</li><li>📝 Multilingual translation workflow</li><li>⚡ Powerful artisan commands</li><li>🔌 Seamless integration with Laravel</li></ul><p>All in a <strong>single, production-ready package</strong>.</p><p>👉 Try it out today: <a href="https://github.com/devrabiul/laravel-geo-genius">Laravel GeoGenius on GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f555242bcb38" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Laravel PWA Kit: Turn Any Laravel App into a Progressive Web App (PWA) in Minutes]]></title>
            <link>https://medium.com/@devrabiul/laravel-pwa-kit-turn-any-laravel-app-into-a-progressive-web-app-pwa-in-minutes-9a449b96e13a?source=rss-e345510e7dd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a449b96e13a</guid>
            <category><![CDATA[laravel-pwa-kit]]></category>
            <category><![CDATA[laravel-pwa]]></category>
            <category><![CDATA[laravel-installable-app]]></category>
            <category><![CDATA[progressive-web-app]]></category>
            <dc:creator><![CDATA[Devrabiul]]></dc:creator>
            <pubDate>Tue, 02 Sep 2025 07:59:06 GMT</pubDate>
            <atom:updated>2025-09-02T07:59:06.862Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZPLsbR1x315LrLHGW5_KgQ.png" /><figcaption>Laravel PWA Kit</figcaption></figure><p>Progressive Web Apps (PWAs) are no longer a buzzword — they’re the <strong>future of the web</strong>. From installable web apps to offline functionality, PWAs bring a <strong>native-like mobile app experience</strong> directly to the browser.</p><p>But here’s the challenge: setting up service workers, manifest files, caching, and offline pages manually can be a nightmare for busy developers.</p><p>That’s where <a href="http://github.com/devrabiul/laravel-pwa-kit"><strong>Laravel PWA Kit</strong></a> comes in. 🎉</p><p>Built for <strong>Laravel 8–12</strong>, this package helps developers add PWA functionality to their projects with <strong>just a few lines of code</strong>. Whether you’re building a SaaS, eCommerce site, portfolio, or admin dashboard — Laravel PWA Kit makes your app <strong>installable, offline-ready, and blazing fast</strong>.</p><h3>🔥 Why Developers Love PWAs</h3><p>Before we dive into the package, let’s recap why PWAs are a big deal:</p><ul><li><strong>Installable</strong>: Users can “Add to Home Screen” just like native apps.</li><li><strong>Offline Support</strong>: Works seamlessly even without internet.</li><li><strong>Push Notifications</strong>: Engage users better.</li><li><strong>Performance Boost</strong>: Faster load times thanks to caching strategies.</li><li><strong>Cross-Platform</strong>: Works on desktop, Android, and iOS.</li></ul><p>For businesses, PWAs mean <strong>higher engagement, retention, and conversions</strong>. For developers, they mean <strong>happier users with less complexity</strong>.</p><h3>🛠️ What Is Laravel PWA Kit?</h3><p><strong>Laravel PWA Kit</strong> is a <strong>lightweight, customizable Laravel package</strong> that gives your app <strong>modern PWA features out of the box</strong>.</p><p>✅ Key Features:</p><ul><li>Auto-generated <strong>Manifest &amp; Service Worker</strong></li><li>Install prompt via <strong>toast notifications</strong> (no manual JavaScript needed)</li><li><strong>Offline fallback page</strong></li><li>Works with <strong>Livewire, Vue 3, and React</strong></li><li>Easy setup with <strong>Blade directives</strong></li><li>Fully <strong>configurable</strong> via config/laravel-pwa-kit.php</li><li>Supports <strong>Laravel 8–12</strong></li></ul><blockquote><em>💡 Unlike other Laravel PWA packages, Laravel PWA Kit is </em><strong><em>SPA-friendly</em></strong><em>, supports </em><strong><em>Livewire</em></strong><em>, and comes with built-in UI prompts for installability.</em></blockquote><h3>⚡ Installation Guide</h3><p>Follow these simple steps to turn your Laravel app into a PWA.</p><h3>1️⃣ Install the Package</h3><pre>composer require devrabiul/laravel-pwa-kit</pre><h3>2️⃣ Publish Config &amp; Assets</h3><pre>php artisan vendor:publish --provider=&quot;Devrabiul\PwaKit\PwaKitServiceProvider&quot;</pre><p>This generates:</p><ul><li>config/laravel-pwa-kit.php</li><li>manifest.json</li><li>sw.js (Service Worker)</li><li>offline.html</li><li>logo.png</li></ul><h3>3️⃣ Configure PWA Settings</h3><p>Inside config/laravel-pwa-kit.php you can define:</p><ul><li>App name &amp; short name</li><li>Theme color &amp; background color</li><li>Offline page</li><li>Install prompt toggle</li><li>Icons &amp; sizes</li></ul><p>Example:</p><pre>return [<br>  &#39;enable_pwa&#39; =&gt; true,<br>  &#39;install-toast-show&#39; =&gt; true,<br>  &#39;manifest&#39; =&gt; [<br>    &#39;name&#39; =&gt; &#39;My Laravel App&#39;,<br>    &#39;short_name&#39; =&gt; &#39;LaravelPWA&#39;,<br>    &#39;start_url&#39; =&gt; &#39;/&#39;,<br>    &#39;theme_color&#39; =&gt; &#39;#4F46E5&#39;,<br>    &#39;background_color&#39; =&gt; &#39;#ffffff&#39;,<br>    &#39;display&#39; =&gt; &#39;standalone&#39;,<br>    &#39;icons&#39; =&gt; [<br>      [&#39;src&#39; =&gt; &#39;logo.png&#39;, &#39;sizes&#39; =&gt; &#39;512x512&#39;, &#39;type&#39; =&gt; &#39;image/png&#39;]<br>    ],<br>  ],<br>  &#39;livewire-app&#39; =&gt; false,<br>];</pre><h3>4️⃣ Add Blade Directives</h3><p>In your main layout file:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  {!! PwaKit::head() !!}<br>&lt;/head&gt;<br>&lt;body&gt;<br>  @yield(&#39;content&#39;)<br><br>{!! PwaKit::scripts() !!}<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h3>5️⃣ Add Install Buttons (Optional)</h3><p>Want a custom install button? Just add:</p><pre>&lt;button class=&quot;force-install-pwa-app&quot;&gt;Install App&lt;/button&gt;</pre><p>Laravel PWA Kit handles the JavaScript magic for you. 🎩✨</p><h3>6️⃣ Livewire &amp; SPA Support</h3><p>If your project uses <strong>Livewire SPA</strong>, simply set:</p><pre>&#39;livewire-app&#39; =&gt; true,</pre><p>That’s it — your SPA now behaves like a native app! 🚀</p><h3>📊 Laravel PWA Kit vs Other Packages</h3><p>When comparing Laravel PWA Kit with other popular Laravel PWA packages, it quickly stands out for developers. Unlike most alternatives, it comes with a built-in install prompt toast, so users can easily add your app to their home screen without extra JavaScript. It also offers full SPA and Livewire support, while other packages provide only limited or partial compatibility. Laravel PWA Kit ships with a ready-to-use offline page, whereas many others only provide a very basic fallback. Both support Laravel 8–12, but when it comes to developer experience, Laravel PWA Kit feels smoother, easier to configure, and far more customizable — making it the go-to choice for modern Laravel projects.</p><h3>🌱 Bonus: Treeware Initiative</h3><p>Laravel PWA Kit is <strong>Treeware</strong> — you can use it for free, but if it makes your life easier, consider <strong>planting a tree</strong> to give back to the environment. 🌍🌳</p><h3>✅ Conclusion</h3><p>If you’re building with Laravel and want to:</p><ul><li>Improve <strong>user engagement</strong></li><li>Deliver <strong>offline-ready apps</strong></li><li>Offer a <strong>native-like install experience</strong></li></ul><p>…then <strong>Laravel PWA Kit is the perfect package for you</strong>.</p><p>👉 Get started here: <a href="http://github.com/devrabiul/laravel-pwa-kit">Laravel PWA Kit on GitHub</a></p><h3>✨ Final Thoughts</h3><p>PWAs are the <strong>bridge between web apps and native apps</strong>. With <strong>Laravel PWA Kit</strong>, you don’t need to wrestle with complex service worker code or manual manifest files — it’s all automated, customizable, and Laravel-friendly.</p><p>So next time you spin up a Laravel project, make it <strong>installable, reliable, and future-ready</strong> with Laravel PWA Kit. 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a449b96e13a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[20 Essential Next.js Hooks That Power 90% of Modern Components]]></title>
            <link>https://medium.com/@devrabiul/20-essential-next-js-hooks-that-power-90-of-modern-components-df0b9fb5db6e?source=rss-e345510e7dd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/df0b9fb5db6e</guid>
            <category><![CDATA[hooks-in-react]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[components]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Devrabiul]]></dc:creator>
            <pubDate>Sun, 13 Jul 2025 03:57:16 GMT</pubDate>
            <atom:updated>2025-07-13T03:57:16.200Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="20 Essential Next.js Hooks That Power 90% of Modern Components" src="https://cdn-images-1.medium.com/max/1024/1*CPuBJr16uqZsX3nXy4mv6Q.png" /><figcaption>20 Essential Next.js Hooks That Power 90% of Modern Components</figcaption></figure><p>Modern Next.js applications are built on a robust foundation of React and Next.js-specific hooks. These hooks help manage state, handle routing, perform data fetching, and more — all while keeping your components clean and performant. In this post, we’ll explore <strong>20 powerful hooks</strong> that are used across most Next.js projects and explain how to use them effectively.</p><h3>1. useRouter (from next/router)</h3><p>Use this hook to interact with the Next.js router. It gives access to route parameters, current paths, and programmatic navigation.</p><pre>import { useRouter } from &#39;next/router&#39;;</pre><pre>const Component = () =&gt; {<br>  const router = useRouter();<br>  const { id } = router.query;</pre><pre>  return &lt;p&gt;Post ID: {id}&lt;/p&gt;;<br>};</pre><h3>2. useEffect</h3><p>React’s useEffect is a side-effect hook. It’s commonly used for data fetching, event listeners, or DOM manipulation after render.</p><pre>useEffect(() =&gt; {<br>  // Runs after component mounts<br>  fetchData();<br>}, []); // Empty array ensures it only runs once</pre><h3>3. useState</h3><p>Manages local component state.</p><pre>const [count, setCount] = useState(0);</pre><h3>4. useCallback</h3><p>Prevents unnecessary re-renders by memoizing functions.</p><pre>const handleClick = useCallback(() =&gt; {<br>  console.log(&#39;Clicked&#39;);<br>}, []);</pre><h3>5. useMemo</h3><p>Memoizes expensive calculations.</p><pre>const filteredData = useMemo(() =&gt; {<br>  return data.filter(item =&gt; item.active);<br>}, [data]);</pre><h3>6. useRef</h3><p>Used to persist a mutable value or reference DOM nodes.</p><pre>const inputRef = useRef(null);<br>&lt;input ref={inputRef} /&gt;</pre><h3>7. useLayoutEffect</h3><p>Runs synchronously <strong>after all DOM mutations</strong>. Useful for layout measurements.</p><pre>useLayoutEffect(() =&gt; {<br>  // Runs before browser paints<br>}, []);</pre><h3>8. useContext</h3><p>Shares state across components using React Context.</p><pre>const { user } = useContext(AuthContext);</pre><h3>9. useSWR (from swr library)</h3><p>A client-side data fetching hook with caching and revalidation.</p><pre>import useSWR from &#39;swr&#39;;</pre><pre>const { data, error } = useSWR(&#39;/api/user&#39;, fetcher);</pre><h3>10. useSession (from next-auth/react)</h3><p>Gets session data (used in authenticated apps).</p><pre>import { useSession } from &#39;next-auth/react&#39;;</pre><pre>const { data: session } = useSession();</pre><h3>11. useForm (from react-hook-form)</h3><p>Powerful hook for managing forms efficiently.</p><pre>const { register, handleSubmit } = useForm();</pre><h3>12. useReducer</h3><p>An alternative to useState for more complex state logic.</p><pre>const [state, dispatch] = useReducer(reducer, initialState);</pre><h3>13. useSearchParams (App Router only)</h3><p>Access and manipulate URL query params.</p><pre>const searchParams = useSearchParams();</pre><h3>14. usePathname (App Router only)</h3><p>Get the current URL path.</p><pre>const pathname = usePathname();</pre><h3>15. useParams (App Router only)</h3><p>Access dynamic route segments.</p><pre>const params = useParams(); // e.g., { id: &#39;123&#39; }</pre><h3>16. useDeferredValue</h3><p>Delays updating a value for performance tuning in concurrent rendering.</p><pre>const deferredSearch = useDeferredValue(search);</pre><h3>17. useId</h3><p>Generates unique IDs for accessibility (SSR-safe).</p><pre>const id = useId();</pre><h3>18. useImperativeHandle</h3><p>Customizes the instance value exposed when using ref in parent.</p><pre>useImperativeHandle(ref, () =&gt; ({ focus: () =&gt; inputRef.current.focus() }));</pre><h3>19. useEventListener (Custom)</h3><p>Custom hook to simplify event listeners.</p><pre>useEventListener(&#39;keydown&#39;, handleKeyPress);</pre><h3>20. useMediaQuery (Custom or via usehooks-ts)</h3><p>Detect viewport size changes.</p><pre>const isMobile = useMediaQuery(&#39;(max-width: 768px)&#39;);</pre><h3>Final Thoughts</h3><p>These hooks are the building blocks of modern Next.js development. Whether you’re building a landing page, a SaaS dashboard, or a full-stack app, mastering these will supercharge your productivity.</p><p>You can combine them to build robust features. For example:</p><pre>const { data: session } = useSession();<br>const router = useRouter();</pre><pre>useEffect(() =&gt; {<br>  if (!session) router.push(&#39;/login&#39;);<br>}, [session]);</pre><p>Stay tuned for a cheat sheet and interactive examples in upcoming posts!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df0b9fb5db6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ CORS কী ? ওয়েব ডেভেলপমেন্টে CORS সমস্যাগুলি কীভাবে সমাধান করবেন — সহজ ভাষায় বিস্তারিত]]></title>
            <link>https://medium.com/@devrabiul/cors-%E0%A6%95%E0%A7%80-%E0%A6%93%E0%A6%AF%E0%A6%BC%E0%A7%87%E0%A6%AC-%E0%A6%A1%E0%A7%87%E0%A6%AD%E0%A7%87%E0%A6%B2%E0%A6%AA%E0%A6%AE%E0%A7%87%E0%A6%A8%E0%A7%8D%E0%A6%9F%E0%A7%87-cors-%E0%A6%B8%E0%A6%AE%E0%A6%B8%E0%A7%8D%E0%A6%AF%E0%A6%BE%E0%A6%97%E0%A7%81%E0%A6%B2%E0%A6%BF-%E0%A6%95%E0%A7%80%E0%A6%AD%E0%A6%BE%E0%A6%AC%E0%A7%87-%E0%A6%B8%E0%A6%AE%E0%A6%BE%E0%A6%A7%E0%A6%BE%E0%A6%A8-%E0%A6%95%E0%A6%B0%E0%A6%AC%E0%A7%87%E0%A6%A8-%E0%A6%B8%E0%A6%B9%E0%A6%9C-%E0%A6%AD%E0%A6%BE%E0%A6%B7%E0%A6%BE%E0%A7%9F-%E0%A6%AC%E0%A6%BF%E0%A6%B8%E0%A7%8D%E0%A6%A4%E0%A6%BE%E0%A6%B0%E0%A6%BF%E0%A6%A4-29bd78fc1361?source=rss-e345510e7dd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/29bd78fc1361</guid>
            <category><![CDATA[laravel-cors]]></category>
            <category><![CDATA[web-api-security]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[cors]]></category>
            <dc:creator><![CDATA[Devrabiul]]></dc:creator>
            <pubDate>Thu, 03 Jul 2025 05:00:11 GMT</pubDate>
            <atom:updated>2025-07-03T05:00:11.071Z</atom:updated>
            <content:encoded><![CDATA[<h3>🌐 CORS কী ? ওয়েব ডেভেলপমেন্টে CORS সমস্যাগুলি কীভাবে সমাধান করবেন — সহজ ভাষায় বিস্তারিত</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dy0B05WUe2s-5mZO5Uhdkg.png" /></figure><p>ইন্টারনেটে ওয়েব ডেভেলপমেন্ট করতে গেলে সবচেয়ে সাধারণ অথচ ভয় ধরানো যে এরর দেখা যায়, সেটি হলো <strong>CORS issue</strong>। অনেক নতুন ডেভেলপার এই সমস্যায় প্রথমে হতবাক হয়ে যান।<br> তাই আজকে চলুন খুব সহজ ভাষায় বোঝার চেষ্টা করি —</p><p>✅ CORS আসলে কী?<br> ✅ কেন এই সমস্যা হয়?<br> ✅ এর মূল কারণগুলো কী?<br> ✅ কিভাবে সমাধান করা যায়?</p><h3>🚀 CORS কী?</h3><p><strong>CORS</strong> এর পূর্ণরূপ হলো:</p><pre>Cross-Origin Resource Sharing</pre><p>এটি একটি <strong>ব্রাউজার-নির্ধারিত নিরাপত্তা পলিসি</strong>, যা ওয়েব পেজ যখন অন্য একটি origin থেকে ডেটা নিতে চায়, তখন কিছু নিয়মকানুন আরোপ করে।</p><h3>🎯 Origin কী?</h3><p>origin বলতে বোঝায় একটি ওয়েবসাইটের:</p><ul><li>স্কিম (http/https)</li><li>হোস্ট (ডোমেইন)</li><li>পোর্ট</li></ul><p>👉 অর্থাৎ,</p><pre>http://example.com:80</pre><p>এবং</p><pre>https://example.com:443</pre><p>দুটি আলাদা origin।</p><h3>🔥 CORS issue কী?</h3><p>যখন একটি ওয়েব পেজ <strong>AJAX (Fetch / XMLHttpRequest)</strong> বা অন্য কোনোভাবে <strong>JavaScript থেকে API call</strong> করে এমন একটি ডোমেইনে, যা তার origin এর বাইরে — তখন ব্রাউজার সেই রিকোয়েস্ট ব্লক করে যদি না সার্ভার স্পষ্টভাবে বলে:</p><blockquote><em>হ্যাঁ, এই origin থেকে রিকোয়েস্ট নিতে আমি রাজি।</em></blockquote><p>যদি সার্ভার সেটি না বলে, তখন দেখা যায় এই ভয়ংকর এরর:</p><pre>Access to fetch at &#39;https://api.othersite.com/data&#39; from origin &#39;https://mysite.com&#39; has been blocked by CORS policy...</pre><p>এটিই হলো <strong>CORS issue</strong>।</p><h3>🧐 কেন ব্রাউজার CORS issue দেয়?</h3><p>এই নিয়মটা রাখা হয়েছে <strong>নিরাপত্তার জন্য</strong>।<br> ধরো তুমি ফেসবুকে লগইন করেছো। এখন তুমি যদি কোনো ক্ষতিকর সাইটে ঢোকো, সেই সাইট যদি জাভাস্ক্রিপ্ট দিয়ে ফেসবুকের API-তে রিকোয়েস্ট করে, তাহলে তোমার অথেনটিকেটেড সেশন ব্যবহার করে ফেসবুকের ডেটা চুরি করতে পারতো।<br> তাই ব্রাউজার ডিফল্টভাবে অন্য origin থেকে রিকোয়েস্ট ব্লক করে দেয়, যতক্ষণ না সার্ভার সেটিকে অনুমতি দেয়।</p><h3>🚩 কখন এই সমস্যা হয়?</h3><h3>✋ ভিন্ন ডোমেইনে রিকোয়েস্ট করলে</h3><p>যেমন:</p><ul><li>frontend: <a href="https://myfrontend.com/">https://myfrontend.com</a></li><li>backend: <a href="https://api.mybackend.com/">https://api.mybackend.com</a></li></ul><p>তখন ব্রাউজার CORS পলিসি চেক করে।</p><h3>✋ ভিন্ন সাবডোমেইন হলেও</h3><ul><li><a href="https://shop.example.com/">https://shop.example.com</a></li><li>https://api.example.com<br> দুটি আলাদা origin ধরা হয়।</li></ul><h3>✋ HTTP থেকে HTTPS এ বা পোর্ট আলাদা হলে</h3><ul><li><a href="http://example.com/">http://example.com</a></li><li><a href="https://example.com/">https://example.com</a></li><li>https://example.com:8080<br> সব আলাদা origin।</li></ul><h3>💣 CORS issue এর কারণগুলো (ডিটেল টেবিল সহ)</h3><p>কারণ ব্যাখ্যা 🚫 সার্ভার Access-Control-Allow-Origin হেডার পাঠায়নি তখন ব্রাউজার সেটি ব্লক করে 🚫 preflight (OPTIONS) রিকোয়েস্ট এর উত্তর সঠিক না PUT, DELETE, JSON ইত্যাদিতে ব্রাউজার আগে OPTIONS পাঠায় 🚫 Allow-Headers/Methods ঠিকমতো নেই যেমন ক্লায়েন্ট custom header পাঠাচ্ছে, কিন্তু সার্ভার অনুমোদন করেনি 🚫 Cookie বা Auth থাকলে Allow-Credentials না থাকলে তখন withCredentials: true এর রিকোয়েস্ট ব্যর্থ হয় 🚫 wildcard * use করলে Credentials ফেইল Cookie সহ রিকোয়েস্টে * ব্যবহার করা যাবে না 🚫 সার্ভারে CORS middleware নেই যেমন Laravel, Node.js এ cors setup করা হয়নি</p><h3>🎯 উদাহরণ: সার্ভার থেকে কিভাবে অনুমতি দিতে হয়</h3><h3>✅ Simple example:</h3><pre>Access-Control-Allow-Origin: https://myfrontend.com</pre><p>তাহলে এই origin থেকে রিকোয়েস্ট অনুমোদিত হবে।</p><h3>✅ multiple origin handle (server side logic এ):</h3><pre>$origin = $_SERVER[&#39;HTTP_ORIGIN&#39;];<br>$allowed = [&#39;https://myfrontend.com&#39;, &#39;https://app.mysite.com&#39;];<br>if (in_array($origin, $allowed)) {<br>    header(&quot;Access-Control-Allow-Origin: $origin&quot;);<br>    header(&quot;Access-Control-Allow-Credentials: true&quot;);<br>}</pre><h3>✅ প্রিফ্লাইটের জন্য:</h3><pre>Access-Control-Allow-Methods: GET, POST, PUT, DELETE<br>Access-Control-Allow-Headers: Content-Type, Authorization</pre><h3>🚀 Laravel এ CORS সেটআপ কিভাবে?</h3><p>composer require fruitcake/laravel-cors</p><p>এরপর config/cors.php ফাইল কনফিগার করুন:</p><pre>&#39;paths&#39; =&gt; [&#39;api/*&#39;, &#39;sanctum/csrf-cookie&#39;],<br>&#39;allowed_origins&#39; =&gt; [&#39;https://myfrontend.com&#39;],<br>&#39;allowed_methods&#39; =&gt; [&#39;*&#39;],<br>&#39;allowed_headers&#39; =&gt; [&#39;*&#39;],<br>&#39;supports_credentials&#39; =&gt; true,</pre><h3>🚀 Node.js (Express) এ কিভাবে?</h3><pre>const cors = require(&#39;cors&#39;);<br>app.use(cors({<br>    origin: &#39;https://myfrontend.com&#39;,<br>    credentials: true<br>}));</pre><h3>✅ CORS সমস্যা সমাধানের সারসংক্ষেপ</h3><p>কাজ লক্ষ্য 🔧 সার্ভারে CORS header দিতে হবে যাতে ব্রাউজার বিশ্বাস করে 🔧 OPTIONS প্রিফ্লাইট handle করতে হবে PUT/DELETE/JSON request এ 🔧 credentials হলে Access-Control-Allow-Credentials: true দিতে হবে cookie, session ক্ষেত্রে 🔧 * avoid করে স্পেসিফিক origin দিতে হবে সিকিউরিটির জন্য</p><h3>🌸 উপসংহার</h3><p>CORS মূলত ব্রাউজারের নিরাপত্তা, যা আমাদেরই জন্য উপকারী।<br> কিন্তু যখন নিজের প্রজেক্টে API কল করি, তখন সেটি ঠিকমতো কনফিগার না করলে বিরক্তিকর হয়ে ওঠে।</p><p>তবে ভয় পাবার কিছু নেই।<br> সার্ভার সঠিকভাবে Access-Control-* হেডার দিলে সহজেই সমাধান হয়ে যাবে।</p><h3>❤️ ধন্যবাদ</h3><p>এই পোস্ট যদি তোমার উপকারে আসে, তাহলে বন্ধুদের সাথে শেয়ার করো।<br> আর কোনো প্রশ্ন থাকলে কমেন্টে জানাও — চেষ্টা করবো উত্তর দিতে।</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29bd78fc1361" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ What is CORS? How to Fix CORS Issues in Web Development (Easy Guide)]]></title>
            <link>https://medium.com/@devrabiul/what-is-cors-how-to-fix-cors-issues-in-web-development-easy-guide-403b2889d34b?source=rss-e345510e7dd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/403b2889d34b</guid>
            <category><![CDATA[laravel-cors]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-api-security]]></category>
            <dc:creator><![CDATA[Devrabiul]]></dc:creator>
            <pubDate>Thu, 03 Jul 2025 05:00:08 GMT</pubDate>
            <atom:updated>2025-07-03T05:00:08.158Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dy0B05WUe2s-5mZO5Uhdkg.png" /></figure><p>If you’ve ever done web development, you’ve almost certainly encountered the dreaded <strong>CORS issue</strong>. Many developers — especially those new to working with APIs — get stuck here.<br> So let’s explore in simple language:</p><p>✅ What is CORS?<br> ✅ Why does this issue occur?<br> ✅ What are the main reasons?<br> ✅ How can you fix it?</p><h3>🚀 What is CORS?</h3><p><strong>CORS</strong> stands for:</p><pre>Cross-Origin Resource Sharing</pre><p>It’s a <strong>browser security mechanism</strong> that enforces rules whenever a web page tries to make requests to a server on a different origin.</p><h3>🎯 What does origin mean?</h3><p>An origin is defined by three things:</p><ul><li>Scheme (http / https)</li><li>Host (domain)</li><li>Port</li></ul><p>👉 For example:</p><pre>http://example.com:80</pre><p>and</p><pre>https://example.com:443</pre><p>are two <strong>different origins</strong>.</p><h3>🔥 What is a CORS issue?</h3><p>When a web page tries to make an <strong>AJAX (Fetch / XMLHttpRequest)</strong> or similar JavaScript request to a different origin (domain, subdomain, port, or scheme), the browser blocks it <strong>unless the server explicitly says:</strong></p><blockquote><em>Yes, I allow requests from this origin.</em></blockquote><p>If the server doesn’t say that, you’ll see scary errors like:</p><pre>Access to fetch at &#39;https://api.othersite.com/data&#39; from origin &#39;https://mysite.com&#39; has been blocked by CORS policy...</pre><p>That’s a <strong>CORS issue</strong>.</p><h3>🧐 Why does the browser enforce this?</h3><p>It’s actually for <strong>your security</strong>.<br> Imagine you’re logged into Facebook. Now if you visit a malicious site, and it uses JavaScript to make API calls to Facebook using your authenticated session, it could steal your data or perform actions on your behalf.</p><p>The browser blocks these <strong>cross-origin requests by default</strong>, unless the server explicitly allows it. This prevents CSRF (Cross-Site Request Forgery) style attacks.</p><h3>🚩 When do you encounter this problem?</h3><h3>✋ When making requests to a different domain</h3><p>For example:</p><ul><li>Frontend: <a href="https://myfrontend.com/">https://myfrontend.com</a></li><li>Backend/API: <a href="https://api.mybackend.com/">https://api.mybackend.com</a></li></ul><p>The browser checks CORS policy.</p><h3>✋ Even different subdomains trigger it</h3><ul><li><a href="https://shop.example.com/">https://shop.example.com</a></li><li>https://api.example.com<br> are considered <strong>different origins</strong>.</li></ul><h3>✋ Different protocols or ports count too</h3><ul><li><a href="http://example.com/">http://example.com</a></li><li><a href="https://example.com/">https://example.com</a></li><li>https://example.com:8080<br> are all treated as different origins.</li></ul><h3>💣 Causes of CORS issues (detailed table)</h3><p>Cause Explanation 🚫 Server doesn’t send Access-Control-Allow-Origin header Browser blocks it 🚫 Preflight (OPTIONS) request fails For PUT, DELETE, JSON, the browser sends an OPTIONS request first 🚫 Missing Allow-Headers or Allow-Methods The client might send custom headers not allowed by the server 🚫 Using cookies or auth but missing Allow-Credentials If withCredentials: true, server must explicitly allow 🚫 Using wildcard * with credentials Cookies + * for origin is not allowed 🚫 Server doesn’t have CORS middleware set up In Laravel, Node.js, Django, etc.</p><h3>🎯 Example: How the server allows it</h3><h3>✅ Simple example:</h3><pre>Access-Control-Allow-Origin: https://myfrontend.com</pre><p>This tells the browser that requests from https://myfrontend.com are allowed.</p><h3>✅ Handling multiple origins (pseudo PHP logic):</h3><pre>$origin = $_SERVER[&#39;HTTP_ORIGIN&#39;];<br>$allowed = [&#39;https://myfrontend.com&#39;, &#39;https://app.mysite.com&#39;];<br>if (in_array($origin, $allowed)) {<br>    header(&quot;Access-Control-Allow-Origin: $origin&quot;);<br>    header(&quot;Access-Control-Allow-Credentials: true&quot;);<br>}</pre><h3>✅ For preflight requests:</h3><pre>Access-Control-Allow-Methods: GET, POST, PUT, DELETE<br>Access-Control-Allow-Headers: Content-Type, Authorization</pre><h3>🚀 How to set up CORS in Laravel?</h3><pre>composer require fruitcake/laravel-cors</pre><p>Then configure config/cors.php:</p><pre>&#39;paths&#39; =&gt; [&#39;api/*&#39;, &#39;sanctum/csrf-cookie&#39;],<br>&#39;allowed_origins&#39; =&gt; [&#39;https://myfrontend.com&#39;],<br>&#39;allowed_methods&#39; =&gt; [&#39;*&#39;],<br>&#39;allowed_headers&#39; =&gt; [&#39;*&#39;],<br>&#39;supports_credentials&#39; =&gt; true,</pre><h3>🚀 How to set up CORS in Node.js (Express)?</h3><pre>const cors = require(&#39;cors&#39;);<br>app.use(cors({<br>    origin: &#39;https://myfrontend.com&#39;,<br>    credentials: true<br>}));</pre><h3>✅ Summary of how to fix CORS problems</h3><p>What to do Why 🔧 Make sure server sends correct CORS headers So the browser trusts the response 🔧 Handle OPTIONS preflight requests properly Required for PUT/DELETE/JSON requests 🔧 Use Access-Control-Allow-Credentials: true if sending cookies or auth headers Otherwise, browser will block 🔧 Avoid wildcard * for origin when using cookies Must specify exact origins for security</p><h3>🌸 Final thoughts</h3><p>CORS is ultimately a <strong>browser security feature</strong> designed to protect us.<br> But when working on your own projects with separate frontends and APIs, it can become frustrating if not configured correctly.</p><p>Don’t worry — <br> just ensure your server sends the proper Access-Control-* headers, and it’ll be resolved.</p><h3>❤️ Thank you!</h3><p>If this post helped you, please share it with your developer friends.<br> Have questions or run into stubborn CORS problems? Drop a comment — I’d love to help!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=403b2889d34b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Fixing Livewire.js Not Loading — Meet livewire-doctor for Laravel]]></title>
            <link>https://medium.com/@devrabiul/fixing-livewire-js-not-loading-meet-livewire-doctor-for-laravel-1ed9737c591d?source=rss-e345510e7dd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ed9737c591d</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[livewire]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[best-package]]></category>
            <dc:creator><![CDATA[Devrabiul]]></dc:creator>
            <pubDate>Sun, 01 Jun 2025 05:00:07 GMT</pubDate>
            <atom:updated>2025-06-01T05:00:07.991Z</atom:updated>
            <content:encoded><![CDATA[<h3>🩺 Fixing Livewire.js Not Loading — Meet livewire-doctor for Laravel</h3><figure><img alt="LivewireDoctor: Your smart assistant for Laravel Livewire. Detects &amp; auto-fixes issues like missing assets, bad directives &amp; outdated components." src="https://cdn-images-1.medium.com/max/1024/1*MIbCYyBaTn-eLt02dRR18g.png" /><figcaption>LivewireDoctor: Your smart assistant for Laravel Livewire. Detects &amp; auto-fixes issues like missing assets, bad directives &amp; outdated components.</figcaption></figure><p>Have you ever opened your Laravel app, clicked a Livewire button… and nothing happened?<br> No console error. No network request. Just silence.</p><p>This usually means one thing:<br> <strong>Livewire.js is not loading</strong> — and debugging it can be frustrating.</p><p>That’s why I built <a href="https://github.com/devrabiul/livewire-doctor"><strong>livewire-doctor</strong></a> — a small but powerful Laravel package that <strong>diagnoses and solves Livewire JS loading issues</strong> and <strong>ensures your Livewire project is healthy</strong>.</p><h3>🤕 The Pain: When Livewire Stops Working</h3><p>It happens suddenly. You’re using Livewire, then one day:</p><ul><li>wire:click stops responding</li><li>You can’t see livewire/livewire.js loading in DevTools</li><li>But no errors show up in the browser or terminal</li></ul><p>And you’re left wondering: <em>“What broke?”</em></p><h3>💊 The Cure: livewire-doctor</h3><p>My package gives you instant visibility into the <strong>state of your Livewire setup</strong>. With a single command or browser visit, you’ll know:</p><p>✅ If Livewire scripts and styles are loaded<br> ✅ If required Blade directives are present<br> ✅ If you’re missing any Livewire configurations<br> ✅ If livewire/livewire.js is unreachable or failing to load</p><h3>🚀 Installation</h3><p>Install via Composer:</p><pre>composer require devrabiul/livewire-doctor</pre><p>That’s it. No need to publish anything.</p><h3>🩻 Usage</h3><h3>Run a full check from the terminal:</h3><pre>php artisan livewire:doctor</pre><p>You’ll see output like this:</p><pre>✔️  Livewire is installed<br>✔️  @livewireScripts directive found<br>✔️  livewire/livewire.js is accessible<br>✔️  Alpine.js detected</pre><p>Or…</p><pre>❌ livewire/livewire.js is NOT loading<br>💡 Tip: Check your asset publishing, CSP, or script order</pre><p>You’ll get a clean web UI showing health checks for Livewire.</p><h3>🧪 Why This Helps</h3><p>This tool helps you:</p><ul><li>Debug JS loading problems faster</li><li>Catch mistakes in Blade layout structure</li><li>Improve confidence when deploying to production</li><li>Confirm that Livewire is working even before you use components</li></ul><p>It’s also useful in <strong>CI/CD pipelines</strong> to prevent broken Livewire setups from being deployed.</p><h3>⚙️ Features</h3><ul><li>✅ Zero configuration required</li><li>🔍 Terminal + Web interface</li><li>⚡ Lightweight and fast</li><li>📦 Compatible with Laravel 8, 9, 10+</li><li>🧠 Designed for Livewire v2 and v3</li></ul><h3>🤝 Open Source and Growing</h3><p>You can find the package here:<br> 👉 <a href="https://github.com/devrabiul/livewire-doctor"><strong>GitHub: devrabiul/livewire-doctor</strong></a></p><p>If you like it, please:</p><ul><li>⭐ Star the repo</li><li>🐞 Report issues</li><li>💡 Suggest new checks</li><li>✅ Share with Laravel friends</li></ul><h3>💬 Final Thoughts</h3><p>Laravel Livewire is powerful — but fragile if scripts break silently.</p><p>livewire-doctor helps bring visibility, confidence, and speed to your Livewire development workflow.</p><p>Let’s stop guessing and start debugging with confidence.</p><h3>🏷️ Tags</h3><p>#Laravel #Livewire #PHP #Debugging #OpenSource #WebDev</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ed9737c591d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Wasting Time on Toast Notifications — Use Laravel Toaster Magic]]></title>
            <link>https://medium.com/@devrabiul/stop-wasting-time-on-toast-notifications-use-laravel-toaster-magic-f8534140c4a8?source=rss-e345510e7dd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8534140c4a8</guid>
            <category><![CDATA[latest-news]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[trending]]></category>
            <dc:creator><![CDATA[Devrabiul]]></dc:creator>
            <pubDate>Sat, 24 May 2025 10:53:42 GMT</pubDate>
            <atom:updated>2025-05-24T10:53:42.230Z</atom:updated>
            <content:encoded><![CDATA[<h3>Stop Wasting Time on Toast Notifications — Use Laravel Toaster Magic</h3><p>If you’ve ever added toast notifications to a Laravel project, you know the pain:</p><ul><li>You flash a message in your controller…</li><li>Then manually include a JavaScript toast library…</li><li>Then conditionally render it in Blade…</li><li>Then realize Livewire doesn’t play nice with it…</li><li>And now you’re debugging JavaScript again 😩</li></ul><p>That’s exactly why I built <a href="https://github.com/devrabiul/laravel-toaster-magic"><strong>Laravel Toaster Magic</strong></a> — a single package that works perfectly with <strong>Laravel</strong>, <strong>Livewire</strong>, and <strong>Inertia</strong>, without extra setup or JavaScript boilerplate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*563YcDq3lstEuCjjf6bJ3Q.png" /></figure><h3>✅ Works with All Laravel Stacks</h3><p>Whether you’re using:</p><ul><li>🟢 Traditional Laravel with Blade</li><li>⚡ Livewire (yes, with real-time updates)</li><li>⚙️ Inertia.js</li></ul><p>Toaster Magic automatically catches flash messages from the session or Livewire events and shows beautiful toast notifications with zero hassle.</p><h3>✨ What Makes It Magic?</h3><p>Here’s what you get out of the box:</p><ul><li><strong>Prebuilt toast types</strong>: success, error, info, warning</li><li><strong>No custom JS needed</strong></li><li><strong>Works in any Laravel layout</strong></li><li><strong>Livewire-friendly without dispatchBrowserEvent</strong></li><li><strong>Easily customizable</strong> (via config &amp; published views)</li></ul><h3>🛠 Real Example: From Controller</h3><p>Want to show a success toast after form submission?</p><pre>use Devrabiul\ToastMagic\Facades\ToastMagic;<br><br>class LanguageController extends Controller<br>{<br>    public function add()<br>    {<br>        // Your logic<br>        ToastMagic::success(&#39;Successfully Updated&#39;);<br>        return back();<br>    }<br>}</pre><p>It just works.</p><h3>🔁 Real Example: From Livewire</h3><p>Inside your Livewire component:</p><pre>$this-&gt;dispatch(&#39;toast&#39;, [<br>    &#39;type&#39; =&gt; &#39;success&#39;,<br>    &#39;message&#39; =&gt; &#39;Product created successfully!&#39;,<br>]);</pre><p>In your Blade layout:</p><pre>&lt;x-toaster-magic::toaster /&gt;</pre><p>Done. Toast appears automatically. No JS required.</p><h3>🧩 Install and Forget</h3><p>Install the package:</p><pre>composer require devrabiul/laravel-toaster-magic</pre><p>Then add this to your Blade layout (usually in layouts/app.blade.php):</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;Page&lt;/title&gt;<br><br>    {!! ToastMagic::styles() !!}<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;!-- Your Content --&gt;<br><br>    {!! ToastMagic::scripts() !!}<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Now every success(), error(), or Livewire toast event is automatically handled.</p><h3>🎨 Fully Customizable</h3><p>Need a different style or position? Publish the config and views:</p><pre>php artisan vendor:publish --provider=&quot;Devrabiul\ToastMagic\ToastMagicServiceProvider&quot;</pre><p>You’re in control of how the toasts look and behave.</p><h3>🤝 Why You Should Use This</h3><ul><li>You’re tired of repeating the same toast code in every project</li><li>You want Livewire toast support without writing JavaScript</li><li>You need a single solution that works with <strong>any Laravel stack</strong></li><li>You want toast messages to just <strong>work</strong></li></ul><h3>💬 Final Words</h3><p>Toasts are small, but they matter. They improve user experience, provide feedback, and help users trust your app.</p><p><strong>Laravel Toaster Magic</strong> saves you time, reduces bugs, and keeps your UI clean — no matter how your Laravel project is built.</p><p>🔗 <a href="https://github.com/devrabiul/laravel-toaster-magic">View on GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8534140c4a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Multilingual Cookie Consent for Laravel — GDPR & CCPA Compliant (v1.0.2)]]></title>
            <link>https://medium.com/@devrabiul/multilingual-cookie-consent-for-laravel-gdpr-ccpa-compliant-v1-0-2-fde5d22fd55f?source=rss-e345510e7dd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/fde5d22fd55f</guid>
            <category><![CDATA[cookie-consent]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[multilingual]]></category>
            <category><![CDATA[ccpa]]></category>
            <category><![CDATA[gdpr]]></category>
            <dc:creator><![CDATA[Devrabiul]]></dc:creator>
            <pubDate>Thu, 24 Apr 2025 03:36:36 GMT</pubDate>
            <atom:updated>2025-04-24T03:36:36.074Z</atom:updated>
            <content:encoded><![CDATA[<h3>🌐 Multilingual Cookie Consent for Laravel — GDPR &amp; CCPA Compliant (v1.0.2)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-YCZPvtTOAXwv7bp3n8YxA.jpeg" /></figure><p>If you’re building a Laravel application and need to handle cookie consent in a compliant and customizable way — without sacrificing user experience — you’re going to love this package.</p><p>Introducing <a href="https://github.com/devrabiul/laravel-cookie-consent"><strong>Laravel Cookie Consent v1.0.2</strong></a>, a multilingual, GDPR &amp; CCPA-compliant solution designed to be developer-friendly and easily integrated into any Laravel project.</p><h3>🚀 Why This Package?</h3><p>Privacy compliance is no longer optional. Regulations like <strong>GDPR</strong> (EU) and <strong>CCPA</strong> (California) require websites to clearly inform users about cookie usage and give them control.</p><p>This package was built to make that process smooth, flexible, and easy for Laravel developers.</p><h3>✅ Key Features</h3><ul><li><strong>Multilingual Support</strong><br> Display consent messages in multiple languages — perfect for international audiences.</li><li><strong>GDPR &amp; CCPA Compliant</strong><br> Handles consent the right way, so your app stays compliant.</li><li><strong>Admin-Configurable (Coming Soon)</strong><br> Easily manage banner content and behavior through an admin panel.</li><li><strong>Customizable UI</strong><br> Tweak the look and feel to fit your brand, effortlessly.</li><li><strong>Lightweight &amp; Easy to Use</strong><br> Add it to your project in minutes, not hours.</li></ul><h3>🔧 How to Get Started</h3><p>Installation is straightforward with Composer:</p><pre>composer require devrabiul/laravel-cookie-consent</pre><p>Then, publish the assets and config:</p><pre>php artisan vendor:publish --provider=&quot;Devrabiul\CookieConsent\CookieConsentServiceProvider&quot;</pre><p>And you’re good to go!</p><h3>📦 Open Source &amp; Actively Maintained</h3><p>This package is open-source and welcomes contributions. Feedback, PRs, and ideas are always appreciated!<br> You can view the full codebase here:<br> 👉 <a href="https://github.com/devrabiul/laravel-cookie-consent"><strong>GitHub — devrabiul/laravel-cookie-consent</strong></a></p><h3>💡 Final Thoughts</h3><p>User privacy is crucial — and Laravel developers now have a clean, multilingual way to manage cookie consent with ease. If you’re building a Laravel app in 2025, this package is worth checking out.</p><p>Feel free to try it, star it, and suggest improvements!<br>Let’s make the web more privacy-friendly, together.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fde5d22fd55f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>