<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Wahid</title>
    <description>The latest articles on DEV Community by Wahid (@abdulwahidkahar).</description>
    <link>https://dev.to/abdulwahidkahar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1208170%2Fa116a9d2-6090-4f02-aa78-bd8ffbf67009.png</url>
      <title>DEV Community: Wahid</title>
      <link>https://dev.to/abdulwahidkahar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abdulwahidkahar"/>
    <language>en</language>
    <item>
      <title>[Solved] Swift Compiler Error (Xcode): Method does not override any method from its superclass</title>
      <dc:creator>Wahid</dc:creator>
      <pubDate>Thu, 20 Mar 2025 06:36:56 +0000</pubDate>
      <link>https://dev.to/abdulwahidkahar/solved-swift-compiler-error-xcode-method-does-not-override-any-method-from-its-superclass-3k37</link>
      <guid>https://dev.to/abdulwahidkahar/solved-swift-compiler-error-xcode-method-does-not-override-any-method-from-its-superclass-3k37</guid>
      <description>&lt;p&gt;In the new Xcode 16, if you get the following error&lt;/p&gt;

&lt;p&gt;Failed to build iOS app&lt;br&gt;
Could not build the precompiled application for the device.&lt;br&gt;
Swift Compiler Error (Xcode): Method does not override any method from its superclass&lt;br&gt;
/Users/abid/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ios/Classes/InAppWebView/InAppWebView.swift:1431:25&lt;/p&gt;

&lt;p&gt;This video solves this problem&lt;/p&gt;

&lt;p&gt;Method doesn't override any method from its superclass solution&lt;/p&gt;

&lt;p&gt;Paste the following code in pubspec.yaml&lt;/p&gt;

&lt;p&gt;dependency_overrides:&lt;br&gt;
  flutter_inappwebview_ios:&lt;br&gt;
    git:&lt;br&gt;
      url: &lt;a href="https://github.com/andychucs/flutter_inappwebview" rel="noopener noreferrer"&gt;https://github.com/andychucs/flutter_inappwebview&lt;/a&gt;&lt;br&gt;
      ref: master&lt;br&gt;
      path: flutter_inappwebview_ios&lt;/p&gt;

</description>
      <category>swift</category>
      <category>flutter</category>
      <category>iosdev</category>
      <category>xcode</category>
    </item>
    <item>
      <title>Understanding Data Structures &amp; Algorithms for Beginners</title>
      <dc:creator>Wahid</dc:creator>
      <pubDate>Thu, 13 Mar 2025 06:49:00 +0000</pubDate>
      <link>https://dev.to/abdulwahidkahar/understanding-data-structures-algorithms-for-beginners-3pnk</link>
      <guid>https://dev.to/abdulwahidkahar/understanding-data-structures-algorithms-for-beginners-3pnk</guid>
      <description>&lt;p&gt;&lt;a href="https://youtu.be/jZkGQIdOKM8?si=_n6dyztzQEihjvpL" rel="noopener noreferrer"&gt;https://youtu.be/jZkGQIdOKM8?si=_n6dyztzQEihjvpL&lt;/a&gt;&lt;/p&gt;

</description>
      <category>datastructures</category>
      <category>algorithms</category>
      <category>programmers</category>
      <category>programming</category>
    </item>
    <item>
      <title>sdsd</title>
      <dc:creator>Wahid</dc:creator>
      <pubDate>Wed, 12 Mar 2025 21:41:37 +0000</pubDate>
      <link>https://dev.to/abdulwahidkahar/sdsd-mni</link>
      <guid>https://dev.to/abdulwahidkahar/sdsd-mni</guid>
      <description>&lt;p&gt;&lt;a href="https://youtu.be/jZkGQIdOKM8?si=Kkdtva3xsDnJW7th" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>Understanding Data Structures &amp; Algorithms for Beginners</title>
      <dc:creator>Wahid</dc:creator>
      <pubDate>Wed, 12 Mar 2025 21:40:17 +0000</pubDate>
      <link>https://dev.to/abdulwahidkahar/understanding-data-structures-algorithms-for-beginners-c54</link>
      <guid>https://dev.to/abdulwahidkahar/understanding-data-structures-algorithms-for-beginners-c54</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8s7ejpx5ra0fbpkwobix.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8s7ejpx5ra0fbpkwobix.png" alt="Image description" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/jZkGQIdOKM8?si=Kkdtva3xsDnJW7th" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>datastructures</category>
      <category>algorithms</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Fixing GSAP ScrollTrigger Pin Issue in React</title>
      <dc:creator>Wahid</dc:creator>
      <pubDate>Tue, 11 Mar 2025 16:19:41 +0000</pubDate>
      <link>https://dev.to/abdulwahidkahar/how-to-fixing-gsap-scrolltrigger-pin-issue-in-react-153k</link>
      <guid>https://dev.to/abdulwahidkahar/how-to-fixing-gsap-scrolltrigger-pin-issue-in-react-153k</guid>
      <description>&lt;p&gt;When working with GSAP ScrollTrigger in React, you might encounter an issue where your pinned section disappears when scrolling from the top but works correctly when scrolling from the bottom. This issue usually happens due to improper cleanup or React's strict mode behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The section disappears when scrolling down.&lt;/li&gt;
