<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abdulraheem Aftab on Medium]]></title>
        <description><![CDATA[Stories by Abdulraheem Aftab on Medium]]></description>
        <link>https://medium.com/@abdulraheem.aftab100?source=rss-12955bc67509------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ugipqiyOdWXhiz6bXIOzgQ.jpeg</url>
            <title>Stories by Abdulraheem Aftab on Medium</title>
            <link>https://medium.com/@abdulraheem.aftab100?source=rss-12955bc67509------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 22:51:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abdulraheem.aftab100/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Ultimate Guide to Deploying Your Applications on Amazon EC2]]></title>
            <link>https://medium.com/@abdulraheem.aftab100/the-ultimate-guide-to-deploying-your-applications-on-amazon-ec2-22c9aacb58ac?source=rss-12955bc67509------2</link>
            <guid isPermaLink="false">https://medium.com/p/22c9aacb58ac</guid>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[ec2]]></category>
            <dc:creator><![CDATA[Abdulraheem Aftab]]></dc:creator>
            <pubDate>Wed, 03 Apr 2024 05:20:28 GMT</pubDate>
            <atom:updated>2024-05-20T07:22:40.646Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MAS2YRoMExwOHTcYqR02BQ.jpeg" /></figure><p>In this article, we will guide you through all the necessary steps to deploy a project on Amazon Elastic Compute Cloud (EC2). Here are the steps we will cover.<br>1. Launch an EC2 Instance.<br>2. Attach a Security Group to the instance.<br>3. Access the instance via SSH from a local terminal.<br>4. Clone the project repository from Git.<br>5. Configure PM2.<br>6. Configure NGINX</p><h3><strong>1. Launch an EC2 Instance</strong></h3><p>To Launch an Instance through press the Launch instance button on the EC2 dashboard.<br>i. <strong>Choose a name of your instance:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*HaIh2GJVE8bay8yuCUOmtQ.png" /></figure><p>ii. <strong>Choose an Amazon Machine Image (AMI)</strong>: For this guide, we’ll use Amazon Linux as our AMI. The choice of AMI should be aligned with the requirements of your project and the software environment you’re accustomed to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*ANig0CaaWwBhiMi5F-t-qA.png" /></figure><p>iii. <strong>Select an Instance Type:</strong> Choose an instance type that matches the needs of your project. Instance types vary in CPU, memory, storage, and networking capacity, so select one that aligns with your project’s demands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*0gy9bANb1VNAYW9_8LTPUA.png" /></figure><p>iv. <strong>Create or Select a Key Pair:</strong> You’ll need a key pair for SSH access to your instance from your local terminal. If you already have a key pair, you can select it; otherwise, create a new one during the instance setup process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*a9Z3wz8K6sZyvgHnDYiHsA.png" /></figure><p>v. <strong>Configure a Security Group:</strong> Security groups act as a virtual firewall for your instance to control inbound and outbound traffic. Configure your security group rules to allow traffic according to the needs of your project while maintaining security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*BmmOr8fcHPUUz3gyeRDoCQ.png" /></figure><p>vi. <strong>Configure Storage:</strong> Adjust the storage settings based on your project’s requirements. AWS offers various storage options, so choose the one that provides the performance and capacity your project needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*_h8R9IDl7jjzXpTS9bJWQw.png" /></figure><p>vii. <strong>Press Launch Instance button</strong></p><h3><strong>2. Attach a Security Group to the instance</strong></h3><p>Security groups serve as a virtual firewall for your instances, regulating both inbound and outbound traffic. When you create an instance on EC2, it automatically assigns a default security group to your instance. In my case, the assigned security group is launch-wizard-3.</p><p>For inbound traffic (incoming traffic to your EC2 instances)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*65Dn5-zgrOtYj0svO0e8-A.png" /></figure><ul><li>Port 22 to be open from all sources, supporting the SSH protocol, which enables secure connections from a local terminal to the instance.</li><li>Port 80 also open from all sources, facilitating HTTP protocol requests, which are essential for web traffic.</li></ul><p>It’s worth noting that the source for these ports can be customized from ‘all’ to specific IP addresses, enhancing security by restricting access to known IPs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U1gRigl3R8idxMthhMCdRw.png" /></figure><p>Regarding outbound traffic (traffic leaving your EC2 instances), the default configuration permits all protocols and ports to connect to any destination. This open setting allows your instance to freely communicate outward but can be adjusted as needed to align with your security policies.</p><h3><strong>3. Access the instance via SSH from a local terminal</strong></h3><p>Connecting to your EC2 instance from a local terminal is straightforward. During the instance creation process, you are prompted to generate a new key pair or select an existing one. This key pair is crucial for establishing a secure SSH connection. Once you create a new key pair, AWS automatically downloads it to your system as a file with a .pem extension.</p><p>It’s important to save this file in a secure directory on your computer. This .pem file acts as your authentication key to securely connect to your instance from the local terminal.<br>To connect to your EC2 instance via SSH, first navigate to the directory where you’ve saved the .pem file. Use the following command:</p><pre>ssh -i Sample-key-pair.pem ec2-user@107.21.84.172</pre><p>Here, Sample-key-pair.pem is the name of your key pair file, and 107.21.84.172 represents the public IPv4 address of your EC2 instance.</p><p>If you’re attempting this connection for the first time, you might encounter an error due to insufficient permissions for the .pem file. To resolve this, you need to modify the file’s permissions to ensure it’s securely accessible. Run the command:</p><pre>chmod 0400 Sample-key-pair.pem</pre><p>This command sets the necessary permissions. After updating the file permissions, re-enter the SSH command. You should now be successfully connected to your instance.</p><h3>4. Clone the project repository from Git</h3><p>First, let’s create a sample directory within your EC2 instance where you can clone your repository and manage your project files.</p><pre>sudo yum update<br>sudo yum install git</pre><p>then clone the repository into the instance<br>Now install all the dependencies to run your project like i am case my project is on Nest.js like<br>i. Node<br>ii. npm<br>iii. nestjs/cli</p><p>And run the project to check is every thing is working.</p><h3>5. Configure PM2</h3><p>PM2 is a powerful, widely-used process manager. It provides several key benefits that make it a preferred choice for managing applications in production environments</p><pre>sudo apt update<br>sudo npm install pm2@latest -g<br>sudo pm2 -v</pre><p>Now run your project on pm2 if then you close the terminal the project is still run on banck end</p><pre>pm2 start &quot;npm run start:dev&quot; --name=&quot;sample_nest_project&quot;</pre><p>Your project is running</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dSPmSfWWacMMk3-AavQ6Lg.png" /></figure><p>your can delete, see log etc If your want more detail read about <a href="https://pm2.keymetrics.io/docs/usage/process-management/"><em>pm2</em></a><em>.</em></p><h3>5. Configure NGINX</h3><p>First you need to install and start the NGINX on your instance.</p><pre>sudo yum install nginx<br>sudo systemctl start nginx<br>systemctl status nginx</pre><p>Now Config the NGINX</p><pre>sudo nano /etc/nginx/nginx.conf</pre><p>The nginx.conf file is structured in directives and blocks. Here&#39;s a very basic overview:</p><ul><li>Events block: This block sets global options that affect NGINX’s handling of connections.</li><li>Http block: This includes server blocks and other global http settings.</li><li>Server block: Defines a virtual server to host a site. Within this, you can define locations (URLs) that NGINX should handle in specific ways.</li></ul><p>Step i. <strong>Edit the Server Block:</strong> Within the server block that listens on port 80, you’ll need to add a location directive (or modify the existing one) to act as a proxy to your application running on port 8000. Here is a simple example configuration:</p><pre>server {<br>    listen 80;<br>    server_name your_domain.com www.your_domain.com;<br><br>    location / {<br>        proxy_pass http://localhost:8000;<br>        proxy_set_header Host $host;<br>        proxy_set_header X-Real-IP $remote_addr;<br>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>        proxy_set_header X-Forwarded-Proto $scheme;<br>    }<br>}</pre><p>Step ii. <strong>Test the NGINX Configuration:</strong> Always test your NGINX configuration for syntax errors before applying it:</p><pre>sudo nginx -t</pre><p>Step iii. <strong>Reload NGINX:</strong> To apply your changes without dropping connections, reload NGINX:</p><pre>sudo systemctl reload nginx</pre><p><strong>Now hit the Public IPv4 address of Instance on your browser (without https) Thanks .</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22c9aacb58ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laravel Fortify]]></title>
            <link>https://medium.com/@abdulraheem.aftab100/laravel-fortify-cde27e2d5f7b?source=rss-12955bc67509------2</link>
            <guid isPermaLink="false">https://medium.com/p/cde27e2d5f7b</guid>
            <category><![CDATA[laravel-fortify]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[fortify]]></category>
            <dc:creator><![CDATA[Abdulraheem Aftab]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 05:54:22 GMT</pubDate>
            <atom:updated>2024-03-20T05:54:22.743Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*WebW3YWz_m9BO5Z6QNZTmQ.png" /></figure><p>Laravel Fortify is a backend controller support package for Laravel applications. It offers features for authentication and application security, including the ability to handle login, registration, email verification, two-factor authentication, session management, and password confirmation. Essentially, Fortify acts as a headless authentication backend for Laravel, allowing developers to build their own authentication frontends using the tools and libraries they prefer, while still benefiting from the robust security and authentication features that Laravel provides.</p><p>Fortify is designed to be flexible and customizable, enabling developers to define their own routes, views, and business logic, while leveraging Fortify’s secure authentication functionalities. Since it’s a Laravel-supported package, it integrates seamlessly with the Laravel ecosystem, making it a popular choice for developers looking to add authentication to their Laravel applications without the need for a full frontend package like Laravel Jetstream or Breeze.</p><p>Create a new Laravel project via Composer’s create-project command</p><pre>composer create-project laravel/laravel:^11.0 fortify</pre><p>Now install The Fortify on the laravel project:</p><pre>composer require laravel/fortify</pre><p>Next, publish Fortify’s resources:</p><pre>php artisan vendor:publish --provider=&quot;Laravel\Fortify\FortifyServiceProvider&quot;</pre><p>Next, you should migrate your database:</p><pre>php artisan migrate</pre><p>After installing the fortify package it create fortify function in the app folder and also have config file of the fortify in the config folder and also with fortify Service provider in the provider folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*kDsMlbf5GbnEAPcpUUcz3w.png" /></figure><p>Your can change the features, prefix, domain, guard and middlewares from the fortify.php</p><pre>&lt;?php<br><br>use App\Providers\RouteServiceProvider;<br>use Laravel\Fortify\Features;<br><br>return [<br><br>    /*<br>    |--------------------------------------------------------------------------<br>    | Fortify Guard<br>    |--------------------------------------------------------------------------<br>    |<br>    | Here you may specify which authentication guard Fortify will use while<br>    | authenticating users. This value should correspond with one of your<br>    | guards that is already present in your &quot;auth&quot; configuration file.<br>    |<br>    */<br><br>    &#39;guard&#39; =&gt; &#39;web&#39;,<br><br>    /*<br>    |--------------------------------------------------------------------------<br>    | Fortify Password Broker<br>    |--------------------------------------------------------------------------<br>    |<br>    | Here you may specify which password broker Fortify can use when a user<br>    | is resetting their password. This configured value should match one<br>    | of your password brokers setup in your &quot;auth&quot; configuration file.<br>    |<br>    */<br><br>    &#39;passwords&#39; =&gt; &#39;users&#39;,<br><br>    /*<br>    |--------------------------------------------------------------------------<br>    | Username / Email<br>    |--------------------------------------------------------------------------<br>    |<br>    | This value defines which model attribute should be considered as your<br>    | application&#39;s &quot;username&quot; field. Typically, this might be the email<br>    | address of the users but you are free to change this value here.<br>    |<br>    | Out of the box, Fortify expects forgot password and reset password<br>    | requests to have a field named &#39;email&#39;. If the application uses<br>    | another name for the field you may define it below as needed.<br>    |<br>    */<br><br>    &#39;username&#39; =&gt; &#39;email&#39;,<br><br>    &#39;email&#39; =&gt; &#39;email&#39;,<br><br>    /*<br>    |--------------------------------------------------------------------------<br>    | Lowercase Usernames<br>    |--------------------------------------------------------------------------<br>    |<br>    | This value defines whether usernames should be lowercased before saving<br>    | them in the database, as some database system string fields are case<br>    | sensitive. You may disable this for your application if necessary.<br>    |<br>    */<br><br>    &#39;lowercase_usernames&#39; =&gt; true,<br><br>    /*<br>    |--------------------------------------------------------------------------<br>    | Home Path<br>    |--------------------------------------------------------------------------<br>    |<br>    | Here you may configure the path where users will get redirected during<br>    | authentication or password reset when the operations are successful<br>    | and the user is authenticated. You are free to change this value.<br>    |<br>    */<br><br>    &#39;home&#39; =&gt; RouteServiceProvider::HOME,<br><br>    /*<br>    |--------------------------------------------------------------------------<br>    | Fortify Routes Prefix / Subdomain<br>    |--------------------------------------------------------------------------<br>    |<br>    | Here you may specify which prefix Fortify will assign to all the routes<br>    | that it registers with the application. If necessary, you may change<br>    | subdomain under which all of the Fortify routes will be available.<br>    |<br>    */<br><br>    &#39;prefix&#39; =&gt; &#39;&#39;,<br><br>    &#39;domain&#39; =&gt; null,<br><br>    /*<br>    |--------------------------------------------------------------------------<br>    | Fortify Routes Middleware<br>    |--------------------------------------------------------------------------<br>    |<br>    | Here you may specify which middleware Fortify will assign to the routes<br>    | that it registers with the application. If necessary, you may change<br>    | these middleware but typically this provided default is preferred.<br>    |<br>    */<br><br>    &#39;middleware&#39; =&gt; [&#39;web&#39;],<br><br>    /*<br>    |--------------------------------------------------------------------------<br>    | Rate Limiting<br>    |--------------------------------------------------------------------------<br>    |<br>    | By default, Fortify will throttle logins to five requests per minute for<br>    | every email and IP address combination. However, if you would like to<br>    | specify a custom rate limiter to call then you may specify it here.<br>    |<br>    */<br><br>    &#39;limiters&#39; =&gt; [<br>        &#39;login&#39; =&gt; &#39;login&#39;,<br>        &#39;two-factor&#39; =&gt; &#39;two-factor&#39;,<br>    ],<br><br>    /*<br>    |--------------------------------------------------------------------------<br>    | Register View Routes<br>    |--------------------------------------------------------------------------<br>    |<br>    | Here you may specify if the routes returning views should be disabled as<br>    | you may not need them when building your own application. This may be<br>    | especially true if you&#39;re writing a custom single-page application.<br>    |<br>    */<br><br>    &#39;views&#39; =&gt; true,<br><br>    /*<br>    |--------------------------------------------------------------------------<br>    | Features<br>    |--------------------------------------------------------------------------<br>    |<br>    | Some of the Fortify features are optional. You may disable the features<br>    | by removing them from this array. You&#39;re free to only remove some of<br>    | these features or you can even remove all of these if you need to.<br>    |<br>    */<br><br>    &#39;features&#39; =&gt; [<br>        Features::registration(),<br>        Features::resetPasswords(),<br>        Features::emailVerification(),<br>        Features::updateProfileInformation(),<br>        Features::updatePasswords(),<br>        Features::twoFactorAuthentication([<br>            &#39;confirm&#39; =&gt; true,<br>            &#39;confirmPassword&#39; =&gt; true,<br>            // &#39;window&#39; =&gt; 0,<br>        ]),<br>    ],<br><br>];</pre><p>Fortify Service provider file</p><pre>&lt;?php<br><br>namespace App\Providers;<br><br>use App\Actions\Fortify\CreateNewUser;<br>use App\Actions\Fortify\ResetUserPassword;<br>use App\Actions\Fortify\UpdateUserPassword;<br>use App\Actions\Fortify\UpdateUserProfileInformation;<br>use App\Models\User;<br>use Illuminate\Http\Request;<br>use Illuminate\Support\Facades\Hash;<br>use Illuminate\Support\ServiceProvider;<br>use Laravel\Fortify\Fortify;<br><br>class FortifyServiceProvider extends ServiceProvider<br>{<br>    /**<br>     * Register any application services.<br>     *<br>     * @return void<br>     */<br>    public function register()<br>    {<br>        //<br>    }<br><br>    /**<br>     * Bootstrap any application services.<br>     *<br>     * @return void<br>     */<br>    public function boot()<br>    {<br>        Fortify::createUsersUsing(CreateNewUser::class);<br>        Fortify::updateUserProfileInformationUsing(UpdateUserProfileInformation::class);<br>        Fortify::updateUserPasswordsUsing(UpdateUserPassword::class);<br>        Fortify::resetUserPasswordsUsing(ResetUserPassword::class);<br><br>        Fortify::registerView(function () {<br>            return view(&#39;auth.register&#39;);<br>        });<br><br>        Fortify::loginView(function () {<br>            return view(&#39;auth.login&#39;);<br>        });<br><br>        Fortify::requestPasswordResetLinkView(function () {<br>            return view(&#39;auth.forgot-password&#39;);<br>        });<br><br>        Fortify::resetPasswordView(function ($request) {<br>            return view(&#39;auth.reset-password&#39;, [&#39;request&#39; =&gt; $request]);<br>        });<br><br>        Fortify::verifyEmailView(function () {<br>            return view(&#39;auth.verify-email&#39;);<br>        });<br><br>        Fortify::confirmPasswordView(function () {<br>            return view(&#39;auth.password-confirm&#39;);<br>        });<br><br>        Fortify::twoFactorChallengeView(function () {<br>            return view(&#39;auth.two-factor-challenge&#39;);<br>        });<br>    }<br>}</pre><p>and you also modify the create user, update user and reset password from the fortify action function. That why I love the fortify because i give list of features <br>1. Register user<br>2. Reset Password<br>3. Email Verify<br>4. Update Profile<br>5. Update Password<br>6. Two Factor Authentication<br>and it is simple to modify.</p><ol><li><strong>Register User<br></strong>To make a register page you just define register view function in the fortify service provider and the view navigate through the view folder</li></ol><pre>Fortify::registerView(function () {<br>            return view(&#39;auth.register&#39;);<br>        });</pre><p>Create user <br>This Create New User class is called from the Fortify service Provider</p><pre>&lt;?php<br><br>namespace App\Actions\Fortify;<br><br>use App\Models\User;<br>use Illuminate\Support\Facades\Hash;<br>use Illuminate\Support\Facades\Validator;<br>use Illuminate\Validation\Rule;<br>use Laravel\Fortify\Contracts\CreatesNewUsers;<br><br>class CreateNewUser implements CreatesNewUsers<br>{<br>    use PasswordValidationRules;<br><br>    /**<br>     * Validate and create a newly registered user.<br>     *<br>     * @param  array  $input<br>     * @return \App\Models\User<br>     */<br>    public function create(array $input)<br>    {<br>        Validator::make($input, [<br>            &#39;name&#39; =&gt; [&#39;required&#39;, &#39;string&#39;, &#39;max:255&#39;],<br>            &#39;email&#39; =&gt; [<br>                &#39;required&#39;,<br>                &#39;string&#39;,<br>                &#39;email&#39;,<br>                &#39;max:255&#39;,<br>                Rule::unique(User::class),<br>            ],<br>            &#39;password&#39; =&gt; $this-&gt;passwordRules(),<br>        ])-&gt;validate();<br><br>        return User::create([<br>            &#39;name&#39; =&gt; $input[&#39;name&#39;],<br>            &#39;email&#39; =&gt; $input[&#39;email&#39;],<br>            &#39;password&#39; =&gt; Hash::make($input[&#39;password&#39;]),<br>        ]);<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vZEdEjecjQSkHLbAENiiiw.png" /></figure><p>2. <strong>Login<br></strong>We can modify Login logic.</p><pre>Fortify::authenticateUsing(function (Request $request) {<br>        $user = User::where(&#39;email&#39;, $request-&gt;email)-&gt;first();<br> <br>        if ($user &amp;&amp;<br>            Hash::check($request-&gt;password, $user-&gt;password)) {<br>            return $user;<br>        }<br>    });</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8UTttbWn8DbOoGGwp1PkKA.png" /></figure><p>2. <strong>Reset Password</strong></p><pre>Fortify::requestPasswordResetLinkView(function () {<br>            return view(&#39;auth.forgot-password&#39;);<br>        });</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T-14_w3sMmrYHOci3Ibwyg.png" /></figure><p>3. <strong>Email Verify</strong></p><pre>Fortify::verifyEmailView(function () {<br>            return view(&#39;auth.verify-email&#39;);<br>        });</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*7mIv_Ybqqfp_BVVVZk3LYw.png" /></figure><p>4. <strong>Update Profile</strong></p><pre>&lt;?php<br><br>namespace App\Actions\Fortify;<br><br>use Illuminate\Contracts\Auth\MustVerifyEmail;<br>use Illuminate\Support\Facades\Validator;<br>use Illuminate\Validation\Rule;<br>use Laravel\Fortify\Contracts\UpdatesUserProfileInformation;<br><br>class UpdateUserProfileInformation implements UpdatesUserProfileInformation<br>{<br>    /**<br>     * Validate and update the given user&#39;s profile information.<br>     *<br>     * @param  mixed  $user<br>     * @param  array  $input<br>     * @return void<br>     */<br>    public function update($user, array $input)<br>    {<br>        Validator::make($input, [<br>            &#39;name&#39; =&gt; [&#39;required&#39;, &#39;string&#39;, &#39;max:255&#39;],<br><br>            &#39;email&#39; =&gt; [<br>                &#39;required&#39;,<br>                &#39;string&#39;,<br>                &#39;email&#39;,<br>                &#39;max:255&#39;,<br>                Rule::unique(&#39;users&#39;)-&gt;ignore($user-&gt;id),<br>            ],<br>        ])-&gt;validateWithBag(&#39;updateProfileInformation&#39;);<br><br>        if ($input[&#39;email&#39;] !== $user-&gt;email &amp;&amp;<br>            $user instanceof MustVerifyEmail) {<br>            $this-&gt;updateVerifiedUser($user, $input);<br>        } else {<br>            $user-&gt;forceFill([<br>                &#39;name&#39; =&gt; $input[&#39;name&#39;],<br>                &#39;email&#39; =&gt; $input[&#39;email&#39;],<br>            ])-&gt;save();<br>        }<br>    }<br><br>    /**<br>     * Update the given verified user&#39;s profile information.<br>     *<br>     * @param  mixed  $user<br>     * @param  array  $input<br>     * @return void<br>     */<br>    protected function updateVerifiedUser($user, array $input)<br>    {<br>        $user-&gt;forceFill([<br>            &#39;name&#39; =&gt; $input[&#39;name&#39;],<br>            &#39;email&#39; =&gt; $input[&#39;email&#39;],<br>            &#39;email_verified_at&#39; =&gt; null,<br>        ])-&gt;save();<br><br>        $user-&gt;sendEmailVerificationNotification();<br>    }<br>}</pre><p>5. <strong>Update Password</strong></p><pre>&lt;?php<br><br>namespace App\Actions\Fortify;<br><br>use Illuminate\Support\Facades\Hash;<br>use Illuminate\Support\Facades\Validator;<br>use Laravel\Fortify\Contracts\UpdatesUserPasswords;<br><br>class UpdateUserPassword implements UpdatesUserPasswords<br>{<br>    use PasswordValidationRules;<br><br>    /**<br>     * Validate and update the user&#39;s password.<br>     *<br>     * @param  mixed  $user<br>     * @param  array  $input<br>     * @return void<br>     */<br>    public function update($user, array $input)<br>    {<br>        Validator::make($input, [<br>            &#39;current_password&#39; =&gt; [&#39;required&#39;, &#39;string&#39;],<br>            &#39;password&#39; =&gt; $this-&gt;passwordRules(),<br>        ])-&gt;after(function ($validator) use ($user, $input) {<br>            if (! Hash::check($input[&#39;current_password&#39;], $user-&gt;password)) {<br>                $validator-&gt;errors()-&gt;add(&#39;current_password&#39;, __(&#39;The provided password does not match your current password.&#39;));<br>            }<br>        })-&gt;validateWithBag(&#39;updatePassword&#39;);<br><br>        $user-&gt;forceFill([<br>            &#39;password&#39; =&gt; Hash::make($input[&#39;password&#39;]),<br>        ])-&gt;save();<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*spSsK0jF4rNjuZ_fX3tKYg.png" /></figure><p>6. <strong>Two Factor Authentication</strong></p><pre> Fortify::twoFactorChallengeView(function () {<br>            return view(&#39;auth.two-factor-challenge&#39;);<br>        });</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*eq1c0md7qxcou80ou5iWng.png" /></figure><p>We can also do multi authentication using fortify.<br>Thanks<br>Referece <br><a href="https://laravel.com/docs/8.x/fortify">https://laravel.com/docs/8.x/fortify</a><br><a href="https://www.youtube.com/watch?v=CLsyHP7x0N0">https://www.youtube.com/watch?v=CLsyHP7x0N0</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cde27e2d5f7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>