<?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: Imran Yahya</title>
    <description>The latest articles on DEV Community by Imran Yahya (@imranyahya69).</description>
    <link>https://dev.to/imranyahya69</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%2F1444632%2F59765899-73aa-4aaf-bb48-ec01fc60cb63.jpeg</url>
      <title>DEV Community: Imran Yahya</title>
      <link>https://dev.to/imranyahya69</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/imranyahya69"/>
    <language>en</language>
    <item>
      <title>Laravel Envoy Beginner</title>
      <dc:creator>Imran Yahya</dc:creator>
      <pubDate>Fri, 26 Apr 2024 14:09:03 +0000</pubDate>
      <link>https://dev.to/imranyahya69/laravel-envoy-beginner-4e54</link>
      <guid>https://dev.to/imranyahya69/laravel-envoy-beginner-4e54</guid>
      <description>&lt;p&gt;🚀 Automate Your Deployment Tasks with Laravel Envoy&lt;br&gt;
Have you tried Laravel Envoy yet? It's an elegant solution for automating common deployment tasks, making your development workflow smoother and more efficient. Envoy could be a game-changer if you're managing deployment processes and want to streamline them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Laravel Envoy?&lt;/strong&gt;&lt;br&gt;
Laravel Envoy is a task runner built specifically for Laravel projects. It lets you define common SSH tasks as simple, fluent PHP scripts. With Envoy, you can automate tasks like deploying code, running migrations, clearing caches, and more, all with minimal configuration and maximum flexibility.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-Life Example&lt;/strong&gt;: Automating Deployment&lt;/p&gt;

&lt;p&gt;Let's look at a real-life example of how Envoy can simplify a deployment process:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario&lt;/strong&gt;: You have a Laravel application hosted on a remote server, and you want to automate the deployment process every time you push changes to your Git repository.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install Envoy&lt;/strong&gt;:
First, ensure Envoy is installed globally on your machine:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer global require laravel/envoy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Define Your Envoy Task&lt;/strong&gt;:
Create an Envoy.blade.php file in your Laravel project's root directory:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; @servers(['web' =&amp;gt; 'your-server-ip'])

   @task('deploy', ['on' =&amp;gt; 'web'])

       cd /path/to/your/project

       git pull origin master

       composer install --no-dev

       php artisan migrate --force

       php artisan optimize

   @endtask

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run Your Envoy Task&lt;/strong&gt;:
Execute the deployment task via the command line:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;envoy run deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Benefits of Using Envoy&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Consistency&lt;/strong&gt;: Ensures that deployment tasks are performed identically every time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automation&lt;/strong&gt;: Reduces manual intervention and potential for errors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility&lt;/strong&gt;: Easily customize tasks based on your project's requirements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration&lt;/strong&gt;: Works seamlessly with Laravel projects.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By leveraging Laravel Envoy, you can save time and effort on routine deployment tasks, allowing you to focus more on building and improving your application.&lt;br&gt;
Have you used Laravel Envoy before? Share your experiences or tips in the comments below!&lt;/p&gt;

&lt;h1&gt;
  
  
  Laravel #Envoy #DeploymentAutomation #WebDevelopment #PHP
&lt;/h1&gt;

</description>
    </item>
    <item>
      <title>Laravel DUSK</title>
      <dc:creator>Imran Yahya</dc:creator>
      <pubDate>Tue, 23 Apr 2024 15:41:00 +0000</pubDate>
      <link>https://dev.to/imranyahya69/laravel-dusk-35ki</link>
      <guid>https://dev.to/imranyahya69/laravel-dusk-35ki</guid>
      <description>&lt;p&gt;Boost Your Laravel Testing with Dusk&lt;/p&gt;

&lt;p&gt;Ugh, manual browser testing in Laravel is getting you down? Laravel, Dusk to the rescue! This built-in package is your secret weapon for effortless browser automation. &lt;/p&gt;

&lt;p&gt;With Dusk, you can write expressive tests that mimic real user interactions. Say goodbye to repetitive clicking and form filling - Dusk can handle it all!  &lt;/p&gt;

&lt;p&gt;Here's Why You'll Love Dusk:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Effortless Automation: Write tests that act like real users, streamlining your development workflow.&lt;/li&gt;
&lt;li&gt;Expressive Tests: Clear and concise code makes tests easy to understand and maintain. &lt;/li&gt;
&lt;li&gt;Faster Feedback: Automate repetitive tasks to catch bugs quicker and improve code quality.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Imagine this Scenario:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Testing a user registration flow can be a chore. But with Dusk, it's a breeze! You can:&lt;/li&gt;
&lt;li&gt;Visit the registration page.&lt;/li&gt;
&lt;li&gt;Fill in the form with valid data (think real user input ).&lt;/li&gt;
&lt;li&gt;Submit the form and assert successful registration (e.g., confirmation message).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sample Code Snippet:&lt;/strong&gt;&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 Tests\Browser;
use Laravel\Dusk\Browser;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Tests\TestCase;
class UserRegistrationTest extends TestCase
{
    use DatabaseMigrations;

    public function test_user_can_register()
    {
        $this-&amp;gt;browse(function (Browser $browser) {
            $browser-&amp;gt;visit('/register')
                -&amp;gt;type('name', 'John Doe')
                -&amp;gt;type('email', 'john.doe@example.com')
                -&amp;gt;type('password', 'secret123')
                -&amp;gt;type('password_confirmation', 'secret123')
                -&amp;gt;press('Register')
                -&amp;gt;assertSee('You have been successfully registered!');
        });
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test error handling for invalid data to ensure a robust system  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://laravel.com/docs/11.x/dusk"&gt;https://laravel.com/docs/11.x/dusk&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Laravel #Dusk #Testing #PHP #WebDev #PHP #TaylorOtwell  #LaravelTesting #PHPUnit #AutomatedTesting #WebDevelopment #WebAutomation #DeveloperTools #CodeQuality #ContinuousIntegration #ContinuousDelivery #LaravelDuskTesting #LaravelDuskFramework #LaravelBrowserTesting #EndToEndTesting #LaravelWebTesting #LaravelCommunity #LaravelTips #PHPDevelopment #OpenSource #DeveloperLife
&lt;/h1&gt;

</description>
      <category>laravel</category>
      <category>dusk</category>
      <category>testing</category>
      <category>php</category>
    </item>
  </channel>
</rss>