&lt;li&gt;The pin works only when scrolling up.&lt;/li&gt;
&lt;li&gt;The .pin-spacer div is created incorrectly, affecting layout.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;br&gt;
To fix this, we need to properly structure our GSAP animation using gsap.context() and ensure the cleanup process is handled correctly.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Step-by-Step Fix&lt;br&gt;
*&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a Separate Animation File
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;gsap&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;gsap&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;ScrollTrigger&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;gsap/ScrollTrigger&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;gsap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;registerPlugin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ScrollTrigger&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;useInspireAnimation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sectionRef&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;sectionRef&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gsap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;context&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;gsap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sectionRef&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;scrollTrigger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;sectionRef&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;top top&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;end&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;+=100%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;scrub&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;pin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;markers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Remove after debugging&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;gsap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nx"&gt;sectionRef&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;ease&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;power2.out&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;scrollTrigger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;sectionRef&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;top 80%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;end&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;top 50%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;scrub&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;revert&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Cleanup GSAP context when c&lt;/span&gt;

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Implement in the Component
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useRef&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useInspireAnimation&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./useInspireAnimation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;InspiringSection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sectionRef&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useRef&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cleanup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useInspireAnimation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sectionRef&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;cleanup&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;section&lt;/span&gt;
      &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;sectionRef&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"section-2 h-screen w-screen bg-gray-900 text-white flex items-center justify-center"&lt;/span&gt;
    &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"text-4xl font-bold"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Section 2&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;section&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;InspiringSection&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why This Works?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ensures proper cleanup: Using ctx.revert() removes previous animations when the component unmounts.&lt;/li&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;li&gt;Uses gsap.context(): Prevents unexpected behavior in React Strict Mode.&lt;/li&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;li&gt;Prevents issues with pin-spacer: Ensures the pinning doesn't cause layout bugs.&lt;/li&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;li&gt;Keeps the animation separate: Improves maintainability and readability.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;br&gt;
Using this method, you can prevent your pinned section from disappearing while maintaining smooth scroll-based animations in GSAP. If you're still facing issues, try adding ScrollTrigger.refresh() after a small delay to ensure GSAP recalculates the layout correctly.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>gsap</category>
      <category>animation</category>
    </item>
    <item>
      <title>How to fix Invalid User Data in Login API Response</title>
      <dc:creator>Wahid</dc:creator>
      <pubDate>Sat, 01 Feb 2025 21:36:21 +0000</pubDate>
      <link>https://dev.to/abdulwahidkahar/how-to-fix-invalid-user-data-in-login-api-response-1f5h</link>
      <guid>https://dev.to/abdulwahidkahar/how-to-fix-invalid-user-data-in-login-api-response-1f5h</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;Issue:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
You are receiving an error: Invalid user data: undefined while logging in because the expected user and token data are nested under data in the API response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;1.Inspect the API response:&lt;/strong&gt;&lt;br&gt;
The API returns a response with user and token inside data. Here's the structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;status&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;success&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Login successful.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;data&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;token&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;eyJ...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2.Update handleSubmit in LoginPage.jsx:&lt;/strong&gt;&lt;br&gt;
Modify the code to access data.user and data.token:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleSubmit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nf"&gt;setLoading&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;setError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;API&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/login&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;formData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Access user and token&lt;/span&gt;
      &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;token&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Save token to localStorage&lt;/span&gt;
      &lt;span class="nf"&gt;login&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Login with user data&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;User data or token is missing in response&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Login failed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setLoading&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3.Explanation:&lt;/strong&gt;&lt;br&gt;
