<?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: Ahmed sliman</title>
    <description>The latest articles on DEV Community by Ahmed sliman (@ahmedsliman).</description>
    <link>https://dev.to/ahmedsliman</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F29872%2Fa7b908e8-241f-4d2d-ac12-46cc9093c794.jpeg</url>
      <title>DEV Community: Ahmed sliman</title>
      <link>https://dev.to/ahmedsliman</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ahmedsliman"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Ahmed sliman</dc:creator>
      <pubDate>Tue, 22 Sep 2026 09:57:37 +0000</pubDate>
      <link>https://dev.to/ahmedsliman/-5dmi</link>
      <guid>https://dev.to/ahmedsliman/-5dmi</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/ahmedsliman/the-clean-architecture-in-php-1mno" class="crayons-story__hidden-navigation-link"&gt;The Clean Architecture in PHP: A Short Review&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/ahmedsliman" class="crayons-avatar  crayons-avatar--l  "&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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F29872%2Fa7b908e8-241f-4d2d-ac12-46cc9093c794.jpeg" alt="ahmedsliman profile" class="crayons-avatar__image" width="460" height="460"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/ahmedsliman" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Ahmed sliman
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Ahmed sliman
                
                
              
              &lt;div id="story-author-preview-content-1023799" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/ahmedsliman" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F29872%2Fa7b908e8-241f-4d2d-ac12-46cc9093c794.jpeg" class="crayons-avatar__image" alt="" width="460" height="460"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Ahmed sliman&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/ahmedsliman/the-clean-architecture-in-php-1mno" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Mar 15 '22&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/ahmedsliman/the-clean-architecture-in-php-1mno" id="article-link-1023799"&gt;
          The Clean Architecture in PHP: A Short Review
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/php"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;php&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/solid"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;solid&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/designpatterns"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;designpatterns&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/architecture"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;architecture&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/ahmedsliman/the-clean-architecture-in-php-1mno" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt;&amp;nbsp;reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/ahmedsliman/the-clean-architecture-in-php-1mno#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Laravel Events 101</title>
      <dc:creator>Ahmed sliman</dc:creator>
      <pubDate>Tue, 19 Dec 2023 09:08:04 +0000</pubDate>
      <link>https://dev.to/ahmedsliman/laravel-events-for-newbies-1kpo</link>
      <guid>https://dev.to/ahmedsliman/laravel-events-for-newbies-1kpo</guid>
      <description>&lt;h2&gt;
  
  
  What is Event-Driven Programming?
&lt;/h2&gt;

&lt;p&gt;Simply put, events are actions that occur within an application. Coming from the world of JavaScript, you probably understand events as user actions such as mouse click, mouseover, key press, etc. In Laravel, events can be various actions that occur within an application such as email notifications, logging, user sign-up, CRUD operations, etc. Laravel events provide a simple observer implementation, allowing you to subscribe and listen for various events that occur in your application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why should we use Events?!
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Easier to maintain (SOLID).&lt;/li&gt;
&lt;li&gt;Less risk of regression,&lt;/li&gt;
&lt;li&gt;Make classes responsible for only one thing,&lt;/li&gt;
&lt;li&gt;Make team’s work easier,&lt;/li&gt;
&lt;li&gt;Expect the unexpected, If you ever need to add new functionality, all you need to do is create a new listener and register it with the event. Job is done!&lt;/li&gt;
&lt;li&gt;Your logic is separated and now the Controller has much-reduced responsibility&lt;/li&gt;
&lt;li&gt;Allow asynchronous tasks easily (queues in Laravel).&lt;/li&gt;
&lt;li&gt;Be ready for broadcasting&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Let's compare two pieces of code with/without events
&lt;/h2&gt;

&lt;h3&gt;
  
  
  With
&lt;/h3&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%2Fi%2Fy7e2o0uesnkyxn8q7l4v.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%2Fi%2Fy7e2o0uesnkyxn8q7l4v.png" alt="Alt Text" width="557" height="719"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Without
&lt;/h3&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%2Fi%2Fqdpjjp8cdroftvyn4yed.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%2Fi%2Fqdpjjp8cdroftvyn4yed.png" alt="Alt Text" width="416" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How do we create Events?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Defining Our Events
&lt;/h3&gt;



