<?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>Forem: sfyan belhaj</title>
    <description>The latest articles on Forem by sfyan belhaj (@sfyanbel).</description>
    <link>https://forem.com/sfyanbel</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%2F1051886%2Fcd89e2f9-14eb-4653-b37d-419fdfcda70c.jpeg</url>
      <title>Forem: sfyan belhaj</title>
      <link>https://forem.com/sfyanbel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sfyanbel"/>
    <language>en</language>
    <item>
      <title>How to Validation Credit Card PHP Laravel ??</title>
      <dc:creator>sfyan belhaj</dc:creator>
      <pubDate>Sat, 25 Mar 2023 00:50:03 +0000</pubDate>
      <link>https://forem.com/sfyanbel/how-to-validation-credit-card-php-laravel--3pgh</link>
      <guid>https://forem.com/sfyanbel/how-to-validation-credit-card-php-laravel--3pgh</guid>
      <description>&lt;p&gt;How to Validation Credit Card PHP Laravel ??&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qIoWBs0H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vbcaz5bxpimidwgn5le.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qIoWBs0H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vbcaz5bxpimidwgn5le.jpg" alt="Image description" width="317" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;there is a question in mind for some Developers How do some Websites check the type of Credit Card and then Submit it to the API Visa or Master Card, etc. … How is this Working?&lt;/p&gt;

&lt;p&gt;I will today offer a library in Laravel to Provide the Solution in just 2 lines of Code !! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/sfyanbel/CreditCardValidation%C2%A0"&gt;https://github.com/sfyanbel/CreditCardValidation &lt;/a&gt;&lt;br&gt;
How to install it in your Laravel Project?&lt;br&gt;
&lt;code&gt;composer require sfyanbel/credit-card-validation&lt;/code&gt;&lt;/p&gt;

&lt;p&gt; How to use&lt;br&gt;
&lt;/p&gt;

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

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use sfyanbel\CreditCardValidation\CreditCard;

class TestController extends Controller
{

    function test(){

        $ob = new CreditCard();
        return $ob-&amp;gt;getTypeCreditCard("43943418067844");

    }

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

&lt;/div&gt;



&lt;p&gt;in This Example, we use this Card "43943418067844" and this will return the Following &lt;code&gt;['Visa',2]&lt;/code&gt;&lt;br&gt;
first index name of the Card&lt;br&gt;
second index id of the Card&lt;br&gt;
and for other Card, you will find this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['AmericanExpress',1] , ['Visa',2] , ['MasterCards',3] , ['Discover',4]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and for other numbers not Defined&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['String incorrect'];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is in case the length of the card numbers is incorrect&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['The count of digits is incorrect'];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>creditcard</category>
      <category>validation</category>
      <category>mastercar</category>
      <category>laravel</category>
    </item>
  </channel>
</rss>