The API response contains data.user and data.token.&lt;br&gt;
Ensure you access them correctly using response.data.data.user and response.data.data.token.&lt;br&gt;
Add error handling if user or token is missing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt;&lt;br&gt;
This fix ensures that the user and token data are properly accessed and used for login, resolving the undefined error.&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Introduction to Linked Lists in PHP: A Beginner's Guide</title>
      <dc:creator>Wahid</dc:creator>
      <pubDate>Sun, 26 Jan 2025 10:54:23 +0000</pubDate>
      <link>https://dev.to/abdulwahidkahar/introduction-to-linked-lists-in-php-a-beginners-guide-5fe6</link>
      <guid>https://dev.to/abdulwahidkahar/introduction-to-linked-lists-in-php-a-beginners-guide-5fe6</guid>
      <description>&lt;p&gt;Linked Lists are a fundamental data structure in computer science, where elements (called nodes) are connected sequentially through pointers. Unlike arrays, Linked Lists are dynamic, meaning they can grow or shrink in size without the need for resizing operations. In this tutorial, we'll cover the basics of implementing a Linked List in PHP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structure of a Linked List Node&lt;/strong&gt;&lt;br&gt;
Each node in a Linked List consists of two parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Data: The value stored in the node.&lt;/li&gt;
&lt;li&gt;Next: A reference (pointer) to the next node.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here’s an example implementation of a basic node in PHP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Node {
    public $data;
    public $next;

    public function __construct($data) {
        $this-&amp;gt;data = $data;
        $this-&amp;gt;next = null;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Implementing a Simple Linked List&lt;/strong&gt;&lt;br&gt;
To manage the nodes, we create a LinkedList class that maintains the head of the list and provides methods to manipulate it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic Operations&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;1. Add Node to the End&lt;/strong&gt;&lt;br&gt;
We add a node to the end of the list by iterating through the nodes until we reach the last one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class LinkedList {
    private $head;

    public function __construct() {
        $this-&amp;gt;head = null;
    }

    public function append($data) {
        $newNode = new Node($data);
        if ($this-&amp;gt;head === null) {
            $this-&amp;gt;head = $newNode;
        } else {
            $current = $this-&amp;gt;head;
            while ($current-&amp;gt;next !== null) {
                $current = $current-&amp;gt;next;
            }
            $current-&amp;gt;next = $newNode;
        }
    }
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Display the List&lt;/strong&gt;&lt;br&gt;
We can traverse the list to print all the elements.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function display() {
    $current = $this-&amp;gt;head;
    while ($current !== null) {
        echo $current-&amp;gt;data . " -&amp;gt; ";
        $current = $current-&amp;gt;next;
    }
    echo "NULL\n";
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Delete a Node&lt;/strong&gt;&lt;br&gt;
Deleting a node involves finding the node and updating the pointer of the previous node.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function delete($data) {
    if ($this-&amp;gt;head === null) {
        return;
    }

    if ($this-&amp;gt;head-&amp;gt;data === $data) {
        $this-&amp;gt;head = $this-&amp;gt;head-&amp;gt;next;
        return;
    }

    $current = $this-&amp;gt;head;
    while ($current-&amp;gt;next !== null &amp;amp;&amp;amp; $current-&amp;gt;next-&amp;gt;data !== $data) {
        $current = $current-&amp;gt;next;
    }

    if ($current-&amp;gt;next !== null) {
        $current-&amp;gt;next = $current-&amp;gt;next-&amp;gt;next;
    }
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example Usage&lt;/strong&gt;&lt;br&gt;
Here’s how to use the Linked List implementation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$linkedList = new LinkedList();
$linkedList-&amp;gt;append(10);
$linkedList-&amp;gt;append(20);
$linkedList-&amp;gt;append(30);

echo "Initial List:\n";
$linkedList-&amp;gt;display();

$linkedList-&amp;gt;delete(20);
echo "After Deleting 20:\n";
$linkedList-&amp;gt;display();

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

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;Output:&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Initial List:
10 -&amp;gt; 20 -&amp;gt; 30 -&amp;gt; NULL
After Deleting 20:
10 -&amp;gt; 30 -&amp;gt; NULL

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Linked Lists are a powerful tool for dynamic data manipulation. While PHP has built-in array functions that often serve similar purposes, understanding Linked Lists is essential for grasping fundamental data structures and improving algorithmic thinking. This implementation provides a starting point for more advanced structures like Doubly Linked Lists and Circular Linked Lists.&lt;/p&gt;

</description>
      <category>php</category>
      <category>linkedlists</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to fix TailwindCSS not working with Vite + React</title>
      <dc:creator>Wahid</dc:creator>
      <pubDate>Fri, 27 Dec 2024 15:26:33 +0000</pubDate>
      <link>https://dev.to/abdulwahidkahar/how-to-fix-tailwindcss-not-working-with-vite-react-36c6</link>
      <guid>https://dev.to/abdulwahidkahar/how-to-fix-tailwindcss-not-working-with-vite-react-36c6</guid>
      <description>&lt;p&gt;Tailwind CSS requires two key configuration files: tailwind.config.js and postcss.config.js. If you don't run npx tailwindcss init -p, these files won't be generated, which can cause issues with Tailwind not working correctly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Missing tailwind.config.js: Without this file, Tailwind can't process your files or customize the framework.&lt;/li&gt;
&lt;li&gt;Missing postcss.config.js: PostCSS won't be set up, causing Tailwind's utilities to not be compiled correctly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br&gt;
Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx tailwindcss init -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to generate both files. This ensures proper configuration and PostCSS setup, allowing Tailwind to work as expected.&lt;/p&gt;

</description>
      <category>react</category>
      <category>vite</category>
      <category>tailwindcss</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Fix the Target Class Does Not Exist Error in Laravel</title>
      <dc:creator>Wahid</dc:creator>
      <pubDate>Mon, 09 Dec 2024 19:43:25 +0000</pubDate>
      <link>https://dev.to/abdulwahidkahar/how-to-fix-the-target-class-does-not-exist-error-in-laravel-9ij</link>
      <guid>https://dev.to/abdulwahidkahar/how-to-fix-the-target-class-does-not-exist-error-in-laravel-9ij</guid>
      <description>&lt;p&gt;The Target Class Does Not Exist error often occurs when Laravel cannot locate the class being referenced, especially in cases involving dependency injection or service container bindings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Causes:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Incorrect namespace in the controller or model file.&lt;/li&gt;
&lt;li&gt;Service container binding is not properly registered.&lt;/li&gt;
&lt;li&gt;Autoload cache is outdated.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step-by-Step Solution:&lt;/strong&gt;&lt;br&gt;
1.Check the Class Namespace&lt;br&gt;
Ensure the namespace in your file matches the folder structure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Example: app/Http/Controllers/UserController.php
namespace App\Http\Controllers;

class UserController {
    // ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Update Composer Autoload&lt;br&gt;
Run the following command to refresh the autoload cache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer dump-autoload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Verify Service Provider Bindings&lt;br&gt;
If using the service container, ensure proper binding in a service provider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Example in AppServiceProvider.php
use App\Services\MyService;

public function register()
{
    $this-&amp;gt;app-&amp;gt;bind('MyService', function () {
        return new MyService();
    });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Check Dependency Injection Usage&lt;br&gt;
Confirm that the injected class is available and correctly referenced:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Example in Controller
use App\Services\MyService;

public function __construct(MyService $service)
{
    $this-&amp;gt;service = $service;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>php</category>
      <category>laravel</category>
      <category>webdev</category>
      <category>problemsolve</category>
    </item>
    <item>
      <title>Running Mailpit for SMTP and UI on MacOS</title>
      <dc:creator>Wahid</dc:creator>
      <pubDate>Wed, 28 Aug 2024 16:32:16 +0000</pubDate>
      <link>https://dev.to/abdulwahidkahar/running-mailpit-for-smtp-and-ui-on-macos-4fkp</link>
      <guid>https://dev.to/abdulwahidkahar/running-mailpit-for-smtp-and-ui-on-macos-4fkp</guid>
      <description>&lt;p&gt;Mailpit is a tool for handling fake email deliveries, useful during application development. This tutorial will guide you through setting up and running Mailpit on MacOS with SMTP and UI configuration.&lt;/p&gt;

&lt;p&gt;Step 1: Install Mailpit&lt;br&gt;
Download and install Mailpit from the &lt;a href="https://github.com/axllent/mailpit?tab=readme-ov-file" rel="noopener noreferrer"&gt;official GitHub repository&lt;/a&gt;. Choose the appropriate binary for MacOS.&lt;/p&gt;

&lt;p&gt;Step 2: Running Mailpit&lt;br&gt;
To start Mailpit, use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mailpit --smtp 0.0.0.0:1025 --listen 0.0.0.0:8025
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command starts the SMTP server on port 1025 and the web UI on port 8025.&lt;/p&gt;

&lt;p&gt;SMTP: 0.0.0.0:1025 handles email delivery.&lt;br&gt;
UI: 0.0.0.0:8025 allows you to view sent emails.&lt;br&gt;
If you encounter an error stating that the address is already in use, ensure no other service is running on the same port. You can use a different port if needed by adjusting the command.&lt;/p&gt;

&lt;p&gt;Step 3: Configuring Laravel Mail Settings&lt;br&gt;
In your Laravel .env file, configure the mail settings:&lt;/p&gt;

&lt;p&gt;env&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This configuration directs Laravel to send emails through Mailpit's SMTP server.&lt;/p&gt;

&lt;p&gt;Step 4: Testing Email Sending&lt;br&gt;
When your application sends an email, you can view it in the Mailpit UI by navigating to:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost:8025" rel="noopener noreferrer"&gt;http://localhost:8025&lt;/a&gt;&lt;br&gt;
This will display all emails sent by your application.&lt;/p&gt;

&lt;p&gt;Troubleshooting&lt;br&gt;
Connection Refused: Ensure Mailpit is running on the correct port (1025 for SMTP).&lt;br&gt;
Port Conflict: If you encounter a "bind: address already in use" error, change the port in the command or stop the conflicting service.&lt;br&gt;
That's it! You've successfully set up Mailpit to handle and display fake email deliveries in your development environment.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>email</category>
      <category>notification</category>
    </item>
    <item>
      <title>How to Fix Session store not set on request Laravel 11?</title>
      <dc:creator>Wahid</dc:creator>
      <pubDate>Mon, 26 Aug 2024 22:02:43 +0000</pubDate>
      <link>https://dev.to/abdulwahidkahar/how-to-fix-session-store-not-set-on-request-laravel-11-2d4p</link>
      <guid>https://dev.to/abdulwahidkahar/how-to-fix-session-store-not-set-on-request-laravel-11-2d4p</guid>
      <description>&lt;p&gt;Add the following code in the bootstrap/app.php file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use Illuminate\Session\Middleware\StartSession;
$middleware-&amp;gt;append(StartSession::class);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft62zzvjz056xs3ctfetk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft62zzvjz056xs3ctfetk.png" alt="Image description" width="800" height="568"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is because the way we register custom middleware has changed slightly compared to Laravel 10 and earlier versions.&lt;/p&gt;

&lt;p&gt;Hope this helps, thank you!&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>problemsolve</category>
    </item>
    <item>
      <title>How to fix auto import not working in a React, TypeScript project</title>
      <dc:creator>Wahid</dc:creator>
      <pubDate>Thu, 01 Aug 2024 16:19:23 +0000</pubDate>
      <link>https://dev.to/abdulwahidkahar/how-to-fix-auto-import-not-working-in-a-react-typescript-project-5hm6</link>
      <guid>https://dev.to/abdulwahidkahar/how-to-fix-auto-import-not-working-in-a-react-typescript-project-5hm6</guid>
      <description>&lt;p&gt;Make sure you have installed the "ES7+ React/Redux/React-Native snippets" extension in your VS Code. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hlcfi0v27lpw49gm5b6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hlcfi0v27lpw49gm5b6.png" alt="Image description" width="800" height="225"&gt;&lt;/a&gt;Ensure its status is 'disable'.&lt;/p&gt;

&lt;p&gt;Also, install the "TypeScript and JavaScript Language Features" extension. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5m9xzwfqij121tz0w5uf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5m9xzwfqij121tz0w5uf.png" alt="Image description" width="800" height="225"&gt;&lt;/a&gt; Ensure its status is 'disable.'&lt;/p&gt;

</description>
      <category>react</category>
      <category>typescript</category>
      <category>javascript</category>
      <category>autoimport</category>
    </item>
  </channel>
</rss>