&lt;p&gt;&lt;code&gt;php artisan make:event UserRegistered&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The event has been created successfully&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan make:listener SendWelcomeMail --event=UserRegistered&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The listener has been created successfully&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan make:listener SignupForWeeklyNewsletter --event=UserRegistered&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The listener has been created successfully&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan make:listener SendSMS --event=UserRegistered&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The listener has been created successfully&lt;/p&gt;

&lt;h2&gt;
  
  
  ESP - EventServiceProvider
&lt;/h2&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%2Fi%2F0svwe6ivibsptoew00nw.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%2Fi%2F0svwe6ivibsptoew00nw.png" alt="Alt Text" width="557" height="243"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan event:generate&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Events and Listeners generated successfully&lt;/p&gt;

&lt;h2&gt;
  
  
  Stopping The Propagation Of An Event
&lt;/h2&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%2Fi%2Fi1pjxkfyjxmvy95ct6f2.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%2Fi%2Fi1pjxkfyjxmvy95ct6f2.png" alt="Alt Text" width="688" height="313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Eloquent Native Events
&lt;/h2&gt;

&lt;p&gt;With his Eloquent model, Laravel will automatically fire &lt;strong&gt;created&lt;/strong&gt;, &lt;strong&gt;saved&lt;/strong&gt;, &lt;strong&gt;updated&lt;/strong&gt; and &lt;strong&gt;deleted&lt;/strong&gt; events respectively.&lt;/p&gt;

&lt;p&gt;To start listening to model events, define a &lt;strong&gt;$dispatchesEvents&lt;/strong&gt; property on your Eloquent model. This property maps various points of the Eloquent &lt;strong&gt;model's&lt;/strong&gt; lifecycle to your event classes. Each model event class should expect to receive an instance of the affected model via its constructor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Eloquent Native Events
&lt;/h2&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%2Fi%2Fz8l2njjzzyioogdrctx5.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%2Fi%2Fz8l2njjzzyioogdrctx5.png" alt="Alt Text" width="438" height="141"&gt;&lt;/a&gt;&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%2Fi%2F3d7qwjxzpk4jm87ya0n0.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%2Fi%2F3d7qwjxzpk4jm87ya0n0.png" alt="Alt Text" width="477" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>events</category>
    </item>
    <item>
      <title>Why MobX?</title>
      <dc:creator>Ahmed sliman</dc:creator>
      <pubDate>Wed, 07 Sep 2022 09:27:34 +0000</pubDate>
      <link>https://dev.to/ahmedsliman/why-mobx-40o8</link>
      <guid>https://dev.to/ahmedsliman/why-mobx-40o8</guid>
      <description>&lt;p&gt;&lt;strong&gt;MobX?&lt;/strong&gt;&lt;br&gt;
