<?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: Ripon Uddin</title>
    <description>The latest articles on DEV Community by Ripon Uddin (@ripon52).</description>
    <link>https://dev.to/ripon52</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%2F619213%2F3ba030c2-794d-40ed-a241-c6c60ea932df.jpeg</url>
      <title>DEV Community: Ripon Uddin</title>
      <link>https://dev.to/ripon52</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ripon52"/>
    <language>en</language>
    <item>
      <title>Add Row (Clone)</title>
      <dc:creator>Ripon Uddin</dc:creator>
      <pubDate>Tue, 31 Dec 2024 09:10:48 +0000</pubDate>
      <link>https://dev.to/ripon52/add-row-clone-2a1g</link>
      <guid>https://dev.to/ripon52/add-row-clone-2a1g</guid>
      <description>&lt;p&gt;Today, I will share a simple way to implement cloning and removing tr dynamically and how to keep the last tr without removing it.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Requirements Below: *&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A Selector to append TR&lt;/li&gt;
&lt;li&gt;add/remove selector class
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;table class="table table-hover"&amp;gt;
      &amp;lt;thead&amp;gt;
         &amp;lt;tr&amp;gt;
            &amp;lt;th&amp;gt;Product &amp;lt;/th&amp;gt;
            &amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;
            &amp;lt;th&amp;gt;Action&amp;lt;/th&amp;gt;
          &amp;lt;/tr&amp;gt;
        &amp;lt;/thead&amp;gt;
        &amp;lt;tbody class="productServicesTbody"&amp;gt;
            &amp;lt;tr&amp;gt;
                &amp;lt;td&amp;gt;
                   &amp;lt;input
                      type="text"
                      class="form-control"
                    /&amp;gt;
                &amp;lt;/td&amp;gt;

                &amp;lt;td&amp;gt;
                   &amp;lt;input
                      type="text"
                      class="form-control"
                   /&amp;gt;
                &amp;lt;/td&amp;gt;

                &amp;lt;td&amp;gt;
                    &amp;lt;button type="button" class="btn btn-primary btn-sm addTr"&amp;gt;
                      Add
                    &amp;lt;/button&amp;gt;

                   &amp;lt;button type="button" class="btn btn-danger btn-sm removeTr"&amp;gt;
                      Delete
                    &amp;lt;/button&amp;gt;
                &amp;lt;/td&amp;gt;
             &amp;lt;/tr&amp;gt;
         &amp;lt;/tbody&amp;gt;
   &amp;lt;/table&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  JS Code
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$(document).ready(function() {
        $(document).on('click', '.addTr', function() {
            let $clone = $(this).closest('tr').clone();
            $clone.find('input').val('');

            $('.productServicesTbody').append($clone);
        });

        $(document).on('click', '.removeTr', function() {
            if ($('.productServicesTbody tr').length &amp;gt; 1) {
                $(this).closest('tr').remove();
            }
        });
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here .addTr is an add new tr button selector. And .removeTr is an add new tr button selector.&lt;/p&gt;

&lt;p&gt;Please, let me know your queries in the comment section.&lt;/p&gt;

&lt;h1&gt;
  
  
  HappyCoding #Js #jQuery
&lt;/h1&gt;

</description>
      <category>javascript</category>
      <category>jquery</category>
      <category>frontend</category>
      <category>programming</category>
    </item>
    <item>
      <title>Laravel Sanctum API Broken Issues</title>
      <dc:creator>Ripon Uddin</dc:creator>
      <pubDate>Tue, 18 Jan 2022 18:23:41 +0000</pubDate>
      <link>https://dev.to/ripon52/laravel-sanctum-api-broken-issues-5flo</link>
      <guid>https://dev.to/ripon52/laravel-sanctum-api-broken-issues-5flo</guid>
      <description>&lt;p&gt;** Hey, Lara devs **&lt;/p&gt;

&lt;p&gt;Today I am going to share something with you guys.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Maybe someday it will help you to resolve.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I was working with Laravel Project with sanctum. &lt;br&gt;
We were preparing to go live. And I cleaned the full DB and created a new database user and new database at Digital Ocean Droplet with Linux Ubuntu 20.04.&lt;/p&gt;

&lt;p&gt;After completing the user &amp;amp; database creation. I imported My Local Fresh SQL to the server new database.&lt;/p&gt;

&lt;p&gt;In the meantime somehow id primary key was removed and the data type turn into big-int also auto-increment credentials were removed. &lt;/p&gt;

&lt;p&gt;For that, Records are created without default id increment. ID was 0 for every-rows.&lt;/p&gt;

&lt;p&gt;So, whenever I was trying to log in through API. It's successfully generating API Tokens also saving inside personal_access_tokens  with id 0. I was also able to parse tokens.&lt;/p&gt;

&lt;p&gt;When, I was passing the token with Bearer  to get my profile information. And, I was getting a wired response like 405 Method Not allowed exception. &lt;/p&gt;

&lt;p&gt;I checked locally more than 10 times , everything is working. Also, I tried to down and up Laravel application at production mood.&lt;br&gt;
Nothing worked at all.&lt;/p&gt;

&lt;p&gt;After long period, Once I just dropped the id column and created a new id column with primary index &amp;amp; auto-increment.&lt;br&gt;
It works perfectly now.&lt;/p&gt;

&lt;h1&gt;
  
  
  Server : Droplet,  Digital-Ocean
&lt;/h1&gt;

&lt;h1&gt;
  
  
  OS : Ubuntu 20.04
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Version : Laravel 7
&lt;/h1&gt;

&lt;h1&gt;
  
  
  HappyCoding
&lt;/h1&gt;

&lt;h1&gt;
  
  
  clhg52
&lt;/h1&gt;

</description>
      <category>laravel</category>
      <category>linux</category>
      <category>ubuntu</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
