<?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 Wanjaswilly on Medium]]></title>
        <description><![CDATA[Stories by Wanjaswilly on Medium]]></description>
        <link>https://medium.com/@wanjaswilly?source=rss-b585ee7f29ea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tRF6KLrImLWIXvqA</url>
            <title>Stories by Wanjaswilly on Medium</title>
            <link>https://medium.com/@wanjaswilly?source=rss-b585ee7f29ea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 17:48:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wanjaswilly/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[Think Before You Leap: A Smart Approach to Starting with Laravel]]></title>
            <link>https://medium.com/@wanjaswilly/think-before-you-leap-a-smart-approach-to-starting-with-laravel-1c780276a6d3?source=rss-b585ee7f29ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c780276a6d3</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[laravel-framework]]></category>
            <category><![CDATA[hello-world]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Wanjaswilly]]></dc:creator>
            <pubDate>Fri, 03 Jan 2025 13:48:42 GMT</pubDate>
            <atom:updated>2025-01-03T13:48:42.664Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Think Before You Leap:</strong></h3><h3><strong>A Smart Approach to Starting with Laravel</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g5ff58lNVc6EwbaZXGIJTw.png" /></figure><p>Some history …</p><p>I come from a small rural village near the slopes of Aberdare Ranges. Growing up there, getting to university was the goal. Fast forward several years, I am in the university, pursuing Applied Computer Science and I am fascinated that I can create a webpage and show it off to friends and family(and be named a geek😉). All this courtesy of the Indian Youtuber😂😂</p><p>All was good for a few years after graduating, I was creating simple single-page or multipage websites and web apps until I collaborated with industry-grade professionals. They handed me a book and industry-standards documentation links to go and learn again from scratch. That hit me hard(Sorry school curriculum but you are below par in comparison with industry standard).</p><p>Enough of history, back to class …</p><p>I was comfortable being a web developer. With PHP taking the lead in backend programming languages, I made my choice to make it my friend. Now when comes to programming, there&#39;s no need to reinvent the wheel, especially when the wheel is industry-grade. After a thorough search online, I settled on Laravel Framework as my wheel.</p><p>I started learning the framework, of course with the help of that Indian friend from YouTube 😂 and several articles from the web. After 3 to 4 months I started to notice I was off track with my goal. My code was far from those scripts I saw from GitHub repos.</p><p>Finding the path …</p><p>I spent the evenings and weekends for the next couple of months learning the art of writing better code in Laravel. Some words like KISS, DRY, SOLID, YAGNI, SoC, APO, and more get new meanings(I promise you I can give you a SOLID DRY KISS right now😂🤭). Eight months later, I found myself inferring from the documentation more than the articles on the web and that Indian Youtuber was no longer my friend(sorry old buddy).</p><p>Along the journey, I learned several important lessons.</p><p><strong>Learn the Laravel ecosystem first</strong></p><p>Get a well-written book about Laravel and read it like a novel. This will open your mind to many concepts that you will need to dive deeper into as you actually start to learn the framework. Think of this as reading a map before starting a journey. This will prepare you for the learning process so that you don&#39;t miss some areas along the way.</p><p><strong>Learn the Core Concepts of Laravel</strong></p><p>After getting the whole map of the journey, start learning every concept of Laravel. For every concept, make sure you create five distinct use cases. This will make sure you have a grasp of the concept at hand. <br>Making a use case for each concept will also make you adhere to the Single Responsibility principle, which is a part of the SOLID principle. The SOLID principle stands for five principles which are Single responsibility, Open-closed, Liskov substitution, Interface Segregation, and Dependency inversion.</p><p><strong>Adhere to the MVC structure</strong></p><p>After learning each concept, it&#39;s time to put everything together to create a working app.</p><p>Make sure to:</p><ul><li>Use <strong>Models</strong> for simple business logic.</li><li>Use <strong>Service Classes</strong> for Complex Logic.</li><li>For bigger projects, use<strong> Repository Patterns</strong> to make it easier to switch between data sources without affecting other layers.</li><li>Keep controllers thin by delegating heavy lifting to S<strong>ervices</strong>.</li><li>Utilize <strong>View Composers</strong> to prepare data for specific views, to make controllers even thinner.</li><li>Avoid putting logic in V<strong>iews</strong>; reserve them for displaying data</li><li>Use<strong> Form Requests </strong>for validating data. This moves request validation logic from controllers to dedicated classes.</li><li>Make use of <strong>Policies </strong>and <strong>Gates </strong>for <strong>Authorization</strong>.</li></ul><p><strong>Follow the SOLID principle while leveraging dependency injection</strong></p><ul><li><strong>Single Responsibility Principle (SRP)</strong>: A class should have only one reason to change. Ensure each class has a single, well-defined responsibility.</li><li><strong>Open/Closed Principle (OCP)</strong>: Classes should be open for extension but closed for modification. Extend functionality without altering existing code.</li><li><strong>Liskov Substitution Principle (LSP)</strong>: Ensure derived classes or implementations can replace base classes or interfaces without breaking the application.</li><li><strong>Interface Segregation Principle (ISP)</strong>: A class should not be forced to implement interfaces it does not use. Create small, specific interfaces instead of large, generalized ones.</li><li><strong>Dependency Inversion Principle (DIP): </strong>High-level modules should not depend on low-level modules. Both should depend on abstractions. Depend on interfaces (abstractions) rather than concrete classes.</li></ul><p><strong>Learn to Optimize for Scalability and Performance</strong></p><p>With Laravel supporting horizontal and vertical scaling, be ready to utilize <strong>Queues</strong> and <strong>Event Broadcasting </strong>for asynchronous processing for tasks like email notifications, job processing, and broadcasting updates. Also, design your database structure well with growth in mind.</p><p><strong>Embrace the Testing Culture</strong></p><p>Testing takes around 25% – 40% of the whole development time but saves you from lots of production time bugs. Write your code with testing in mind. Learn testing with <strong>PHP</strong>’s <strong>PHPUnit </strong>and <strong>PEST</strong>. Do unit tests first then feature tests while trying to emulate user actions.</p><p><strong>Take Security Seriously</strong></p><ul><li>Always validate and sanitize user input to prevent vulnerabilities like SQL injection and cross-site scripting (XSS).</li><li>Store sensitive information, such as API keys and database credentials, securely in .env files and ensure they are not exposed.</li><li>Regularly update Laravel and its dependencies to patch known vulnerabilities.</li><li>Utilize Laravel’s built-in authentication features, enforce strong password policies, and consider multi-factor authentication (MFA) for added security.</li></ul><p><strong>Utilize Tools for Deployment</strong></p><p>Use tools like Laravel Forge, Envoyer, or CI/CD pipelines to automate deployment processes, reducing manual errors and saving time. Always store sensitive configurations, such as API keys and database credentials, in .env files and ensure these files are excluded from version control to prevent unauthorized access.</p><p><strong>Be updated, Always</strong></p><p>Unlike many fields, programming is always evolving, and so does Laravel. Keep yourself updated by reading weekly updates on the framework to know the upcoming features and the ones that are going to be deprecated. Keep updating your apps to the newer versions, mostly for security reasons and ease of maintenance.</p><p>Now this village dev is ready to go back to the dark VSCode and type some more. I hope you learned a thing or two, and if you did, don&#39;t forget to like, comment, and subscribe.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c780276a6d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>