It's an open source state management tool. When creating a web application, developers often seek an effective way of managing state within their applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why MobX?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MobX get you an ability to handle multiple data-structures of states&lt;/li&gt;
&lt;li&gt;Sync render by tracking  observable pieces of state&lt;/li&gt;
&lt;li&gt;Help on scalable applications with manage state easily&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What is State?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Application state refers to the entire model of an application and can contain different data types including arrays, numbers, and objects. In MobX, actions are methods that manipulate and update the state. These methods can be&amp;nbsp;&lt;a href="https://blog.logrocket.com/how-to-dynamically-create-javascript-elements-with-event-handlers/" rel="noopener noreferrer"&gt;bound to a JavaScript event handler&lt;/a&gt;&amp;nbsp;to ensure a UI event triggers them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MobX concepts&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MobX has four principle concepts that we should learn, to understand how it works:&amp;nbsp;&lt;strong&gt;observables&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;computed values&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;reactions&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;actions&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;MobX also introduces a few concepts: state, actions, and derivations (including reactions and computed values).&lt;/li&gt;
&lt;li&gt;By wrapping the component with an observer, it will now automatically become aware of changes in the store&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>The Clean Architecture in PHP: A Short Review</title>
      <dc:creator>Ahmed sliman</dc:creator>
      <pubDate>Tue, 15 Mar 2022 16:57:31 +0000</pubDate>
      <link>https://dev.to/ahmedsliman/the-clean-architecture-in-php-1mno</link>
      <guid>https://dev.to/ahmedsliman/the-clean-architecture-in-php-1mno</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%2Fd2sofvawe08yqg.cloudfront.net%2Fcleanphp%2Fs_hero2x%3F1620403559" 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%2Fd2sofvawe08yqg.cloudfront.net%2Fcleanphp%2Fs_hero2x%3F1620403559" alt="The Clean Architecture in PHP" width="640" height="903"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I recently finished reading &lt;em&gt;The Clean Architecture in PHP&lt;/em&gt;, and it was an enjoyable and practical journey through SOLID principles, design patterns, and Clean Architecture.&lt;/p&gt;

&lt;p&gt;The book does a great job of introducing the theory behind these concepts before applying them to a growing PHP project. Instead of presenting architecture as a collection of abstract ideas, it demonstrates how an application can evolve while keeping its business logic maintainable and independent from external concerns.&lt;/p&gt;

&lt;p&gt;One of the most interesting parts is the gradual transition between frameworks. The project moves from Zend to Laravel and then Symfony, showing how a well-decoupled application can adapt to different technologies without requiring major changes to its core business logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I liked about the book
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It explains SOLID principles and common design patterns in a practical way.&lt;/li&gt;
&lt;li&gt;It introduces the theory briefly before applying it to a real project.&lt;/li&gt;
&lt;li&gt;The project grows throughout the book, making the architectural decisions easier to understand.&lt;/li&gt;
&lt;li&gt;It demonstrates how to isolate framework-specific code.&lt;/li&gt;
&lt;li&gt;It shows how the same application can be adapted to different PHP frameworks.&lt;/li&gt;
&lt;li&gt;It focuses on practical decoupling rather than architecture for its own sake.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some topics were covered rather briefly, so I occasionally used additional resources to explore them in more detail. However, this did not take away from the overall learning experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical lessons I took from the book
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Keep business logic independent of frameworks whenever possible.&lt;/li&gt;
&lt;li&gt;Depend on abstractions rather than concrete implementations.&lt;/li&gt;
&lt;li&gt;Use dependency injection to make code easier to test and replace.&lt;/li&gt;
&lt;li&gt;Avoid putting too much responsibility into controllers or service classes.&lt;/li&gt;
&lt;li&gt;Introduce design patterns to solve real problems—not simply to make the code look sophisticated.&lt;/li&gt;
&lt;li&gt;Treat architecture as something that evolves as a project grows.&lt;/li&gt;
&lt;li&gt;Isolate framework-specific code at the boundaries of the application.&lt;/li&gt;
&lt;li&gt;Write tests for business rules independently of the database and web framework.&lt;/li&gt;
&lt;li&gt;Prefer small, focused classes over large classes with many responsibilities.&lt;/li&gt;
&lt;li&gt;Refactor continuously instead of waiting until the codebase becomes difficult to maintain.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Overall, this book provides a practical introduction to Clean Architecture in PHP. Its biggest strength is the combination of theory and application: concepts are introduced and then demonstrated through a project that becomes more advanced over time.&lt;/p&gt;

&lt;p&gt;I would recommend it to developers who already understand the basics of object-oriented programming and want to improve the structure, flexibility, and maintainability of their applications. It is also a useful resource for anyone who wants to understand why decoupling matters and how to apply it in a real-world project.&lt;/p&gt;

&lt;p&gt;This is a short review because the book felt less like a collection of isolated lessons and more like an enjoyable journey through better software design.&lt;/p&gt;

</description>
      <category>php</category>
      <category>solid</category>
      <category>designpatterns</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
