<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Web Development on Nalar</title>
    <link>https://nalar.dev/web-development/</link>
    <description>Recent content in Web Development on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 01 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/web-development/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Feature Flags Without Long-Lived Technical Debt</title>
      <link>https://nalar.dev/feature-flags-without-technical-debt/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/feature-flags-without-technical-debt/</guid>
      <description>&lt;p&gt;Feature flags decouple code deployment from feature release. A team can deploy dormant code, enable it for internal users, roll it out gradually, and disable it without rebuilding the application.&lt;/p&gt;&#xA;&lt;p&gt;The cost is hidden control flow. Every long-lived flag creates another possible system configuration, and interacting flags multiply those configurations quickly.&lt;/p&gt;&#xA;&lt;p&gt;The engineering goal is therefore not &amp;ldquo;use flags everywhere.&amp;rdquo; It is to make each flag temporary, observable, and owned.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Idempotency Keys for Safe API Retries</title>
      <link>https://nalar.dev/idempotency-keys-safe-api-retries/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/idempotency-keys-safe-api-retries/</guid>
      <description>&lt;p&gt;Retries are essential in distributed systems. Networks fail, clients time out, load balancers reset connections, and responses sometimes disappear after a server has already committed a write.&lt;/p&gt;&#xA;&lt;p&gt;The dangerous case is a retry of a non-idempotent operation. If a client sends &lt;code&gt;POST /orders&lt;/code&gt;, times out, and sends the same request again, the server may create two orders even though the user intended one.&lt;/p&gt;&#xA;&lt;p&gt;An idempotency key gives the client a stable identifier for one logical operation. The server remembers the result associated with that key and can return the same result when the request is retried.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Keyset Pagination in SQL for Fast, Stable APIs</title>
      <link>https://nalar.dev/keyset-pagination-sql/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/keyset-pagination-sql/</guid>
      <description>&lt;p&gt;Pagination looks simple until a table becomes large or new rows are inserted while a client is paging through results. &lt;code&gt;LIMIT&lt;/code&gt; and &lt;code&gt;OFFSET&lt;/code&gt; are easy to understand, but deep offsets can become expensive and changing data can make rows appear twice or disappear between requests.&lt;/p&gt;&#xA;&lt;p&gt;Keyset pagination, also called seek pagination, avoids those problems by asking for rows after a known position instead of asking the database to skip a number of rows.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Liveness and Readiness Health Checks for Backend Services</title>
      <link>https://nalar.dev/liveness-readiness-health-checks/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/liveness-readiness-health-checks/</guid>
      <description>&lt;p&gt;Health endpoints look simple, but their semantics directly affect how a production platform routes traffic and restarts applications. A poorly designed check can turn a temporary database slowdown into a restart loop or send requests to an instance that has not finished initializing.&lt;/p&gt;&#xA;&lt;p&gt;The most useful model separates two questions:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Liveness:&lt;/strong&gt; Is this process still capable of running?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Readiness:&lt;/strong&gt; Should this instance receive new traffic right now?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Those questions sound similar, but they should usually have different answers and different failure behavior.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Preventing SSRF in Backend Services That Fetch User-Supplied URLs</title>
      <link>https://nalar.dev/prevent-ssrf-backend-services/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/prevent-ssrf-backend-services/</guid>
      <description>&lt;p&gt;Features that fetch a URL supplied by a user appear in webhook testers, image importers, link previewers, document converters, and integration platforms. They also create a server-side request forgery (SSRF) boundary: an attacker can try to make the backend send requests to destinations the attacker cannot reach directly.&lt;/p&gt;&#xA;&lt;p&gt;A secure design needs more than a blacklist of suspicious strings.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understand-the-trust-boundary&#34;&gt;Understand the trust boundary&lt;/h2&gt;&#xA;&lt;p&gt;The dangerous capability is not URL parsing itself. It is allowing untrusted input to influence a network connection made with the server&amp;rsquo;s network identity.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Progressive Enhancement for Resilient Web Forms</title>
      <link>https://nalar.dev/progressive-enhancement-for-resilient-web-forms/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/progressive-enhancement-for-resilient-web-forms/</guid>
      <description>&lt;p&gt;A web form does not need JavaScript to submit data. That native capability is a useful reliability baseline.&lt;/p&gt;&#xA;&lt;p&gt;Progressive enhancement starts with semantic HTML and a server endpoint that can complete the operation, then adds JavaScript for faster feedback or richer interactions. If the enhancement fails, the core task still has a path to succeed.&lt;/p&gt;&#xA;&lt;p&gt;This approach is valuable even in highly interactive applications because JavaScript can fail for ordinary reasons: slow networks, stale cached chunks, browser extensions, runtime exceptions, or a partial deployment.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Safe Database Migrations with the Expand-and-Contract Pattern</title>
      <link>https://nalar.dev/safe-database-migrations-expand-contract/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/safe-database-migrations-expand-contract/</guid>
      <description>&lt;p&gt;A schema migration can be syntactically correct and still cause an outage. Production deployments often run old and new application versions at the same time, background workers may lag behind, and a large table can turn a simple-looking DDL statement into a long lock.&lt;/p&gt;&#xA;&lt;p&gt;The expand-and-contract pattern reduces those risks by splitting an incompatible change into compatible stages.&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-one-step-schema-changes-are-risky&#34;&gt;Why one-step schema changes are risky&lt;/h2&gt;&#xA;&lt;p&gt;Suppose an application wants to rename &lt;code&gt;users.full_name&lt;/code&gt; to &lt;code&gt;users.display_name&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building an Article CRUD with Laravel and Filament Admin Panel</title>
      <link>https://nalar.dev/building-an-article-crud-with-laravel-and-filament-admin-panel/</link>
      <pubDate>Thu, 04 Sep 2025 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/building-an-article-crud-with-laravel-and-filament-admin-panel/</guid>
      <description>&lt;p&gt;Laravel provides a productive foundation for modern PHP applications, and &lt;strong&gt;Filament&lt;/strong&gt; can add a powerful admin panel with generated forms, tables, and CRUD pages.&lt;/p&gt;&#xA;&lt;p&gt;In this tutorial, we will create a Laravel project and build an &lt;code&gt;Article&lt;/code&gt; CRUD resource with Filament.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-create-a-new-laravel-project&#34;&gt;1. Create a New Laravel Project&lt;/h2&gt;&#xA;&lt;div &#xA;    x-data=&#34;{&#xA;        code: $el.querySelector(&#39;code&#39;).innerText&#xA;    }&#34;&#xA;    class=&#34;relative my-4 rounded-lg group&#34;&#xA;&gt;&#xA;    &lt;button&#xA;        @click=&#34;navigator.clipboard.writeText(code); $el.innerText = &#39;Copied!&#39;; setTimeout(() =&gt; $el.innerText = &#39;Copy&#39;, 2000)&#34;&#xA;        class=&#34;absolute top-2 right-2 bg-neutral-700 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity&#34;&#xA;    &gt;&#xA;        Copy&#xA;    &lt;/button&gt;&#xA;    &#xA;    &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;composer create-project --prefer-dist laravel/laravel website&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;The final argument, &lt;code&gt;website&lt;/code&gt;, is the project directory name. Change it if you want a different project name.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Automatically Encrypting Eloquent Model Attributes</title>
      <link>https://nalar.dev/automatically-encrypting-eloquent-model-attributes/</link>
      <pubDate>Wed, 03 Sep 2025 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/automatically-encrypting-eloquent-model-attributes/</guid>
      <description>&lt;p&gt;Applications often store fields that deserve additional protection at rest. Laravel can encrypt selected Eloquent attributes before they are written to the database and decrypt them automatically when they are read.&lt;/p&gt;&#xA;&lt;p&gt;For modern Laravel applications, the built-in &lt;strong&gt;encrypted cast&lt;/strong&gt; is preferable to overriding Eloquent&amp;rsquo;s magic &lt;code&gt;__get()&lt;/code&gt; and &lt;code&gt;__set()&lt;/code&gt; methods. It integrates with the model casting system and avoids interfering with Eloquent internals.&lt;/p&gt;&#xA;&lt;h2 id=&#34;basic-implementation&#34;&gt;Basic Implementation&lt;/h2&gt;&#xA;&lt;p&gt;Define encrypted attributes in the model&amp;rsquo;s casts:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Running Laravel Queues on cPanel with Cron Jobs</title>
      <link>https://nalar.dev/running-laravel-queues-on-cpanel-with-cron-jobs/</link>
      <pubDate>Wed, 03 Sep 2025 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/running-laravel-queues-on-cpanel-with-cron-jobs/</guid>
      <description>&lt;p&gt;Laravel queues are useful for work that should not block an HTTP request, such as sending email, generating reports, importing data, or processing files. On a VPS, a process supervisor is usually the best way to keep long-running queue workers alive. Shared cPanel hosting often does not provide that option, so a cron-driven worker can be a practical fallback.&lt;/p&gt;&#xA;&lt;p&gt;This pattern starts a worker periodically and tells it to exit once the queue becomes empty.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building a Live Search Page in Filament PHP</title>
      <link>https://nalar.dev/building-a-live-search-page-in-filament-php/</link>
      <pubDate>Sat, 17 May 2025 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/building-a-live-search-page-in-filament-php/</guid>
      <description>&lt;p&gt;Real-time search can make an admin dashboard much easier to use. Filament is built on Livewire, so a custom resource page can react to search input without writing a separate frontend application.&lt;/p&gt;&#xA;&lt;p&gt;This example adds a live-search page to a &lt;code&gt;PostResource&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;1-generate-a-custom-page&#34;&gt;1. Generate a Custom Page&lt;/h3&gt;&#xA;&lt;p&gt;Generate a custom page inside the resource:&lt;/p&gt;&#xA;&lt;div &#xA;    x-data=&#34;{&#xA;        code: $el.querySelector(&#39;code&#39;).innerText&#xA;    }&#34;&#xA;    class=&#34;relative my-4 rounded-lg group&#34;&#xA;&gt;&#xA;    &lt;button&#xA;        @click=&#34;navigator.clipboard.writeText(code); $el.innerText = &#39;Copied!&#39;; setTimeout(() =&gt; $el.innerText = &#39;Copy&#39;, 2000)&#34;&#xA;        class=&#34;absolute top-2 right-2 bg-neutral-700 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity&#34;&#xA;    &gt;&#xA;        Copy&#xA;    &lt;/button&gt;&#xA;    &#xA;    &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;php artisan make:filament-page SearchPost --resource&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;PostResource --type&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;custom&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;The exact generated path can vary by Filament version and panel structure, so check the files created by the command.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building a Nested Category API in Laravel 11: A Practical Guide</title>
      <link>https://nalar.dev/building-a-nested-category-api-in-laravel-11-a-practical-guide/</link>
      <pubDate>Sat, 24 Aug 2024 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/building-a-nested-category-api-in-laravel-11-a-practical-guide/</guid>
      <description>&lt;p&gt;Nested categories are common in e-commerce platforms, CMS applications, documentation systems, and other products that need hierarchical navigation. In Laravel, a self-referencing Eloquent relationship can model a category that belongs to a parent and has any number of children.&lt;/p&gt;&#xA;&lt;p&gt;This Laravel 11 example builds a small API for creating and reading category trees.&lt;/p&gt;&#xA;&lt;h3 id=&#34;1-create-the-laravel-project&#34;&gt;1. Create the Laravel Project&lt;/h3&gt;&#xA;&lt;div &#xA;    x-data=&#34;{&#xA;        code: $el.querySelector(&#39;code&#39;).innerText&#xA;    }&#34;&#xA;    class=&#34;relative my-4 rounded-lg group&#34;&#xA;&gt;&#xA;    &lt;button&#xA;        @click=&#34;navigator.clipboard.writeText(code); $el.innerText = &#39;Copied!&#39;; setTimeout(() =&gt; $el.innerText = &#39;Copy&#39;, 2000)&#34;&#xA;        class=&#34;absolute top-2 right-2 bg-neutral-700 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity&#34;&#xA;    &gt;&#xA;        Copy&#xA;    &lt;/button&gt;&#xA;    &#xA;    &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;composer create-project --prefer-dist laravel/laravel laravel-nested-categories&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd laravel-nested-categories&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;php artisan serve&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;h3 id=&#34;2-create-the-category-model-and-migration&#34;&gt;2. Create the &lt;code&gt;Category&lt;/code&gt; Model and Migration&lt;/h3&gt;&#xA;&lt;div &#xA;    x-data=&#34;{&#xA;        code: $el.querySelector(&#39;code&#39;).innerText&#xA;    }&#34;&#xA;    class=&#34;relative my-4 rounded-lg group&#34;&#xA;&gt;&#xA;    &lt;button&#xA;        @click=&#34;navigator.clipboard.writeText(code); $el.innerText = &#39;Copied!&#39;; setTimeout(() =&gt; $el.innerText = &#39;Copy&#39;, 2000)&#34;&#xA;        class=&#34;absolute top-2 right-2 bg-neutral-700 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity&#34;&#xA;    &gt;&#xA;        Copy&#xA;    &lt;/button&gt;&#xA;    &#xA;    &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;php artisan make:model Category -m&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;Define the table in the generated migration:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building a Simple CRUD Application in Laravel: A Practical Guide</title>
      <link>https://nalar.dev/building-a-simple-crud-application-in-laravel-a-practical-guide/</link>
      <pubDate>Sat, 24 Aug 2024 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/building-a-simple-crud-application-in-laravel-a-practical-guide/</guid>
      <description>&lt;p&gt;Building a CRUD application is one of the best ways to learn the core pieces of Laravel. In this guide, we will create a simple &lt;code&gt;Post&lt;/code&gt; resource that supports &lt;strong&gt;Create, Read, Update, and Delete&lt;/strong&gt; operations using Eloquent, resource routes, validation, and Blade views.&lt;/p&gt;&#xA;&lt;h3 id=&#34;1-create-the-laravel-project&#34;&gt;1. Create the Laravel Project&lt;/h3&gt;&#xA;&lt;p&gt;Make sure Composer and a supported PHP version are installed, then run:&lt;/p&gt;&#xA;&lt;div &#xA;    x-data=&#34;{&#xA;        code: $el.querySelector(&#39;code&#39;).innerText&#xA;    }&#34;&#xA;    class=&#34;relative my-4 rounded-lg group&#34;&#xA;&gt;&#xA;    &lt;button&#xA;        @click=&#34;navigator.clipboard.writeText(code); $el.innerText = &#39;Copied!&#39;; setTimeout(() =&gt; $el.innerText = &#39;Copy&#39;, 2000)&#34;&#xA;        class=&#34;absolute top-2 right-2 bg-neutral-700 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity&#34;&#xA;    &gt;&#xA;        Copy&#xA;    &lt;/button&gt;&#xA;    &#xA;    &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;composer create-project --prefer-dist laravel/laravel laravel-crud&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd laravel-crud&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;php artisan serve&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;The development server is normally available at &lt;code&gt;http://localhost:8000&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Data Validation in Laravel: A Complete Developer Guide</title>
      <link>https://nalar.dev/data-validation-in-laravel-a-complete-developer-guide/</link>
      <pubDate>Thu, 22 Aug 2024 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/data-validation-in-laravel-a-complete-developer-guide/</guid>
      <description>&lt;p&gt;Validation is an important boundary in web applications. It ensures incoming data has the shape and constraints your application expects before that data reaches business logic or persistence. Laravel provides several validation APIs, from quick controller validation to reusable Form Request classes and custom rules.&lt;/p&gt;&#xA;&lt;h3 id=&#34;1-basic-validation&#34;&gt;1. Basic Validation&lt;/h3&gt;&#xA;&lt;p&gt;For small request handlers, call &lt;code&gt;validate()&lt;/code&gt; on the request:&lt;/p&gt;&#xA;&lt;div &#xA;    x-data=&#34;{&#xA;        code: $el.querySelector(&#39;code&#39;).innerText&#xA;    }&#34;&#xA;    class=&#34;relative my-4 rounded-lg group&#34;&#xA;&gt;&#xA;    &lt;button&#xA;        @click=&#34;navigator.clipboard.writeText(code); $el.innerText = &#39;Copied!&#39;; setTimeout(() =&gt; $el.innerText = &#39;Copy&#39;, 2000)&#34;&#xA;        class=&#34;absolute top-2 right-2 bg-neutral-700 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity&#34;&#xA;    &gt;&#xA;        Copy&#xA;    &lt;/button&gt;&#xA;    &#xA;    &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-php&#34; data-lang=&#34;php&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;use&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Illuminate\Http\Request&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;store&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;Request&lt;/span&gt; $request)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    $validatedData &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; $request&lt;span style=&#34;color:#f92672&#34;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;validate&lt;/span&gt;([&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;name&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&amp;gt;&lt;/span&gt; [&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;required&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;string&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;max:255&amp;#39;&lt;/span&gt;],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;email&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&amp;gt;&lt;/span&gt; [&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;required&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;email&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;unique:users,email&amp;#39;&lt;/span&gt;],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;password&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&amp;gt;&lt;/span&gt; [&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;required&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;string&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;min:8&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;confirmed&amp;#39;&lt;/span&gt;],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    ]);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// Use $validatedData rather than the entire request payload.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;For a normal browser request, Laravel redirects back with validation errors in the session. For requests expecting JSON, Laravel returns a validation error response, normally with HTTP status 422.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using PHP&#39;s Built-In Server: A Quick Guide to `php -S`</title>
      <link>https://nalar.dev/using-phps-built-in-server-a-quick-guide-to-php-s/</link>
      <pubDate>Wed, 21 Aug 2024 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/using-phps-built-in-server-a-quick-guide-to-php-s/</guid>
      <description>&lt;p&gt;When developing PHP applications, especially small projects or prototypes, configuring a full web server such as Apache or Nginx can be unnecessary. PHP includes a lightweight development server that starts with a single command: &lt;code&gt;php -S&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;It is convenient for local development and quick testing, but it is not designed for production traffic.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-is&#34;&gt;&lt;strong&gt;What Is &lt;code&gt;php -S&lt;/code&gt;?&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;php -S&lt;/code&gt; starts PHP&amp;rsquo;s built-in development web server. It can serve PHP scripts and static files without a separate web-server configuration.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Backing Up a MySQL Database from PHP</title>
      <link>https://nalar.dev/backing-up-a-mysql-database-from-php/</link>
      <pubDate>Wed, 20 Mar 2024 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/backing-up-a-mysql-database-from-php/</guid>
      <description>&lt;p&gt;Database backups are essential for recovery, migrations, and operational safety. Although PHP can query table definitions and manually generate SQL, a production-ready MySQL backup is better delegated to MySQL&amp;rsquo;s own &lt;code&gt;mysqldump&lt;/code&gt; utility when it is available.&lt;/p&gt;&#xA;&lt;p&gt;This guide shows how a PHP script can invoke &lt;code&gt;mysqldump&lt;/code&gt; safely enough for a controlled server environment.&lt;/p&gt;&#xA;&lt;h3 id=&#34;1-define-the-database-and-backup-settings&#34;&gt;&lt;strong&gt;1. Define the Database and Backup Settings&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;div &#xA;    x-data=&#34;{&#xA;        code: $el.querySelector(&#39;code&#39;).innerText&#xA;    }&#34;&#xA;    class=&#34;relative my-4 rounded-lg group&#34;&#xA;&gt;&#xA;    &lt;button&#xA;        @click=&#34;navigator.clipboard.writeText(code); $el.innerText = &#39;Copied!&#39;; setTimeout(() =&gt; $el.innerText = &#39;Copy&#39;, 2000)&#34;&#xA;        class=&#34;absolute top-2 right-2 bg-neutral-700 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity&#34;&#xA;    &gt;&#xA;        Copy&#xA;    &lt;/button&gt;&#xA;    &#xA;    &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-php&#34; data-lang=&#34;php&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;php&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$host &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$user &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;backup_user&amp;#39;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$password &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;getenv&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;MYSQL_BACKUP_PASSWORD&amp;#39;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$database &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;your_database&amp;#39;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$backupFile &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;__DIR__&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;/backups/backup-&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;date&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Ymd-His&amp;#39;&lt;/span&gt;) &lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;.sql&amp;#39;&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;Keep credentials out of source code whenever possible. Environment variables, secret stores, or protected configuration files are preferable to hard-coded passwords.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Finding the Last Day of a Month in PHP</title>
      <link>https://nalar.dev/finding-the-last-day-of-a-month-in-php/</link>
      <pubDate>Tue, 14 Jun 2022 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/finding-the-last-day-of-a-month-in-php/</guid>
      <description>&lt;p&gt;Finding the number of days in a month is useful for reporting, billing periods, scheduling, and date validation. PHP can do this directly with its date APIs, including support for leap years.&lt;/p&gt;&#xA;&lt;h3 id=&#34;a-simple&#34;&gt;&lt;strong&gt;A Simple &lt;code&gt;getLastDay&lt;/code&gt; Function&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;The following function accepts a month in &lt;code&gt;YYYY-MM&lt;/code&gt; format and returns the number of days in that month:&lt;/p&gt;&#xA;&lt;div &#xA;    x-data=&#34;{&#xA;        code: $el.querySelector(&#39;code&#39;).innerText&#xA;    }&#34;&#xA;    class=&#34;relative my-4 rounded-lg group&#34;&#xA;&gt;&#xA;    &lt;button&#xA;        @click=&#34;navigator.clipboard.writeText(code); $el.innerText = &#39;Copied!&#39;; setTimeout(() =&gt; $el.innerText = &#39;Copy&#39;, 2000)&#34;&#xA;        class=&#34;absolute top-2 right-2 bg-neutral-700 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity&#34;&#xA;    &gt;&#xA;        Copy&#xA;    &lt;/button&gt;&#xA;    &#xA;    &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-php&#34; data-lang=&#34;php&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;getLastDay&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;string&lt;/span&gt; $month)&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;int&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    $date &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;DateTimeImmutable&lt;/span&gt;($month &lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;-01&amp;#39;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; (&lt;span style=&#34;color:#a6e22e&#34;&gt;int&lt;/span&gt;) $date&lt;span style=&#34;color:#f92672&#34;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;format&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;t&amp;#39;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;h3 id=&#34;how-the-code-works&#34;&gt;&lt;strong&gt;How the Code Works&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Create a date for the first day of the month&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Extracting Usernames from Social Media URLs with PHP</title>
      <link>https://nalar.dev/extracting-usernames-from-social-media-urls-with-php/</link>
      <pubDate>Mon, 06 Jun 2022 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/extracting-usernames-from-social-media-urls-with-php/</guid>
      <description>&lt;p&gt;Web applications sometimes need to extract a profile identifier from a social-media URL for normalization, imports, or display. PHP&amp;rsquo;s URL parsing functions are usually easier to maintain than one large regular expression because they let you validate the hostname and path separately.&lt;/p&gt;&#xA;&lt;h3 id=&#34;a&#34;&gt;&lt;strong&gt;A &lt;code&gt;parseUsername&lt;/code&gt; Function&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;The following example supports several common profile URL formats:&lt;/p&gt;&#xA;&lt;div &#xA;    x-data=&#34;{&#xA;        code: $el.querySelector(&#39;code&#39;).innerText&#xA;    }&#34;&#xA;    class=&#34;relative my-4 rounded-lg group&#34;&#xA;&gt;&#xA;    &lt;button&#xA;        @click=&#34;navigator.clipboard.writeText(code); $el.innerText = &#39;Copied!&#39;; setTimeout(() =&gt; $el.innerText = &#39;Copy&#39;, 2000)&#34;&#xA;        class=&#34;absolute top-2 right-2 bg-neutral-700 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity&#34;&#xA;    &gt;&#xA;        Copy&#xA;    &lt;/button&gt;&#xA;    &#xA;    &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-php&#34; data-lang=&#34;php&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;parseUsername&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;string&lt;/span&gt; $url)&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;string&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    $host &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;strtolower&lt;/span&gt;((&lt;span style=&#34;color:#a6e22e&#34;&gt;string&lt;/span&gt;) &lt;span style=&#34;color:#a6e22e&#34;&gt;parse_url&lt;/span&gt;($url, &lt;span style=&#34;color:#a6e22e&#34;&gt;PHP_URL_HOST&lt;/span&gt;));&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    $path &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;trim&lt;/span&gt;((&lt;span style=&#34;color:#a6e22e&#34;&gt;string&lt;/span&gt;) &lt;span style=&#34;color:#a6e22e&#34;&gt;parse_url&lt;/span&gt;($url, &lt;span style=&#34;color:#a6e22e&#34;&gt;PHP_URL_PATH&lt;/span&gt;), &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;/&amp;#39;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    $supportedHosts &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; [&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;twitter.com&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;www.twitter.com&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;x.com&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;www.x.com&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;medium.com&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;www.medium.com&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;facebook.com&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;www.facebook.com&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;vimeo.com&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;www.vimeo.com&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;instagram.com&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;www.instagram.com&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    ];&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; (&lt;span style=&#34;color:#f92672&#34;&gt;!&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;in_array&lt;/span&gt;($host, $supportedHosts, &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;) &lt;span style=&#34;color:#f92672&#34;&gt;||&lt;/span&gt; $path &lt;span style=&#34;color:#f92672&#34;&gt;===&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;#39;&lt;/span&gt;) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; $url;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;explode&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;/&amp;#39;&lt;/span&gt;, $path)[&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;];&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;h3 id=&#34;how-it-works&#34;&gt;&lt;strong&gt;How It Works&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Parse the hostname and path&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Understanding HTTP Status Codes in Laravel: A Developer&#39;s Guide</title>
      <link>https://nalar.dev/understanding-http-status-codes-in-laravel-a-developers-guide/</link>
      <pubDate>Sat, 30 Jan 2021 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/understanding-http-status-codes-in-laravel-a-developers-guide/</guid>
      <description>&lt;p&gt;HTTP status codes tell clients whether a request succeeded, failed, requires authentication, or encountered another condition. Choosing the right status code makes Laravel APIs easier to consume and helps clients implement predictable error handling.&lt;/p&gt;&#xA;&lt;h3 id=&#34;200-ok&#34;&gt;200: OK&lt;/h3&gt;&#xA;&lt;p&gt;Use &lt;code&gt;200 OK&lt;/code&gt; when a request succeeds and the response includes a representation or other useful content.&lt;/p&gt;&#xA;&lt;p&gt;Common cases:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A successful &lt;code&gt;GET&lt;/code&gt; request that returns data.&lt;/li&gt;&#xA;&lt;li&gt;A successful update that returns the updated resource.&lt;/li&gt;&#xA;&lt;li&gt;A successful action endpoint that returns a result.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;201-created&#34;&gt;201: Created&lt;/h3&gt;&#xA;&lt;p&gt;Use &lt;code&gt;201 Created&lt;/code&gt; after successfully creating a new resource, usually from a &lt;code&gt;POST&lt;/code&gt; request.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Managing Image Uploads and Resizing with Laravel and Intervention Image</title>
      <link>https://nalar.dev/managing-image-uploads-and-resizing-with-laravel-and-intervention-image/</link>
      <pubDate>Fri, 29 Jan 2021 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/managing-image-uploads-and-resizing-with-laravel-and-intervention-image/</guid>
      <description>&lt;p&gt;Image handling is a common requirement in web applications. Uploading original files, creating thumbnails, converting formats, and cleaning up old files all need to be handled consistently. Laravel&amp;rsquo;s filesystem abstraction works well with image-processing libraries such as &lt;strong&gt;Intervention Image&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The code in this article uses the classic Intervention Image v2-style API (&lt;code&gt;Image::make&lt;/code&gt;, &lt;code&gt;fit&lt;/code&gt;, and &lt;code&gt;encode&lt;/code&gt;). Intervention Image v3 uses a different API, so check the package version installed in your project before copying the example directly.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
