<?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 Kadiri Talitu (Coded Salis) on Medium]]></title>
        <description><![CDATA[Stories by Kadiri Talitu (Coded Salis) on Medium]]></description>
        <link>https://medium.com/@codedsalis?source=rss-f06085028092------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3lH7kenAhhN9nR6VriiHhQ.png</url>
            <title>Stories by Kadiri Talitu (Coded Salis) on Medium</title>
            <link>https://medium.com/@codedsalis?source=rss-f06085028092------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:04:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@codedsalis/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[How to Set up a different Database For Testing your Laravel Application]]></title>
            <link>https://codedsalis.medium.com/how-to-set-up-a-different-database-for-testing-your-laravel-application-932696e13c6c?source=rss-f06085028092------2</link>
            <guid isPermaLink="false">https://medium.com/p/932696e13c6c</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[sqlite]]></category>
            <dc:creator><![CDATA[Kadiri Talitu (Coded Salis)]]></dc:creator>
            <pubDate>Sat, 18 Feb 2023 17:07:19 GMT</pubDate>
            <atom:updated>2023-02-18T20:29:29.299Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*VkCqnF5BVLlG2XWAaPoTkA.jpeg" /><figcaption>(Photo by <a href="https://unsplash.com/@clemhlrdt?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Clément Hélardot</a> on <a href="https://unsplash.com/photos/95YRwf6CNw8?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>)</figcaption></figure><p>As developers, we often need to test our applications to ensure that they are functioning properly and free of bugs. However, it is a good practice to set aside a database environment dedicated to testing the application.</p><p>Some might be wondering, “why would one need a different database for testing”? Well, the default behaviour of tests in Laravel ensures that your database is “Refreshed” each time you perform a test. This means that the data in database is wiped off each time you run a php artisan test command. But this can be frustrating even while in a development environment because there are some times you would need some data retained in the development database; maybe for also doing manual test or getting a personal feel of what you are building, or whatever the case may be. To stop this behaviour, we have to set up a database dedicated to testing the application.</p><p>In this article, I will guide you through the step-by-step process, so you can test your code without affecting your development or production data.</p><h3><strong>Prerequisites</strong></h3><p>This article assumes that you already have a Laravel application installed and performed your migrations and that the testing is working fine.</p><p>Also, we are going to be using sqlite database for the purpose of this tutorial</p><h3><strong>Create a .env.testing file</strong></h3><p>First of all, create a .env.testing file in the root directory and copy the contents of your .env file into it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*qmgZeF2kIwxEzL53HcjZiA.png" /><figcaption>.env.testing file</figcaption></figure><h3>Modify the Database configuration</h3><p>Next, modify your DB_CONNECTION variable to use sqlite driver for connections and set the DB_DATABASE to any name you like and append .sqlite to the end. Example in the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*hP3A6S4gsWUSzLLzLeEuRg.png" /><figcaption>modified .env.testing file</figcaption></figure><p>Leave the DB_PORT as is, it doesn’t really matter</p><h3>Run Migrations for the testing database</h3><p>Next, let’s run our database migrations for the new testing database we created. Running your migrations for testing is quite different from the normal way we know. If you run your migrations using the php artisan migrate command, your migrations will be run using your .env settings which is not what we want.</p><p>Use the command php artisan migrate --env=testing to run your migrations. This will make sure that your tables will be migrated to the sqlite database we created specifically for testing.</p><p>To test that it worked, run your tests again and your development/production database will still be intact.</p><p>If you made it to this point, thank you for your time, and I hope you found it helpful. If you have any suggestions or questions kindly use the comments. Peace!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=932696e13c6c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fix Laravel storage:link issue when symlink is disabled on a Shared hosting]]></title>
            <link>https://codedsalis.medium.com/fix-laravel-storage-link-issue-when-symlink-is-disabled-on-a-shared-hosting-40091755d?source=rss-f06085028092------2</link>
            <guid isPermaLink="false">https://medium.com/p/40091755d</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[file-upload]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[shared-host]]></category>
            <dc:creator><![CDATA[Kadiri Talitu (Coded Salis)]]></dc:creator>
            <pubDate>Thu, 09 Feb 2023 11:10:58 GMT</pubDate>
            <atom:updated>2023-02-09T11:37:19.410Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="laravel logo" src="https://cdn-images-1.medium.com/max/1024/1*fqCMzQ4UTaALLf1B5kHdtA.png" /></figure><p>The Laravel framework is arguably one of the best backend framework out there, if not the best. But as we all know, it is not suitable to be hosted on a shared hosting account like most traditional PHP frameworks because of the advanced and premium features it supports. As a developer one has to learn to improvise and hack his way around to make things work as desired.</p><p>When working with Laravel, there are times you will be faced with the trouble of having to host it on a shared hosting account due to budget reasons, or maybe its just a side project you’re experimenting with.</p><p>Most hosting providers do not allow their shared hosting users access to symbolic links a.k.a symlink for security reasons, and that is a big issue when you try hosting your Laravel projects with them. This is because Laravel uses symlink function to link images from the Storage directory to the public directory in order for the files to be accessible by the public.</p><p>When you try to use the symlink functionality you will be greeted with an error message telling you that such function does not exist. When you try contacting the hosting providers they’ll tell you that it was deliberately disabled for security reasons.</p><p>Well, you don’t have to panic, what you should do is to change the upload location from the storage to the public directory so that you won’t have to link the files again, and here is how you should go about that:</p><figure><img alt="Default config for config/filesystems.php file" src="https://cdn-images-1.medium.com/max/1024/1*_I1so3b7ORu27htzyznL5g.png" /><figcaption>Default config for config/filesystems.php</figcaption></figure><p>In your Laravel project, open the config/filesystems.php file and make the following changes</p><pre>&#39;local&#39; =&gt; [<br>  &#39;driver&#39; =&gt; &#39;local&#39;,<br>  &#39;root&#39; =&gt; public_path(&#39;/&#39;),<br>  &#39;throw&#39; =&gt; false,<br> ],<br>&#39;public&#39; =&gt; [<br>   &#39;driver&#39; =&gt; &#39;local&#39;,<br>   &#39;root&#39; =&gt; public_path(&#39;/&#39;),<br>   &#39;url&#39; =&gt; env(&#39;APP_URL&#39;).&#39;/storage&#39;,<br>   &#39;visibility&#39; =&gt; &#39;public&#39;,<br>   &#39;throw&#39; =&gt; false,<br> ],</pre><p>As you can see, all you need to do is change storage_path(&#39;app&#39;) to public_path(&#39;/&#39;) which means our uploads will be saved to the public directory. If you wish you can change that / to whatever sub-directory you want them saved to. eg: /images or /videos</p><p>You can put whatever you like as the path inside the public_path() method call, just configure it to suite your code, upload your files and check the public directory, and you’ll find them there.</p><p>That is all, if you have any questions kindly drop it in the comments section</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40091755d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding React’s useEffect hook dependency]]></title>
            <link>https://codedsalis.medium.com/understanding-reacts-useeffect-hook-dependency-a175a98ffc13?source=rss-f06085028092------2</link>
            <guid isPermaLink="false">https://medium.com/p/a175a98ffc13</guid>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[useeffect-hook]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Kadiri Talitu (Coded Salis)]]></dc:creator>
            <pubDate>Sat, 28 Jan 2023 12:02:13 GMT</pubDate>
            <atom:updated>2023-01-28T12:03:44.347Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understanding React useEffect hook’s Dependency</h3><figure><img alt="React useEffect hook" src="https://cdn-images-1.medium.com/max/1024/1*MsfwiiMgNRdnUgF--n7lAw.jpeg" /></figure><p>The useEffect hook in react can be quite confusing especially when you’re still new to the library trying to understand the bits that holds it together.</p><p>According to the React documentation, useEffect is a React Hook that lets you <a href="https://beta.reactjs.org/learn/synchronizing-with-effects">synchronize a component with an external system</a> and it’s syntax is:</p><pre>useEffect(setup, dependencies?)</pre><p>setup is a callback function where you define your logic and dependencies? is an optional array of variables you can pass to the effect that determines how often the code in the setup callback function will be executed.</p><p>Here are some behaviours of the useEffect hook given the different scenarios</p><ol><li><strong>Empty dependencies array</strong></li></ol><pre>useEffect(() =&gt; {<br>  //<br>}, [])</pre><p>Leaving the dependency arrays empty as shown in the example above will make sure that the code in the setup callback function will be executed <strong>only once, </strong>that is,<strong> when the component is mounted.</strong></p><p><strong>2. No dependencies array passed</strong></p><pre>useEffect(() =&gt; {<br>  //<br>})</pre><p>When you do not pass any dependency array to the useEffect hook as in the example above, the code in the setup callback function will be executed every time the component renders or after every re-render</p><p><strong>3. Passing a variable name to the dependency</strong></p><pre>useEffect(() =&gt; {<br>  //<br>}, [var1, var2]);</pre><p>Passing a variable name or list of variable names eg: var1, var2, etc inside the array means that the code in the setup callback function will be executed every time the state of that variable changes. For example, in the code below, the code in the setup callback function will be executed each time the counter is incremented</p><pre><br>import React, { useEffect, useState } from &#39;react&#39;<br><br>export function App() {<br>  const [counter, setCounter] = useState(0)<br><br>  useEffect(() =&gt; {<br>    console.log(&#39;effect code executed&#39;)<br>  }, [counter])<br><br>  return (<br>    &lt;div&gt;<br>      &lt;p&gt;Counter: { counter }&lt;/p&gt;<br>      &lt;button onClick={()=&gt; setCounter(counter+1)}&gt;<br>        Increment me!<br>      &lt;/button&gt;<br>    &lt;/div&gt;<br>  )<br>}</pre><p>Thank you for taking the time to read through it. I hope you enjoyed learning as much as I enjoyed preparing it and if you have any thoughts or comments, please feel free to share them in the comments section.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a175a98ffc13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Who is a full stack developer?]]></title>
            <link>https://codedsalis.medium.com/as-a-newcomer-to-the-field-of-web-development-you-may-have-come-across-the-term-full-stack-820c1dff2942?source=rss-f06085028092------2</link>
            <guid isPermaLink="false">https://medium.com/p/820c1dff2942</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Kadiri Talitu (Coded Salis)]]></dc:creator>
            <pubDate>Wed, 25 Jan 2023 23:07:08 GMT</pubDate>
            <atom:updated>2023-01-25T23:10:36.674Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*J9SsFVopsAfJZQfS2po_rw.jpeg" /></figure><p>As a newcomer to the field of web development, you may have come across the term &quot;full stack developer&quot; or perhaps you are just interested in technology. A full stack developer is a web developer who is proficient in both front-end and back-end development. This means they have the ability to design and create the user interface as well as handle the underlying functionality of a website. Generally, web development roles are separated between front-end developers who focus on user experience and design, and back-end developers who handle server-side logic and database management. However, a full stack developer has the skills and knowledge to handle both these aspects.</p><p>To become a full stack developer, one must have a good understanding of both front-end and back-end technologies. On the front-end side, this typically includes languages such as JavaScript, HTML, and CSS, as well as frameworks and tools like React, Angular, and Vue.js. It’s also important to understand how to use webpack and other tools to optimize and bundle your code for different browsers and devices. On the back-end side, a full stack developer should be familiar with languages like PHP, Python, or Ruby, as well as frameworks like Laravel, Django, or Ruby on Rails. They should also have a solid understanding of databases and SQL, and be familiar with various DevOps tools and practices.</p><p>It’s a challenging but rewarding field, and one that allows for a great deal of versatility and creativity in web development. With the constant evolution of technology, the demand for full stack developers is continually on the rise, and it’s an excellent opportunity to pursue a career in the web development industry.</p><p>I hope the explanation provided gives you a better understanding of what a full stack developer is and the skills required to become one. However, it’s important to note that there is a lot more to learn and discover in this field. The idea of this article was to introduce you to the concept and give you a general idea of what it entails. If you have any further questions or would like to add to the discussion, please feel free to reach out and share your thoughts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=820c1dff2942" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>