<?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 Ozioma Dike on Medium]]></title>
        <description><![CDATA[Stories by Ozioma Dike on Medium]]></description>
        <link>https://medium.com/@officialozioma?source=rss-6fd1ce4118ba------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*0649NiVJT_5kmTdW0VoFTA.png</url>
            <title>Stories by Ozioma Dike on Medium</title>
            <link>https://medium.com/@officialozioma?source=rss-6fd1ce4118ba------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:31:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@officialozioma/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 Story Behind Ziomasoft Technologies Limited: Bridging Code and Business]]></title>
            <link>https://medium.com/@officialozioma/the-story-behind-ziomasoft-technologies-limited-bridging-code-and-business-62a4930b42d2?source=rss-6fd1ce4118ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/62a4930b42d2</guid>
            <category><![CDATA[custom-software]]></category>
            <category><![CDATA[saas-application]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ziomasoft]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Ozioma Dike]]></dc:creator>
            <pubDate>Tue, 13 Oct 2026 07:01:05 GMT</pubDate>
            <atom:updated>2026-10-13T07:01:05.152Z</atom:updated>
            <content:encoded><![CDATA[<h3>Bridging the Gap Between Software Engineering and Daily Business Operations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yv96SkiqWIWC3OyUpRZuXA.jpeg" /></figure><h3>Bridging the Gap Between Software Engineering and Daily Business Operations</h3><p>Over the last five years, my career has been rooted in backend software engineering. I spent time working both as a full-time lead developer and as an independent contractor, building everything from internal company tools to high-traffic e-commerce platforms.</p><p>During that time, I noticed a recurring issue across almost every industry. There was a massive disconnect between how software developers build applications and how non-technical teams actually run their businesses.</p><p>Typically, an agency would write the code, tick off the technical requirements on a contract, and hand over the software. But a few months later, the business owners would be left frustrated. They were stuck managing slow database queries, rigid user interfaces, and expensive monthly server costs for platforms that did not fit their actual workflow.</p><p>I saw a gap for a technical partner who approached software from a practical business perspective. I wanted to build an engineering studio focused on speed, reliable cloud architecture, and long-term maintainability. That is why I started Ziomasoft Technologies Limited.</p><h3>From Freelance Engineering to Corporate Registration</h3><p>Ziomasoft did not launch overnight. The foundation started in 2024 when I began taking on independent client projects. My goal was simple: audit the client’s operational bottlenecks before writing any code. We built custom databases and APIs using Node.js, Laravel, MySQL, and PostgreSQL, ensuring the final product actually made the client’s daily work easier.</p><p>As demand grew for larger SaaS builds and complex cloud migrations, we needed to formalize the business. In July 2025, we officially registered ZIOMASOFT TECHNOLOGIES LIMITED with the Corporate Affairs Commission (CAC) in Nigeria.</p><p>Taking this step allowed us to scale our core team and gave enterprise clients the confidence they needed to hand over their mission-critical infrastructure to us.</p><h3>Our Milestones and Current Footprint</h3><p>Since we started taking on projects in 2024, our focus on disciplined, fast execution has paid off. We track our success by system uptime, software speed, and direct client impact.</p><p>To date, our engineering team has reached several key milestones:</p><ul><li><strong>20+ Completed Projects:</strong> Ranging from custom web APIs to full AWS and Google Cloud migrations.</li><li><strong>10+ Business Clients:</strong> Partnering with startups and growing enterprises across different sectors.</li><li><strong>8+ Core Team Members:</strong> We expanded our talent pool to include backend engineers, DevOps specialists, and frontend developers.</li><li><strong>2-Week Delivery Cycles:</strong> We push functional software updates to our clients every 14 days without shutting down their live systems.</li></ul><p>We also built and launched our own proprietary software products to solve common business problems:</p><ul><li><strong>SmartCRM Pro:</strong> A custom customer relationship platform for tracking sales pipelines.</li><li><strong>ShopHub Commerce:</strong> A complete e-commerce system for inventory and payment management.</li><li><strong>TeamFlow Engine &amp; HRConnect Cloud:</strong> Internal tools built to manage remote workforce collaboration and human resources.</li><li><strong>SecureEscrow Protocol:</strong> A digital transaction framework designed to protect buyers and sellers online.</li><li><strong>Enterprise AI Chat Assistant:</strong> A conversational tool that handles 24/7 customer support queries automatically.</li></ul><h3>Where Ziomasoft is Heading Next</h3><p>While I am proud of the portfolio we have built, the software industry is moving fast, and we are adjusting our engineering roadmap to match it.</p><p>Our current research and development focus is on <strong>agentic AI workflows</strong>. We are moving past basic chatbots and building autonomous digital systems that can handle real business logic — like sorting data, qualifying sales leads, and reordering inventory directly through backend APIs.</p><p>We are also refining our cloud infrastructure blueprints. As our clients expand, we use containerization tools like Docker and Kubernetes to make sure their applications can handle thousands of simultaneous users without slowing down.</p><p>Finally, as we grow our headquarters in Port Harcourt, we remain committed to mentoring the next wave of technical talent. We want to prove that world-class, enterprise-grade software is being built right here.</p><p>Technology should make running your business easier, not harder. That principle guided my first freelance project, and it will continue to guide every system we build at Ziomasoft.</p><h3>Contact Information</h3><ul><li><strong>Website:</strong> <a href="https://www.ziomasoft.com/">https://www.ziomasoft.com</a></li><li><strong>Direct Email:</strong> hello@ziomasoft.com</li><li><strong>Phone Number:</strong> +234 911 317 2893</li><li><strong>RC: </strong>RC — 8634631</li><li><strong>Headquarters:</strong> Mechanic Bus Stop, Ogbogoro, Port Harcourt, Rivers State, Nigeria</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62a4930b42d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Laravel Pipeline]]></title>
            <link>https://medium.com/@officialozioma/introduction-to-laravel-pipeline-4fb5abedec0e?source=rss-6fd1ce4118ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fb5abedec0e</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[technical-analysis]]></category>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[laravel-framework]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Ozioma Dike]]></dc:creator>
            <pubDate>Mon, 03 Apr 2023 12:59:03 GMT</pubDate>
            <atom:updated>2023-04-03T12:59:03.295Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kI8wZHz5n_04ZQDD" /></figure><h4>Understanding Laravel Pipeline</h4><h3>Introduction</h3><p><a href="https://laravel.com/docs/10.x/helpers#pipeline">Laravel pipelines</a> are a powerful feature that allows you to build complex workflows by breaking down operations into smaller, reusable stages. Using Laravel pipelines you can pass an object between several classes in a fluid way to perform any type of task and finally return the resulting value once all the “tasks” have been executed. In this article, we are going learn how to use Laravel Pipeline to build APIs.</p><h3>Prerequisites</h3><ul><li>Knowledge of OOP in PHP.</li><li>Basic understanding of the Laravel framework.</li><li>Basic understanding of controllers, their purpose, and creating them in Laravel.</li><li>Familiarity with HTTP methods</li></ul><p>If you match these criteria, it’s time to start with Laravel Pipeline.</p><h4>Laravel pipeline design pattern</h4><p>The Pipeline design pattern is where a complex system is broken into smaller and individual tasks. Each task is completely reusable. This allows us to break up monolithic processes into smaller tasks that process data and then pass that data to the next step. This pattern is especially useful for processing large data sets, where you must perform multiple operations on the data before returning the final result.</p><h4>Using Laravel Pipeline to build a simple API</h4><p>we’ll build a simple API in Laravel using the pipeline pattern, this API is going fetch all the blog posts in the database, and we are going to filter the posts and return the results. I assume you have installed and set up your Laravel project, including the database details in the .env file.</p><h3>Create the Post model and migration</h3><p>Let’s start by creating the post model and migration, Laravel provides us a quicker way to do this by running the following command on the terminal.</p><pre>php artisan make:model Post -m</pre><p>This above command will create a new file inside the app/Models folder called Post.php and inside the database/migration folder called 2023_03_30_153402_create_posts_table.php. <em>Note yours will be slightly different depending on the date and time you run the above command</em>.</p><h3>Edit the migration file for the post model</h3><p>Now we are going to edit the migration file for the post model we created above, the migration file will contain fields such as isPublished that will be a boolean value and published_date which will be used to store the date the post was published. Also, I added a relation with the user table, to associate each post with a user. We will use this later to filter the post using the Laravel pipeline</p><pre>&lt;?php<br><br>use Illuminate\Database\Migrations\Migration;<br>use Illuminate\Database\Schema\Blueprint;<br>use Illuminate\Support\Facades\Schema;<br><br>return new class extends Migration<br>{<br>    /**<br>     * Run the migrations.<br>     */<br>    public function up(): void<br>    {<br>        Schema::create(&#39;posts&#39;, function (Blueprint $table) {<br>            $table-&gt;id();<br>            $table-&gt;unsignedBigInteger(&#39;user_id&#39;);<br>            $table-&gt;string(&#39;title&#39;);<br>            $table-&gt;text(&#39;post&#39;);<br>            $table-&gt;boolean(&#39;isPublished&#39;);<br>            $table-&gt;date(&#39;published_date&#39;);<br>            $table-&gt;timestamps();<br><br><br>            $table-&gt;foreign(&#39;user_id&#39;)<br>                -&gt;references(&#39;id&#39;)-&gt;on(&#39;users&#39;)<br>                -&gt;onDelete(&#39;cascade&#39;);<br>        });<br>    }<br><br>    /**<br>     * Reverse the migrations.<br>     */<br>    public function down(): void<br>    {<br>        Schema::dropIfExists(&#39;posts&#39;);<br>    }<br>};</pre><h3>Run the migration</h3><p>after editing the migrating file for the post model we are going to run the migration, type the following code on your terminal.</p><blockquote>Note: Don’t forget to set up your database details on the .env file</blockquote><pre>php artisan migrate</pre><h3>Add a relationship to the user model and post model</h3><p>Now we are going add some relationship to our user model and post model, this is to make sure that a post is associated with a user, in other words, each user will have as many posts as possible, for better understanding you can read more about <a href="https://laravel.com/docs/10.x/eloquent-relationships">Laravel relationship here</a>, below is our models.</p><pre>&lt;?php<br><br>namespace App\Models;<br><br>// use Illuminate\Contracts\Auth\MustVerifyEmail;<br>use Illuminate\Database\Eloquent\Factories\HasFactory;<br>use Illuminate\Foundation\Auth\User as Authenticatable;<br>use Illuminate\Notifications\Notifiable;<br>use Laravel\Sanctum\HasApiTokens;<br><br>class User extends Authenticatable<br>{<br>    use HasApiTokens, HasFactory, Notifiable;<br><br>    protected $fillable = [<br>        &#39;name&#39;,<br>        &#39;email&#39;,<br>        &#39;password&#39;,<br>    ];<br><br>    protected $hidden = [<br>        &#39;password&#39;,<br>        &#39;remember_token&#39;,<br>    ];<br><br>    protected $casts = [<br>        &#39;email_verified_at&#39; =&gt; &#39;datetime&#39;,<br>    ];<br><br><br>    public function posts()<br>    {<br>        return $this-&gt;hasMany(Post::class);<br>    }<br>}</pre><p>I added$this-&gt;hasMany(Post::class); to the User model</p><pre>&lt;?php<br><br>namespace App\Models;<br><br>use Illuminate\Database\Eloquent\Factories\HasFactory;<br>use Illuminate\Database\Eloquent\Model;<br><br>class Post extends Model<br>{<br>    use HasFactory;<br><br>    protected $guarded = [];<br><br><br>    public function user()<br>    {<br>        return $this-&gt;belongsTo(User::class);<br>    }<br>}</pre><p>I added the $this-&gt;belongsTo(User::class); to the Post model</p><h3>Create a post factory</h3><p>Next, we need to create a post factory to populate the database with posts random posts. Type the following on the terminal to create a new PostFactory file.</p><pre>php artisan make:factory PostFactory</pre><p>Open the PostFactory file and edit, add the following to the PostFactory file.</p><pre>&lt;?php<br><br>namespace Database\Factories;<br><br>use Carbon\Carbon;<br>use App\Models\User;<br>use Illuminate\Database\Eloquent\Factories\Factory;<br><br>class PostFactory extends Factory<br>{<br>  <br>    public function definition(): array<br>    {<br>        $publishStatus = rand(0, 1);<br>        $publishDate = ($publishStatus === 1) ? now() : null;<br><br>        return [<br>            &#39;user_id&#39; =&gt; User::inRandomOrder()-&gt;first()-&gt;id,<br>            &#39;title&#39; =&gt; fake()-&gt;sentence(),<br>            &#39;post&#39; =&gt; fake()-&gt;text(500),<br>            &#39;isPublished&#39; =&gt; $publishStatus,<br>            &#39;published_date&#39; =&gt; $publishDate,<br>        ];<br>    }<br>}</pre><p>Now we need to get data into your database. Let’s fire up Tinker, by typing the following on the terminal</p><pre>php artisan tinker</pre><p>This will now place us in a tinker session. Now type the following in \App\Models\User::factory()-&gt;times(500)-&gt;create(); the terminal, then press ENTER. This will generate 500 user records in your database, also type the following \App\Models\Post::factory()-&gt;times(1000)-&gt;create(); and press ENTER. This will generate 1000 random posts in your database.</p><h3>Create a controller for the Post model</h3><p>Next, we need to create a controller for the Post model to do this we run the following artisan command on the terminal.</p><pre>php artisan make:controller PostSearchController -i</pre><p>The command above will create PostSearchController class we can use to bootstrap the Laravel pipeline. The PostSearchController class will look like this below.</p><pre>&lt;?php<br><br>namespace App\Http\Controllers;<br><br>use App\Models\Post;<br>use Illuminate\Http\Request;<br>use Illuminate\Support\Facades\Pipeline;<br><br>class PostSearchController extends Controller<br>{<br>    /**<br>     * Handle the incoming request.<br>     */<br>    public function __invoke(Request $request)<br>    {<br>        $pipelines = [];<br><br>        return Pipeline::send(Post::query())<br>            -&gt;through($pipelines)<br>            -&gt;thenReturn()<br>            -&gt;paginate();<br>    }<br>}</pre><h3>Create a route for the API</h3><p>we are going to create a route for the API, to do this we edit the route/api.php we add the route below inside the route/api.</p><pre>Route::get(&#39;posts/search&#39;,\App\Http\Controllers\PostSearchController::class);</pre><p>Right now the code in the controller would return the same as if we did this.</p><pre>User::paginate()</pre><p>Before we start adding stages to our pipeline let’s visit our endpoint in the browser.</p><pre>http://127.0.0.1:8000/api/posts/search</pre><p>On the browser, this will return all randomly created dummy posts on the database with their paginations</p><h3>Create the filter class.</h3><p>To start implementing the Laravel pipeline lets we need to have a filter class this will help us see the pipeline in action. Our filter classes will be in app/Filters folder, now we&#39;ll create a class called &#39;ByTitle&#39; which will serve as our filter allowing us to <em>&quot;filter by the title of the blog.&quot;</em></p><pre>&lt;?php<br><br>namespace App\Filters;<br><br>use Closure;<br>use Illuminate\Database\Eloquent\Builder;<br>use Illuminate\Http\Request;<br><br>class ByTitle<br>{<br>    public function __construct(public Request $request){ }<br><br>    public function handle(Builder $query, Closure $next)<br>    {<br>        return $next($query)-&gt;when($this-&gt;request-&gt;has(&#39;title&#39;),<br>                  fn ($query) =&gt; $query-&gt;where(&#39;title&#39;, &#39;regexp&#39;, <br>                                 $this-&gt;request-&gt;title)-&gt;with(&#39;user&#39;)<br>            );<br>    }<br>}</pre><p>So what exactly is going on here?</p><pre>public function __construct(public Request $request){}</pre><p>We’re asking the <a href="https://laravel.com/docs/10.x/container">service container</a> to return us the current request coming into our application and assign it to a public attribute called $request which we can reference anytime by using $this-&gt;request.</p><p>Now let’s examine the handle() method.</p><pre>public function handle(Builder $query, Closure $next)<br>    {<br>        return $next($query)-&gt;when($this-&gt;request-&gt;has(&#39;title&#39;),<br>                  fn ($query) =&gt; $query-&gt;where(&#39;title&#39;, &#39;regexp&#39;, <br>                                 $this-&gt;request-&gt;title)-&gt;with(&#39;user&#39;)<br>            );<br>    }</pre><p>The first parameter, Builder $query, serves as the payload being sent into our pipeline, which in our case is the Eloquent Query Builder. The second parameter Closure $nextis what is used to send our payload, along with any modifications made to it, onto the next stage in the pipeline.</p><p>The <a href="https://laravel.com/docs/10.x/queries#conditional-clauses">when()</a> method is telling the query builder that &quot;when&quot; there is a title being provided in our request we want to apply the query fn ($query) =&gt; $query-&gt;where(&#39;title&#39;, &#39;regexp&#39;, $this-&gt;request-&gt;title)-&gt;with(&#39;user&#39;) which will search for any title that contains any character provided by the &quot;title&quot; portion of the request, and return it with the user that has the post.</p><p>We now need to add this filter to our pipeline. We’ll do this by adding the fully qualified name to the $pipelines array variable in our control.</p><pre>&lt;?php<br><br>namespace App\Http\Controllers;<br><br>use App\Models\Post;<br>use Illuminate\Http\Request;<br>use Illuminate\Support\Facades\Pipeline;<br><br>class PostSearchController extends Controller<br>{<br>    /**<br>     * Handle the incoming request.<br>     */<br>    public function __invoke(Request $request)<br>    {<br>        $pipelines = [<br>            \App\Filters\ByTitle::class,<br>        ];<br><br>        return Pipeline::send(Post::query())<br>            -&gt;through($pipelines)<br>            -&gt;thenReturn()<br>            -&gt;paginate();<br>    }<br>}</pre><p>With our pipeline being aware of our filter, let’s test this by visiting our API URL from earlier, but we’ll be sure to add the title to our query string.</p><pre>http://127.0.0.1:8000/api/posts/search?title=Doloremque</pre><p>In my example I’m telling our endpoint we want to filter by posts that contain <em>Doloremque</em> in the title. Now that we understand what’s going on we’ll create one more filters that will allow us to search by publish status.</p><pre>&lt;?php<br><br>namespace App\Filters;<br><br>use Closure;<br>use Illuminate\Database\Eloquent\Builder;<br>use Illuminate\Http\Request;<br><br>class PublishStatus<br>{<br>    public function __construct(public Request $request)<br>    {<br>    }<br><br>    public function handle(Builder $query, Closure $next)<br>    {<br>        return $next($query)-&gt;when($this-&gt;request-&gt;has(&#39;isPublished&#39;),<br>                fn ($query) =&gt; $query-&gt;where(&#39;isPublished&#39;, &#39;regexp&#39;, <br>                            $this-&gt;request-&gt;isPublished)-&gt;with(&#39;user&#39;)<br>            );<br>    }<br>}</pre><p>Let’s incorporate them into our controller.</p><pre>&lt;?php<br><br>namespace App\Http\Controllers;<br><br>use App\Models\Post;<br>use Illuminate\Http\Request;<br>use Illuminate\Support\Facades\Pipeline;<br><br>class PostSearchController extends Controller<br>{<br>    /**<br>     * Handle the incoming request.<br>     */<br>    public function __invoke(Request $request)<br>    {<br>        $pipelines = [<br>            \App\Filters\PublishStatus::class,<br>            \App\Filters\ByTitle::class,<br>        ];<br><br>        return Pipeline::send(Post::query())<br>            -&gt;through($pipelines)<br>            -&gt;thenReturn()<br>            -&gt;paginate();<br>    }<br>}</pre><p>What’s really cool now is that we can stack these filters in our request. For example, let us search for posts that contain <em>Doloremque</em> in the title and are published.</p><pre>http://127.0.0.1:8000/api/posts/search?title=Doloremque&amp;isPublished=1</pre><h3>Conclusion</h3><p>It might feel overwhelming to implement Pipelines just for two filters but it will be much clean and beneficial for a large number of filters or any other complex implementation.<br>So don’t be afraid to give pipelines a try, With their flexible and customizable architecture, you can build pipelines that are tailored to your specific needs and help you build high-quality, performant applications with ease.<br>We can clean filter classes by extracting common code in a base class. Comment below if you want refactoring of Filter classes in the next article. Happy coding</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fb5abedec0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Deploy A Laravel Project To DigitalOcean Droplet Using Github Action]]></title>
            <link>https://medium.com/@officialozioma/how-to-deploy-a-laravel-project-to-digitalocean-droplet-using-github-action-b9216abe1be2?source=rss-6fd1ce4118ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9216abe1be2</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[digitalocean]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Ozioma Dike]]></dc:creator>
            <pubDate>Sat, 04 Mar 2023 20:22:01 GMT</pubDate>
            <atom:updated>2023-03-04T20:56:40.405Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sdhm677yJ1S2fq1h" /><figcaption>Photo by <a href="https://unsplash.com/@altumcode?utm_source=medium&amp;utm_medium=referral">AltumCode</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this article, I will walk you through the step-by-step process of how you can deploy your Laravel application on the digital-ocean droplet, Before we get started below are some of the prerequisites for you to follow along in this article.</p><h3><strong>Prerequisites</strong></h3><p>To follow along in the article you should have a Laravel project already built and pushed to your GitHub repository, a basic understanding of <a href="https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions">GitHub Actions</a>, and a digital-ocean account required. You can get started with Laravel <a href="https://laravel.com/"><strong>here</strong></a>, and get started on Digital-ocean <a href="https://cloud.digitalocean.com/registrations/new"><strong>here</strong></a>. You will also need to create a droplet and set up your droplet, the following articles below can get you started.<br>1. <a href="https://docs.digitalocean.com/products/droplets/how-to/create/">Create a droplet</a><br>2. <a href="https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-22-04">Initial setup for a droplet</a><br>3. <a href="https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-22-04">Install the LEMP stack on the droplet</a></p><h3>Digital Ocean</h3><p>Digital Ocean is a unique cloud hosting provider that <strong>offers cloud computing services to business entities</strong> so that they can scale themselves by deploying DigitalOcean applications that run parallel across multiple cloud servers without compromising on performance!</p><h3>Github Action</h3><p>GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline. <br>You can create workflows that build and test every pull request to your repository or deploy merged pull requests to production. GitHub Actions goes beyond just DevOps and lets you run workflows when other events happen in your repository. <br>For example, you can run a workflow to automatically add the appropriate labels whenever someone creates a new issue in your repository. GitHub provides Linux, Windows, and macOS virtual machines to run your workflows, or you can host self-hosted runners in your own data center or cloud infrastructure.</p><h4>Overview of GitHub Action Workflow</h4><p>GitHub Action workflow consists of one or multiple jobs which contain one or multiple steps. To deploy our application, we need to create the following jobs:</p><p><strong>Create GitHub Action build artifacts for deployment<br></strong>We want to achieve the following for our Laravel application artifacts:<br>1. Install NPM dependencies.<br>2. Compile CSS and Javascript assets.<br>3. Install Composer dependencies.<br>4. Archive our build and remove unnecessary data (e.g., node_modules).<br>5. Store our archive so we can deploy it to our servers.</p><p><strong>Prepare release on all our servers<br></strong>We want the release preparation job to do the following:<br>1. Ensure we have a directory that holds every release.<br>2. Ensure we have a storage directory that shares data between releases.<br>3. Ensure we have a current directory that links to the active release.<br>4. Extract our build files into our releases directory.</p><p><strong>Run optional before hooks</strong><br>This is an optional feature, but I want to execute specific commands before the release is activated (e.g., chmod directories). So there needs to be a way to configure these so-called before hooks.</p><p><strong>Activate the release</strong><br>Now we are ready to activate our new release without any downtime. We can do this by changing symbolic links, this essentially swaps the underlying release, which is linked to our current directory, to a new release inside our releases directory. I&#39;m running PHP FPM on my servers, so I also want to reload PHP FPM to detect the changes.</p><p><strong>Run optional after hooks</strong><br>This is an optional feature as well, but I want to execute specific commands after the release is activated to send a notification that my deployment is completed for example. So there needs to be a way to configure these so-called after hooks.</p><p><strong>Cleaning up</strong><br>Given that we are uploading and extracting new releases, we take up more disk space after each release. To make sure we don’t end up with thousands of releases and a full disk, we need to limit the number of release artifacts living on every server.</p><h3>Project scaffolding</h3><p>To start you will need a GitHub repository as testing your workflow requires you to commit and push your workflow .yml file, you should have one already with your Laravel project, I recommend you create a separate branch for this, Be sure to verify that in your project everything works before you continue.<br>Lastly, from your project root directory create a new workflow file, feel free to give it any name you would like and place it in the <em>.github/workflows.</em></p><pre>name: Deploy Application<br><br>on:<br>  push:<br>    branches: [ master ]<br><br>jobs:<br>  # Magic</pre><p>Inside the github/workflows/any_name_you_like.yml file write the following, make sure you choose a different branch if you don’t want to clutter your commit history, as you might end up pushing to GitHub several times, as you follow along.</p><h3>Create deployment Artifacts</h3><p>let’s kick off by checking out our project by using the predefined <a href="https://github.com/actions/checkout">checkout action by GitHub</a>. Before we have something to deploy, we will start the build our Laravel application as we would typically do.</p><pre># // code from earlier is ommited for clearity<br><br>jobs:<br>  create-deployment-artifacts:<br>    name: Create deployment artifacts<br>    runs-on: ubuntu-latest<br><br>  steps:<br>  - uses: actions/checkout@v3</pre><p>GitHub will checkout the code from our repository in the container; no further steps are necessary. Now that we have our code, we can continue compiling our assets.</p><pre># // code from earlier is ommited for clearity<br> <br>- name: Compile CSS and Javascript<br>    run: |<br>      npm install<br>      npm run prod</pre><p><strong><em>Tip: If you use a CDN to deliver your static files, be sure to implement your own solution. The front-end assets are now shared amongst all servers individually, which is not ideal. It may impact your website speed since assets could be loaded from different servers on every request depending on your load-balancer.</em></strong></p><p>We can now continue with our back-end code. Before we can install any composer packages, we need to make sure PHP is installed first. We will use the `setup-php` action by <a href="https://github.com/shivammathur/setup-php">Shivam Mathur</a>, which makes this a breeze.</p><pre># // code from earlier is ommited for clearity<br><br>  - name: Compile CSS and Javascript<br>    run: |<br>      npm ci<br>      npm run prod<br><br>  - name: Configure PHP 8.1<br>    uses: shivammathur/setup-php@master<br>    with:<br>      php-version: 8.1<br>      extensions: mbstring, ctype, fileinfo, openssl, PDO, bcmath, json, tokenizer, xml</pre><p>This will configure PHP 8.1 and install the required extensions. If your application requires additional extensions, be sure to add them to the list. We can continue by installing our Composer dependencies.</p><pre># // code from earlier is ommited for clearity<br><br>  - name: Composer install<br>    run: |<br>    composer install --no-dev --no-interaction --prefer-dist</pre><p>Time to test out what we’ve got so far! Commit your code changes and push them to GitHub. Once you’ve done so, visit the Actions page (https://www.github.com/&lt;username&gt;/&lt;repository&gt;/actions)</p><p>You can click each job to see the execution output. If a job fails, it will show a red cross instead of a checkmark. The execution output will often provide you with the information you need to resolve the issue.</p><p>We’ve successfully compiled our front-end assets and installed our Composer dependencies. Now we need to store the results. GitHub provides an <a href="https://github.com/actions/upload-artifact">Upload-Artifact</a> helper. This will help us to share the GitHub Actions artifacts between jobs.</p><p>You can upload single files, multiple files, and directories. Since we just want all our files deployed, I prefer to create a TAR archive, so we have a single file to work with. You could also create a ZIP archive, but this will require installing additional software in the build container as Ubuntu doesn’t ship with the required libraries.</p><pre>  - name: Create deployment artifact<br>    run: tar -czf app.tar.gz *</pre><p>This will create a new tar archive called app.tar.gz containing all the files, including the additional build artifacts we&#39;ve made in the previous steps.</p><p>This works just fine, but the archive now contains files we don’t need, like the node_modules directory. We only required these to run the npm run production command. Let&#39;s fix this by excluding directories from our archive.</p><pre># //<br>- name: Create deployment artifact<br>  run: tar -czf app.tar.gz --exclude=*.git --exclude=node_modules --exclude=tests *</pre><p>Our archive will now skip the .git, node_modules, and tests directories from our archive. If you have additional files that are not required to be on your production server, exclude them now. By making the archive smaller, your deployment will be quicker.</p><p>I want to change our archive&#39;s filename so it&#39;s easier to identify which commit our archive contains. GitHub has some global variables you can use in your .yml file, so let&#39;s change the name to the commit hash.</p><pre># //<br>- name: Create deployment artifact<br>  env:<br>    GITHUB_SHA: ${{ github.sha }}<br>  run: tar -czf &quot;${GITHUB_SHA}&quot;.tar.gz --exclude=*.git --exclude=node_modules *</pre><p>We use the env option to pass environment variables down into the container. In this case, we define an environment variable called GITHUB_SHA and assign it the commit hash from the current job. If you want to know more about context and expression syntax for GitHub Actions, click <a href="https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions">here</a>.</p><p>We&#39;re now ready to upload our build artifacts with the <a href="https://github.com/actions/upload-artifact">Upload-Artifact</a> helper.</p><pre># //<br>- name: Create deployment artifact<br>  env:<br>    GITHUB_SHA: ${{ github.sha }}<br>  run: tar -czf &quot;${GITHUB_SHA}&quot;.tar.gz --exclude=*.git --exclude=node_modules *<br><br>- name: Store artifact for distribution<br>  uses: actions/upload-artifact@v3<br>  with:<br>    name: app-build<br>    path: ${{ github.sha }}.tar.gz</pre><p>We only need to provide this step with the path to our file. We again use the GitHub Action expression to get the commit hash. Finally, we provide our artifact with a name, which we can use for later reference to download the GitHub Actions artifacts in our deployment job.</p><p>Before we can continue with any of the follow-up jobs, we need to prepare something called a GitHub Actions strategy matrix. A strategy creates a build matrix for your jobs. You can define different variations to run each job in.</p><p>You can define a matrix of different job configurations. A matrix allows you to create multiple jobs by performing variable substitution in a single job definition.</p><p>In our case, servers are variable in our jobs. We will use a JSON file inside our repository, so we don&#39;t have to switch back and forth between the GitHub UI.</p><p>Create a new file called deployment-config.json the root of your project and add the following contents:</p><pre>[<br>  {<br>    &quot;name&quot;: &quot;server-1&quot;,<br>    &quot;ip&quot;: &quot;your_droplet_ip&quot;,<br>    &quot;username&quot;: &quot;your_droplet_username&quot;,<br>    &quot;password&quot;:&quot;your_droplet_password&quot;,<br>    &quot;beforeHooks&quot;: &quot;&quot;,<br>    &quot;afterHooks&quot;: &quot;&quot;,<br>    &quot;path&quot;: &quot;path_to_your_project&quot;<br>  }<br>]</pre><p>This file contains a list of all the servers we wish to deploy to. We can define the before and after hook, and our Nginx directory path, which will serve our application for each server. For authentication, we will use an SSH key which you can store inside a <a href="https://docs.github.com/en/actions/reference/encrypted-secrets">repository secret</a>. In this example, I will name the secret SSH_KEY and reference this secret inside our workflow to authenticate the commands we want to execute on our remote server.</p><p>You could even host this file somewhere to dynamically populate this file, so if you add more instances to your infrastructure, they will be automatically included in the deployment cycle.</p><p><em>Note: A job matrix can generate a maximum of 256 jobs per workflow run. If you want to deploy to hundreds of servers in a single workflow, you need an alternative. I would recommend going serverless with a solution like </em><a href="https://vapor.laravel.com/"><em>Laravel Vapor</em></a><em>.</em></p><p>To make this configuration available inside our GitHub Actions workflow, we need to export this data. Using a special syntax, GitHub can identify which data to assign to which variable to reference later on our workflow matrix.</p><pre># //<br>- name: Store artifact for distribution<br>  uses: actions/upload-artifact@v3<br>  with:<br>    name: app-build<br>    path: ${{ github.sha }}.tar.gz<br><br>- name: Export deployment matrix<br>  id: export-deployment-matrix<br>  run: |<br>      delimiter=&quot;$(openssl rand -hex 8)&quot;<br>      JSON=&quot;$(cat ./.github/workflows/servers.json)&quot;<br>      echo &quot;DEPLOYMENT_MATRIX&lt;&lt;${delimiter}&quot; &gt;&gt; &quot;${GITHUB_OUTPUT}&quot;<br>      echo &quot;$JSON&quot; &gt;&gt; &quot;${GITHUB_OUTPUT}&quot;<br>      echo &quot;${delimiter}&quot; &gt;&gt; &quot;${GITHUB_OUTPUT}&quot;</pre><p>First, we need to get the JSON from our deployment-config.json by using a simple cat command. Next, we will use a delimiter to support muli-line contents like our JSON file. Finally, we append our JSON to the ${GITHUB_OUTPUT} environment using DEPLOYMENT_MATRIX as our name/key.</p><p>If we want our other jobs to get the output from this job, we need to specify the output reference in our create-deployment-artifacts job.</p><pre># //<br>jobs:<br>  create-deployment-artifacts:<br>    name: Create deployment artifacts<br>    runs-on: ubuntu-latest<br>    outputs:<br>      DEPLOYMENT_MATRIX: ${{ steps.export-deployment-matrix.outputs.DEPLOYMENT_MATRIX }}<br>    steps:<br>      - uses: actions/checkout@v3<br><br># //</pre><p>We can now reference DEPLOYMENT_MATRIX other jobs and get all the required information for each of our servers.</p><h3>Prepare the release on all the servers</h3><p>Next up, we can continue to prepare our release on every server. Thanks to the deployment matrix configuration we&#39;ve created, we can cycle through each server to repeat all the steps on every server.</p><pre># //<br>prepare-release-on-servers:<br>  name: &quot;${{ matrix.server.name }}: Prepare release&quot;<br>  runs-on: ubuntu-latest<br>  needs: create-deployment-artifacts<br>  strategy:<br>    matrix:<br>      server: ${{ fromJson(needs.create-deployment-artifacts.outputs.DEPLOYMENT_MATRIX) }}</pre><p>As you can see, there are a couple of new parameters. The first new parameter, needsallows us to make sure a specific step has finished before this job can start. In our case, we want to prepare the release on the servers once the create-deployment-artifacts. If you have multiple-step dependencies, you can also pass an array.</p><p>Next, we got our strategy parameter, which allows us to define our matrix. In this case, we define a matrix variable named server and assign it to our DEPLOYMENT_MATRIX we&#39;ve created in our previous job. By default, the <a href="https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix">build matrix</a> expects an array and not a JSON string.</p><p>As mentioned earlier, GitHub Actions <a href="https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions">support context and expression syntax</a> to access context information but also to evaluate expressions. This includes a couple of <a href="https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#functions">functions</a> to, for example, cast values. To read our server configuration, we need to change our JSON string into a real JSON object using the <a href="https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#fromjson">fromJSON</a> function.</p><p>We can retrieve our JSON object through the matrix context. This enables access to the matrix parameters we&#39;ve configured for the current job. For example, in the code above, you can see we define a variable job name: name: &quot;${{ matrix.server.name }}: Prepare release&quot;. In the GitHub UI, this will resolve to &quot;server-1: Prepare release&quot;.</p><p>We are now ready to continue with the steps of our job, downloading our artifact to our build container, uploading our artifact to the server, extracting our archive, and setting up required directories on our server if they don&#39;t exist.</p><pre># //<br>prepare-release-on-servers:<br>  name: &quot;${{ matrix.server.name }}: Prepare release&quot;<br>  runs-on: ubuntu-latest<br>  needs: create-deployment-artifacts<br>  strategy:<br>    matrix:<br>      server: ${{ fromJson(needs.create-deployment-artifacts.outputs.DEPLOYMENT_MATRIX) }}<br>  steps:<br>    - uses: actions/download-artifact@v3<br>      with:<br>        name: app-build<br>    - name: Upload<br>      uses: appleboy/scp-action@master<br>      with:<br>        host: ${{ matrix.server.ip }}<br>        username: ${{ matrix.server.username }}<br>        key: ${{ secrets.SSH_KEY }}<br>        port: ${{ matrix.server.port }}<br>        source: ${{ github.sha }}.tar.gz<br>        target: ${{ matrix.server.path }}/artifacts</pre><p>We start by downloading our GitHub Actions build artifact, which is quite simple as GitHub provides a simple action out of the box called &quot;<a href="https://github.com/actions/download-artifact">Download Artifact</a>s.&quot; We reference the name we&#39;ve used for uploading our artifact. This will download the artifact into the build container.</p><p>Next, we upload the artifact to the server using a third-party <a href="https://github.com/appleboy/scp-action">SCP</a> action in the GitHub Actions marketplace. This action will copy our file via SSH based on our configuration. Make sure to check out the <a href="https://github.com/appleboy/scp-action">repository</a> for all available input variables for this action if you, for example, want to use SSH keys for authentication.</p><p>The SSH credentials are self-explanatory; we simply reference our JSON object to get the server&#39;s connection details and the credentials. The SCP action requires a source input variable; this is the file we want to upload. We use the commit hash context object again to generate the filename<br> ${{ github.sha }}.tar.gz.</p><p>Besides the source input variable, we also need to provide the target input variable. I want to keep all the uploaded artifacts in a separate directory. I reference the server path and append the path with the directory name artifacts to achieve this. The final path will be /var/www/html/artifacts.</p><p>Let&#39;s take a look and make sure everything is working so far. Commit all your changes and push them to GitHub. Visit the actions page of your repository again, and you should see a running action.</p><p>Click <strong>server-1: Prepare the release</strong> job so you can see the output of all the steps. Click on the <strong>Upload</strong> job to expand the output. Seems to be looking good so far, our GitHub Actions release artifacts are now uploaded to our remote server.</p><p>Our final step for this job is to extract our uploaded archive and create a couple of directories if they don&#39;t exist. We will use SSH commands to set this up. We will again use a third-party action in the GitHub Actions marketplace called <a href="https://github.com/appleboy/ssh-action">SSH Action</a>. By now, you will be familiar with most of the syntax. The input variables are similar to the previous upload step:</p><pre># //<br>- name: Extract archive and create directories<br>  uses: appleboy/ssh-action@master<br>  env:<br>    GITHUB_SHA: ${{ github.sha }}<br>  with:<br>    host: ${{ matrix.server.ip }}<br>    username: ${{ matrix.server.username }}<br>    key: ${{ secrets.SSH_KEY }}<br>    port: ${{ matrix.server.port }}<br>    envs: GITHUB_SHA<br>    script: |<br>      mkdir -p &quot;${{ matrix.server.path }}/releases/${GITHUB_SHA}&quot;<br>      tar xzf ${{ matrix.server.path }}/artifacts/${GITHUB_SHA}.tar.gz -C &quot;${{ matrix.server.path }}/releases/${GITHUB_SHA}&quot;<br>      rm -rf ${{ matrix.server.path }}/releases/${GITHUB_SHA}/storage<br><br>      mkdir -p ${{ matrix.server.path }}/storage/{app,public,framework,logs}<br>      mkdir -p ${{ matrix.server.path }}/storage/framework/{cache,sessions,testing,views}<br>      chmod -R 0777 ${{ matrix.server.path }}/storage</pre><p>If you use the | character in your script, you can define multiple commands split across multiple lines you want to execute on your server.</p><pre># Create a new directory with the commit hash as the directory name<br>mkdir -p &quot;${{ matrix.server.path }}/releases/${GITHUB_SHA}&quot;<br><br># Extract the tar file into our release directory<br>tar xzf ${{ matrix.server.path }}/artifacts/${GITHUB_SHA}.tar.gz -C &quot;${{ matrix.server.path }}/releases/${GITHUB_SHA}&quot;<br><br># Create Laravel storage directories and set permissions<br>mkdir -p ${{ matrix.server.path }}/storage/{app,public,framework,logs}<br>mkdir -p ${{ matrix.server.path }}/storage/framework/{cache,sessions,testing,views}<br>chmod -R 0777 ${{ matrix.server.path }}/storage</pre><p>If you want, you can SSH into one of your servers and verify that the directories exist and the archive is unarchived.</p><p>So far, so good! We&#39;ve made our build, uploaded the results to our server, extracted the archive, and made sure the required directories exist. We are almost there</p><h3>Run before hooks</h3><p>This step is optional, but it&#39;s quite useful if you want to execute specific commands before you activate your release. In this example, we are using Laravel, so you might want to run database migrations.</p><pre># //<br>run-before-hooks:<br>  name: &quot;${{ matrix.server.name }}: Before hook&quot;<br>  runs-on: ubuntu-latest<br>  needs: [ create-deployment-artifacts, prepare-release-on-servers ]<br>  strategy:<br>    matrix:<br>      server: ${{ fromJson(needs.create-deployment-artifacts.outputs.DEPLOYMENT_MATRIX) }}<br>  steps:<br>  - name: Run before hooks<br>    uses: appleboy/ssh-action@master<br>    env:<br>      GITHUB_SHA: ${{ github.sha }}<br>      RELEASE_PATH: ${{ matrix.server.path }}/releases/${{ github.sha }}<br>      ACTIVE_RELEASE_PATH: ${{ matrix.server.path }}/current<br>      STORAGE_PATH: ${{ matrix.server.path }}/storage<br>      BASE_PATH: ${{ matrix.server.path }}<br>    with:<br>      host: ${{ matrix.server.ip }}<br>      username: ${{ matrix.server.username }}<br>      key: ${{ secrets.SSH_KEY }}<br>      port: ${{ matrix.server.port }}<br>      envs: envs: GITHUB_SHA,RELEASE_PATH,ACTIVE_RELEASE_PATH,STORAGE_PATH,BASE_PATH<br>      script: |<br>        ${{ matrix.server.beforeHooks }}</pre><p>Again, similar job but with a couple of changes. First, we want to make sure the create-deployment-artifacts and the prepare-release-on-servers have been completed by passing an array to the need property.</p><pre>needs: [ create-deployment-artifacts, prepare-release-on-servers ]</pre><p>To make things a bit easier when defining before hooks, I want to use specific environment variables to simplify things. Let&#39;s say I want to execute set permissions on the storage directory:</p><pre>[<br>  {<br>    &quot;name&quot;: &quot;server-1&quot;,<br>    &quot;beforeHooks&quot;: &quot;chmod -R 0777 ${RELEASE_PATH}/storage&quot;,<br>    &quot;afterHooks&quot;: &quot;&quot;,<br>    &quot;path&quot;: &quot;/var/www/html&quot;<br>  }<br>]</pre><p>To make these environment variables available, you need to explicitly define which variables you want to pass via the envs input variable.</p><h3>Activating the release</h3><p>Time for the most exciting part, if I say so myself, activating our release. We will re-use a big chunk of our previous step with a couple of changes.</p><pre># //<br>activate-release:<br>  name: &quot;${{ matrix.server.name }}: Activate release&quot;<br>  runs-on: ubuntu-latest<br>  needs: [ create-deployment-artifacts, prepare-release-on-servers, run-before-hooks ]<br>  strategy:<br>    matrix:<br>      server: ${{ fromJson(needs.create-deployment-artifacts.outputs.DEPLOYMENT_MATRIX) }}<br>  steps:<br>    - name: Activate release<br>      uses: appleboy/ssh-action@master<br>      env:<br>        GITHUB_SHA: ${{ github.sha }}<br>        RELEASE_PATH: ${{ matrix.server.path }}/releases/${{ github.sha }}<br>        ACTIVE_RELEASE_PATH: ${{ matrix.server.path }}/current<br>        STORAGE_PATH: ${{ matrix.server.path }}/storage<br>        BASE_PATH: ${{ matrix.server.path }}<br>        LARAVEL_ENV: ${{ secrets.LARAVEL_ENV }}<br>      with:<br>        host: ${{ matrix.server.ip }}<br>        username: ${{ matrix.server.username }}<br>        key: ${{ secrets.SSH_KEY }}<br>        port: ${{ matrix.server.port }}<br>        envs: GITHUB_SHA,RELEASE_PATH,ACTIVE_RELEASE_PATH,STORAGE_PATH,BASE_PATH,ENV_PATH,LARAVEL_ENV<br>        script: |<br>          printf &quot;%s&quot; &quot;$LARAVEL_ENV&quot; &gt; &quot;${BASE_PATH}/.env&quot;<br>          ln -s -f ${BASE_PATH}/.env $RELEASE_PATH<br>          ln -s -f $STORAGE_PATH $RELEASE_PATH<br>          ln -s -n -f $RELEASE_PATH $ACTIVE_RELEASE_PATH<br>          service php8.1-fpm reload</pre><p>Again, we update the need input variable to include all previous steps before running the activate-release job:</p><pre>needs: [ create-deployment-artifacts, prepare-release-on-servers, run-before-hooks ]</pre><p>I&#39;ve added a new Laravel environment variable, LARAVEL_ENV, which will contain the environment variable for our Laravel application. This variable doesn&#39;t contain any data just yet. So let&#39;s do this first, you can define key-value secrets per repository via the GitHub UI (repository-&gt;settings -&gt;secrets)</p><p>Let&#39;s take a closer look at our bash script line by line:</p><pre># Store the environment data to the /var/www/html/.env file <br>printf &quot;%s&quot; &quot;$LARAVEL_ENV&quot; &gt; &quot;${BASE_PATH}/.env&quot;<br><br># Link /var/www/html/.env file to /var/www/html/releases/633be605b03169ef96c2cee1f756852e1ceb2688/.env<br>ln -s -f ${BASE_PATH}/.env $RELEASE_PATH<br><br># Link /var/www/html/storage directory to /var/www/html/releases/633be605b03169ef96c2cee1f756852e1ceb2688/storage<br>ln -s -f $STORAGE_PATH $RELEASE_PATH<br><br># Link the release path to the active release path, /var/www/html/current -&gt; /var/www/html/releases/633be605b03169ef96c2cee1f756852e1ceb2688<br>ln -s -n -f $RELEASE_PATH $ACTIVE_RELEASE_PATH<br><br># Reload php8.1 to detect file changes<br>service php8.1-fpm reload</pre><p><em>Tip: There is a minor delay between the activation and the after-hook job. So make sure to include critical commands in the activation job. You could add an extra release hook configuration if you want to define this per server.</em></p><p>Taking a quick look at all the directories via SSH verifies shows that everything is working correctly.</p><p>The current directory is pointing to /var/www/html/releases/5b62b9a13...</p><p>The current release environment file /var/www/html/current/.env is pointing to /var/www/html/.env and /var/www/html/current/storage is pointing to /var/www/html/storage.</p><p>Our Laravel application is up and running with zero downtime! Hurray!</p><h3>After hook</h3><p>Our after-hook is exactly the same as our before-hook besides a few naming changes:</p><pre># //<br>run-after-hooks:<br>  name: &quot;${{ matrix.server.name }}: After hook&quot;<br>  runs-on: ubuntu-latest<br>  needs: [ create-deployment-artifacts, prepare-release-on-servers, run-before-hooks, activate-release ]<br>  strategy:<br>    matrix:<br>      server: ${{ fromJson(needs.create-deployment-artifacts.outputs.DEPLOYMENT_MATRIX) }}<br>  steps:<br>    - name: Run after hooks<br>      uses: appleboy/ssh-action@master<br>      env:<br>        GITHUB_SHA: ${{ github.sha }}<br>        RELEASE_PATH: ${{ matrix.server.path }}/releases/${{ github.sha }}<br>        ACTIVE_RELEASE_PATH: ${{ matrix.server.path }}/current<br>        STORAGE_PATH: ${{ matrix.server.path }}/storage<br>        BASE_PATH: ${{ matrix.server.path }}<br>      with:<br>        host: ${{ matrix.server.ip }}<br>        username: ${{ matrix.server.username }}<br>        key: ${{ secrets.SSH_KEY }}<br>        port: ${{ matrix.server.port }}<br>        envs: GITHUB_SHA,RELEASE_PATH,ACTIVE_RELEASE_PATH,STORAGE_PATH,BASE_PATH<br>        script: |<br>          ${{ matrix.server.afterHooks }}</pre><p>Again the needs the input variable is updated to make sure all previous steps have been completed.</p><h3>Cleaning up</h3><p>Every release we upload and extract on our production servers takes up space. You don&#39;t want to end up having servers meltdown because of their hard drives being full. So let&#39;s clean up after each deployment and keep 5 releases.</p><pre>clean-up:<br>  name: &quot;${{ matrix.server.name }}: Clean up&quot;<br>  runs-on: ubuntu-latest<br>  needs: [ create-deployment-artifacts, prepare-release-on-servers, run-before-hooks, activate-release, run-after-hooks ]<br>  strategy:<br>    matrix:<br>      server: ${{ fromJson(needs.create-deployment-artifacts.outputs.DEPLOYMENT_MATRIX) }}<br>  steps:<br>    - name: Run after hooks<br>      uses: appleboy/ssh-action@master<br>      env:<br>        RELEASES_PATH: ${{ matrix.server.path }}/releases<br>        ARTIFACTS_PATH: ${{ matrix.server.path }}/artifacts<br>      with:<br>        host: ${{ matrix.server.ip }}<br>        username: ${{ matrix.server.username }}<br>        key: ${{ secrets.SSH_KEY }}<br>        port: ${{ matrix.server.port }}<br>        envs: RELEASES_PATH<br>        script: |<br>          cd $RELEASES_PATH &amp;&amp; ls -t -1 | tail -n +6 | xargs rm -rf<br>          cd $ARTIFACTS_PATH &amp;&amp; ls -t -1 | tail -n +6 | xargs rm -rf</pre><p>Let&#39;s take a closer look at the commands we are executing:</p><pre>cd $RELEASES_PATH &amp;&amp; ls -t -1 | tail -n +6 | xargs rm -rf<br>cd $ARTIFACTS_PATH &amp;&amp; ls -t -1 | tail -n +6 | xargs rm -rf</pre><p>This will cd into our release and artifacts directory, list all files in a given directory, order the list by timestamp, return the results with the offset of 5 entries, and finally remove given files or folders.</p><h3>Multi-server deployment</h3><p>To deploy to multiple servers, you only need to update your deployment-config.json to include the additional servers:</p><pre>[   <br>    {     <br>        &quot;name&quot;: &quot;server-1&quot;,    <br>        &quot;ip&quot;: &quot;123.456.78.90&quot;,     <br>        &quot;username&quot;: &quot;web&quot;,     <br>        &quot;port&quot;: &quot;22&quot;,     <br>        &quot;beforeHooks&quot;: &quot;&quot;,     <br>        &quot;afterHooks&quot;: &quot;&quot;,     <br>        &quot;path&quot;: &quot;/var/www/html&quot;   <br>      }, <br>  <br>      {    <br>         &quot;name&quot;: &quot;server-2&quot;,     <br>          &quot;ip&quot;: &quot;901.234.56.78&quot;,     <br>          &quot;username&quot;: &quot;web&quot;,     <br>          &quot;port&quot;: &quot;22&quot;,     <br>          &quot;beforeHooks&quot;: &quot;&quot;,     <br>          &quot;afterHooks&quot;: &quot;&quot;,     <br>          &quot;path&quot;: &quot;/var/www/html&quot;  <br>       }   <br>]</pre><h3>Conclusion</h3><p>That&#39;s a wrap! You&#39;ve successfully made a release artifact from your application build and deployed it to multiple servers without any downtime!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9216abe1be2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DRY Principle in Software Development. (Don’t Repeat Yourself)]]></title>
            <link>https://medium.com/@officialozioma/dry-principle-in-software-development-dont-repeat-yourself-8ae095fab1e2?source=rss-6fd1ce4118ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ae095fab1e2</guid>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[refactoring]]></category>
            <category><![CDATA[dry]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Ozioma Dike]]></dc:creator>
            <pubDate>Wed, 16 Nov 2022 18:06:44 GMT</pubDate>
            <atom:updated>2022-11-16T18:44:52.194Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Wz88WQrMYpfI68xU" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When developing software or writing code there are so many principles or best practices to follow in order for your code to be readable, maintainable, and easy to optimize, sometimes this might be not very clear for beginners. One of these principles is DRY, which stands for Don’t Repeat Yourself, it is a software development principle aiming to reduce code duplication which can lead to poor refactoring and maintenance. The DRY principle is simply about the duplication of knowledge, of intent. It’s about expressing the same thing in two different places, possibly in two totally different ways.</p><h4>Prerequisites</h4><p>This tutorial contains a detailed description of the DRY Principle. To follow along and for a better outstanding of the examples used in this tutorial. you need first to have a basic knowledge of PHP, especially the OOP concept.</p><p><strong>NOTE:</strong> The detailed explanation of DRY in this tutorial is not unique to PHP only, these principles can be applied in any programming language of your choice</p><h4>More details about the DRY Principle</h4><p>The DRY principle states that every<em> </em>piece of knowledge must have a single, unambiguous, authoritative representation within a system.<br>It is always easy to copy and paste some code when you need it in some other place of your application. Especially when it is a hotfix, you are under a pressure, and you should do it as quickly as possible. If you think that now it is ok, later I will return and refactor this. And we know, that in most cases this will never happen until something again will be broken but this time because of this duplicated piece of code.</p><p>Every duplicated logic is a potential delayed-action mine. Duplication often leads to a maintenance nightmare. When you have the same logic in multiple locations and you need this code to be changed, chances are high that the necessary changes won’t correctly be applied to every location where that piece of logic occurs. When these multiple locations come out of sync with one another a heap of bugs will appear. So, to avoid these types of bugs we need to be sure that the relevant piece of code exists only in a single location:</p><ul><li>Assign to this <em>source of truth</em> a clear name.</li><li>Choose the right location for it</li><li>Reuse it, don’t duplicate</li></ul><p>Next time when we need to change it we exactly know where to look for. Avoiding duplication also improves the readability of the code. A small simple function or method is much easier to read and understand than a huge complex one.</p><h3>Things to note before applying the DRY Principle</h3><p>We often think about DRY as <em>duplicate code is bad, and code reuse is good</em>, right? But it is a wrong approach. The principle is not about a code, it is <em>about knowledge</em>. Next time when you see a <em>duplication of code</em> do not immediately extract it to a method or an abstraction. Maybe in this current context, duplication is not evil, it is normal.</p><h4>An Example using a code snippet</h4><p>Consider two classes Student and Teacher. Both have the same method with exactly the same logic. Should we extract a base Person class? Are we sure that the logic in these methods represents the <em>same knowledge</em>? Or this happened by accident.</p><pre>&lt;?php<br><br>class Student <br>{<br>    public function getFullName()<br>    {<br>        return $this-&gt;lastname . &#39; &#39; . $this-&gt;firstname;<br>    }<br>}<br><br>class Teacher <br>{<br>    public function getFullName()<br>    {<br>        return $this-&gt;lastname . &#39; &#39; . $this-&gt;firstname;<br>    }   <br>}</pre><p>We have two classes Student and Teacher. Both of them get the full name. Furthermore, the implementations of <em>getting the full name</em> are identical. Should we extract? Let’s try and see what happens. We can extract a parent class called,Person put getFullName() method in it and then extend our classes from Person.</p><pre>&lt;?php<br><br>class Person<br>{<br>   public function getFullName()<br>    {<br>        return $this-&gt;lastname . &#39; &#39; . $this-&gt;firstname;<br>    } <br>}<br><br>class Student extends Person {<br><br>    public function getFullName()<br>    {<br>      $this-&gt;getFullName();<br>    }<br><br>}<br><br>class Teacher extends Person {<br><br>    public function getFullName()<br>    {<br>      $this-&gt;getFullName();<br>    }<br>}</pre><p>This really looks very nice, but in a situation, we are told that the teachers’ full name should contain their middle name. Now what? We need to go and override the parent’s implementation.</p><p>As a result of our <em>extraction,</em> we achieved nothing but complexity. We have a <em>reusable</em> thing that is used only once. It is not very clever. We should keep this duplication in these classes.</p><p>In this case, duplication is not about knowledge, it is only about a code. But this code represents different knowledge, even if it looks quite the same. When we make changes to the Teacher&#39;s class, it is unlikely that the same changes will be done to a Student&#39;s class.</p><h3>How to avoid Premature Refactoring</h3><p>You shouldn’t apply the DRY principle if your business logic doesn’t have any duplication <em>yet</em>. Again, it depends on the context, but, as a rule of thumb, trying to apply DRY to something which is only used in one place can lead to premature generalization.</p><p>One more example of when we don’t need to remove duplication is when the application will <em>never</em> be changed. When you are creating a prototype or some script that will be run once and then thrown away, it is ok to copy and paste some pieces of code, if they will never be changed. Code duplication costs a lot, but only if the code changes.</p><h4>Rule Of Three, when applying the DRY Principle</h4><p>This rule can help us in making decisions about when to extract a duplicated code. It says: <em>Extract duplication only when you see it the third time.</em></p><ol><li>The first time you do something, you just write the code.</li><li>The second time you do a similar thing, you duplicate your code.</li><li>The third time you do something similar, you can extract it and refactor it.</li></ol><p>But why? Why should we duplicate our code, when we have always said that it is wrong?</p><p>These simple steps are built to prevent you from prematurely and wrong refactoring, when the problem we are trying to solve is not yet clear. Prematurely refactoring a piece of code when we don’t exactly see the problem behind it can cause tremendous problems in the future. <br>With only two examples of duplication, it can be dangerous to abstract, because some details of the specific scenario can bleed into the abstraction. <br>But when we have at least three examples of duplicated code we can more precisely define patterns and abstractions for it. These rules also prevent you from wasting your time and making something <em>reusable</em> when at the end of the day you end up with only one use of it.</p><h4>Implementation of DRY and Code Duplication</h4><p>Code reuse and code duplication are two different things. DRY states that you shouldn’t duplicate knowledge, not that you should use abstractions to reuse everything, everywhere.<br>So DRY is all about knowledge? All about business logic? Let’s look at some code snippets to understand why:</p><pre>&lt;?php<br><br>class CsvValidation<br>{<br>    public function validateProduct(array $product)<br>    {<br>        if (!isset($product[&#39;color&#39;])) {<br>            throw new \Exception(&#39;Import fail: the product attribute color is missing&#39;);<br>        }<br><br>        if (!isset($product[&#39;size&#39;])) {<br>            throw new \Exception(&#39;Import fail: the product attribute size is missing&#39;);<br>        }<br><br>        if (!isset($product[&#39;type&#39;])) {<br>            throw new \Exception(&#39;Import fail: the product attribute type is missing&#39;);<br>        }<br>    }<br>}</pre><p>This code doesn’t look that bad, does it? The method validates some CSV output in only one place (validateProduct()). This is the knowledge, and it’s not repeated. but you might notice that there are conditionals statements everywhere Those <strong>If statements</strong>? Isn’t it an obvious violation of the DRY principle? Well… no. It’s not. I would call that unnecessary code duplication, but not a violation of the DRY principle.</p><p>You can restructure this code snippet in a more readable and maintainable way, for example</p><pre>&lt;?php<br><br>class CsvValidation<br>{<br>    private $productAttributes = [<br>        &#39;color&#39;,<br>        &#39;size&#39;,<br>        &#39;type&#39;,<br>    ];<br><br>    public function validateProduct(array $product)<br>    {<br>        foreach ($this-&gt;productAttributes as $attribute) {<br>            if (!isset($product[$attribute])) {<br>                throw new \Exception(sprintf(&#39;Import fail: the product attribute %s is missing&#39;, $attribute));<br>            }<br>        }<br>    }<br>}</pre><p>It looks better, does it? There’s no code duplication anymore!</p><h4>Conclusion</h4><ol><li><strong>Knowledge duplication</strong> is always a DRY principle violation.</li><li><strong>Code duplication</strong> doesn’t necessarily violate the DRY principle.</li></ol><p>The idea of DRY is simple in theory: you shouldn’t need to update in parallel multiple things when one change occurs. If your knowledge is repeated two times in your code and you need to change it, you might forget to change it everywhere. In your documentation, it could lead to misconceptions, confusion, and ultimately wrong implementations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ae095fab1e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laravel Repository Design Pattern- ( A Quick Demonstration )]]></title>
            <link>https://blog.devgenius.io/laravel-repository-design-pattern-a-quick-demonstration-5698d7ce7e1f?source=rss-6fd1ce4118ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/5698d7ce7e1f</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[repository-pattern]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Ozioma Dike]]></dc:creator>
            <pubDate>Sat, 12 Nov 2022 12:27:40 GMT</pubDate>
            <atom:updated>2022-11-17T08:44:22.057Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i_6_5x4crXB6bo9_" /><figcaption>Photo by <a href="https://unsplash.com/@afgprogrammer?utm_source=medium&amp;utm_medium=referral">Mohammad Rahmani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The repository design pattern is an abstraction from the data layer of an application. A repository can be described as a layer of abstraction between the domain and data mapping layers, one that provides an avenue of mediation between both, via a collection-like interface for accessing domain objects.</p><h4><strong>Prerequisite</strong></h4><p>This tutorial will be a hands-on demonstration. If you’d like to follow along, be sure you have the following: A basic understanding of PHP and <a href="https://laravel.com/docs/9.x">Laravel</a>, <br>and you have installed PHP 7.4 and <a href="https://laravel.com/docs/8.x/installation#the-laravel-installer">Laravel installer</a>. <a href="https://getcomposer.org/">Composer</a> installed globally.</p><h4>Getting started</h4><p>In this Tutorial, we going to build a simple application to demonstrate how to use the repository design patterns in Laravel. We are going to build a task management system for a demonstration first, we need to install Laravel via Laravel installer.<br>Run the following code on your terminal.</p><pre><strong>laravel new task_manager</strong></pre><blockquote>Note: Make sure you have installed and set up <a href="https://laravel.com/docs/8.x/installation#the-laravel-installer">Laravel installer</a> in computer.</blockquote><p>After the installation has finished, next we navigate to the task manager we just created using the terminal. run the following code below in your terminal.</p><pre><strong>cd task_manager</strong></pre><h4>Set up the database</h4><p>we need to set up the database that we want to use in this application. Laravel provides an easy way to do this. To do that, in the .env file, update the database-related parameters as shown below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/209c4696520d351640044dbcbdec2c52/href">https://medium.com/media/209c4696520d351640044dbcbdec2c52/href</a></iframe><p>Finally, using your preferred database management application, create a new database called task_manager.</p><h4>Generate the<strong> model, migration, and controller</strong></h4><p>In Laravel generating a model migration and controller is very easy all you need to do is run the following command in your terminal.</p><pre><strong>php artisan make:model Task -mc</strong></pre><p>The -mc argument lets Artisan know that we want to create a <a href="https://laravel.com/docs/8.x/migrations#introduction">migration</a> file and controller for the Task model.</p><p>The command above will create three new files:</p><ul><li>A controller in <em>app/Http/Controllers/TaskController.php</em></li><li>A migration file in <em>database/migrations/YYYY_MM_DD_HHMMSS_create_tasks_table.php</em></li><li>A model located in <em>app/Models/Task.php</em></li></ul><p>In <em>database/migrations/YYYY_MM_DD_HHMMSS_create_tasks_table.php</em>, update the up function to match the following.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/100933bdd5ce87f4b6a1fbbdcc473adf/href">https://medium.com/media/100933bdd5ce87f4b6a1fbbdcc473adf/href</a></iframe><p>As specified in the migration file, the tasks table will have the following columns:</p><ol><li>An ID. This will be the table’s primary key.</li><li>The Title of the task.</li><li>A detailed description of the task</li><li>Whether or not the task has been completed.</li><li>When the task was created and updated, created_at and updated_at, provided by the timestamps function.</li></ol><p>Next, we run the following command to migrate the migration we just created</p><pre><strong>php artisan migrate</strong></pre><h4>Building the frontend</h4><p>we are going to build the front end of this Task management application using HTML and CSS (Bootstrap). First, let&#39;s create the login and registration page. open the <strong><em>resources/view</em></strong><em> </em>folder and create the following folders, t<strong>asks</strong>, <strong>layouts, and auth </strong>inside the layouts folder create the <strong><em>app.blade.php </em></strong>file, you now have <strong><em>resources/view/layouts/app.blade.php.</em></strong></p><p>Inside the tasks, the folder creates the following files, <strong><em>index.blade.php, create.blade.php show.blade.php, edit.blade.php.</em></strong></p><p>Open the <strong><em>resources/view/layouts/app.blade.php</em></strong> and paste the following code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/758ddc1c402aeadcbf91ae9b86d16119/href">https://medium.com/media/758ddc1c402aeadcbf91ae9b86d16119/href</a></iframe><p>Open the <strong><em>resources/view/tasks/index.blade.php </em></strong>and paste the following code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/db2b026f5dd8e3df3a035bfe0717eebb/href">https://medium.com/media/db2b026f5dd8e3df3a035bfe0717eebb/href</a></iframe><p>Open the <strong><em>resources/view/tasks/create.blade.php </em></strong>and paste the following code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8afeae6aff8d134c51211abe195ff205/href">https://medium.com/media/8afeae6aff8d134c51211abe195ff205/href</a></iframe><p>Open the <strong><em>resources/view/tasks/show.blade.php </em></strong>and paste the following code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f67e7570df5a8b422598f18023bc8dac/href">https://medium.com/media/f67e7570df5a8b422598f18023bc8dac/href</a></iframe><p>Open the <strong><em>resources/view/tasks/edit.blade.php </em></strong>and paste the following code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/71ea6c4919456e2a4a8f8f2ad2c560dd/href">https://medium.com/media/71ea6c4919456e2a4a8f8f2ad2c560dd/href</a></iframe><blockquote><strong>Note</strong>: You can style the frontend anyhow you want, this tutorial is not focused on the front end, it focuses on the repository design pattern</blockquote><h4>Create the Repository interface</h4><p>Before we create a repository for the Task model, let&#39;s define an interface to specify all the methods which the repository must declare. Instead of relying directly on the repository class, our controller (and any order component we may build in the future) will depend on the interface.<br>This is one of the many benefits of the repository design pattern, it will make our code more flexible because, should it become necessary to make a change in the future, the controller remains unaffected. <br>For instance, if we decided to outsource Task management to a 3rd party application, or maybe we want to change the database system to another database that is not supported by Laravel eloquent, we can build a new module that conforms to TaskRepositoryInterface&#39;s signature and swap the binding declarations and our controller will work exactly as expected - without touching a single line of code in the controller.</p><p>In the <em>app</em> directory, create a new folder called <em>Interfaces</em>. Then, in the <em>Interfaces</em>, create a new file called <em>TaskRepositoryInterface.php</em> and add the following code to it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/678d7ab4ba363e23526079424c2a6412/href">https://medium.com/media/678d7ab4ba363e23526079424c2a6412/href</a></iframe><h4>Create the Repository</h4><p>Next, in the app folder, create a new folder called Repositories. In this folder, create a new file called <em>TaskRepository.php</em> and add the following code to it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6694d3409fffc440ea2a307612777e9d/href">https://medium.com/media/6694d3409fffc440ea2a307612777e9d/href</a></iframe><p>Apart from the flexibility provided by the interface, encapsulating queries in this manner has the added advantage that we don’t have to duplicate queries throughout the application. <br>If, in the future, we decide to retrieve only uncompleted Tasks in the getAllTasks() function, we would only have to make a change in one place instead of tracking down all the places where Task::where(&#39;user_id&#39;, auth()-&gt;user()-&gt;id) is declared while risking missing some</p><p>The main idea of using repository design patterns in a <a href="https://laravel.com/docs/8.x#meet-laravel">Laravel</a> application is to create a bridge between models and controllers. In other words, to decouple the hard dependencies of models from the controllers. The model should not be responsible for communicating with or extracting data from the database. A model should be an object that represents a given table/document/object or any other type in our data structure, and this should be its sole responsibility. Therefore, to keep your <strong>Laravel code clean and safe</strong>, it is worth using repositories to separate the responsibility for which the model should never be responsible.</p><h4>Creating the controller</h4><p>Now that we create our repository, let’s add some code to our controller. Open <em>app/Http/Controllers/TaskController.php</em> and update the code to match the following.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/24ffa97635a27e1b5da91a43f9d28bc3/href">https://medium.com/media/24ffa97635a27e1b5da91a43f9d28bc3/href</a></iframe><p>The code injects an TaskRepositoryInterface instance via the constructor and uses the relevant object&#39;s methods in each controller method.</p><p>First, within the index() method, it calls the getAllTasks() method defined taskRepository to retrieve the list of tasks and returns it in a view.</p><p>Next, the store() method calls the createTask()<em> method</em> from the textRepository to create a new task. This takes the details of the task that needs to be created as an array and returns a successful response afterward.</p><p>Within the show() the method in the controller, it retrieves the unique task Id from the route and passes it to the getTaskById() as a parameter. This fetches the details of the task with a matching Id from the database and returns a response in JSON format.</p><p>Then, to update the details of an already created task, it calls the updateTask() method from the repository. This takes two parameters: the unique id of the task and the details that need to be updated.</p><p>Lastly, the destroy() the method retrieves the unique id of a particular task from the route and calls the deleteTask() the method from the repository to delete it.</p><h4>Adding the routes</h4><p>To map each method defined in the controller to specific routes, add the following code to <em>routes/web.php</em>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c7f6d9b44203252dae5a7b72c2ddeb4/href">https://medium.com/media/6c7f6d9b44203252dae5a7b72c2ddeb4/href</a></iframe><blockquote>Remember to include the import statement for the TaskController.</blockquote><pre>use App\Http\Controllers\TaskController;</pre><h4>Bind the interface and the implementation</h4><p>The last thing we need to do is bind TaskRepository to TaskRepositoryInterface in <a href="https://laravel.com/docs/8.x/container#introduction">Laravel&#39;s Service Container</a>; we do this via a <a href="https://laravel.com/docs/8.x/providers">Service Provider</a>. Create one using the following command.</p><pre>php artisan make:provider RepositoryServiceProvider</pre><p>Open <em>app/Providers/RepositoryServiceProvider.php</em> and update the register function to match the following.</p><pre>public function register() <br>{<br>    $this-&gt;app-&gt;bind(TaskRepositoryInterface::class, TaskRepository::class);<br> }</pre><p>Remember to include the import statement for TaskRepository and TaskRepositoryInterface.</p><pre>use App\Interfaces\TaskRepositoryInterface;<br>use App\Repositories\TaskRepository;</pre><p>Finally, add the new Service Provider to the providers array in <em>config/app.php.</em></p><pre>&#39;providers&#39; =&gt; [<br>    // ...other declared providers<br>    App\Providers\RepositoryServiceProvider::class,<br>];</pre><h4>Test the application</h4><p>Run the application using the following command.</p><pre>php artisan serve</pre><p>By default, the served application will be available at <a href="http://127.0.0.1:8000/">http://127.0.0.1:8000</a>.</p><blockquote>we have come to the end of this tutorial on repository design patterns this is a short demonstration of how to implement the repository design pattern on your project. we learned about the Repository pattern and how to use it in a Laravel application. We’ve also seen some of the benefits it offers a large-scale project — one of which is loosely coupled code where we are coding to abstractions, not concrete implementations. <br>Finally, a summary of what is worth noting when implementing a repository pattern.</blockquote><blockquote>Each repository should have its own interface implemented! Never create a repository without implementing its own interface, and do not create one interface for all repositories. It is not good practice!</blockquote><blockquote>It would help if you always injected your repository using Dependency Injection instead of making an instance using the new keyword. As a type, always use an interface, not an implementation! If you inject objects into the class, it is easier to write unit tests, you are warning SRP(Single Responsibility Principle), and the code looks cleaner.</blockquote><blockquote>Make your code reusable. If more repositories than one use any method, you should implement this method into the BaseRepository class to avoid the DRY principle.</blockquote><blockquote>In your repository, inject the model in a constructor, don’t use a class as a static. By doing it, you can easily mock your model in your unit tests!</blockquote><h4>Conclusion</h4><p>I will end on a note of caution, however. For small projects, this approach will feel like a lot of work and boilerplate code for returns that may not be immediately apparent. It is, therefore, important that you properly consider the scale of the project before adopting this approach.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5698d7ce7e1f" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/laravel-repository-design-pattern-a-quick-demonstration-5698d7ce7e1f">Laravel Repository Design Pattern- ( A Quick Demonstration )</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build an Application with PHP and PostgreSQL]]></title>
            <link>https://blog.devgenius.io/how-to-build-an-application-with-php-and-postgresql-1a5d2b590ea7?source=rss-6fd1ce4118ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a5d2b590ea7</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[web-app-development]]></category>
            <category><![CDATA[php-with-postgresql]]></category>
            <dc:creator><![CDATA[Ozioma Dike]]></dc:creator>
            <pubDate>Mon, 24 Oct 2022 18:36:29 GMT</pubDate>
            <atom:updated>2022-10-29T16:18:53.589Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_e-9BcIzlkWzbOc5" /><figcaption>Photo by <a href="https://unsplash.com/@silvawebdesigns?utm_source=medium&amp;utm_medium=referral">Nathan da Silva</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this article, we are going to build a CRUD PHP application using PostgreSQL as the Database. CRUD stands for Create, Read, Update, and Delete. CRUD operations are basic data manipulation for the database. INSERT query is used to insert data in the database. SELECT Query is used to select data from the database. UPDATE Query is used to update data in the database and Delete Query is used to delete data from the database.</p><h4><strong>Pre-Requisites</strong></h4><p>This article assumes you have already installed PHP on your PC or MacBook, you have also installed PostgreSQL, and that you know the basics of PHP, At least you built a PHP application, you know the basics of SQL, and you should have built a PHP application that uses an SQL database (<em>eg Mysql). <br></em>To follow along and understand this article, a basic knowledge of PHP, working with SQL and PostgreSQL is required, you should have also setup PHP and PostgreSQL on your PC or MacBook, and finally, you should know how to interact with PostgreSQL using the CMD or terminal depending on your operating system.</p><h4><strong>Create a database that will be used for the CRUD operation.</strong></h4><p>To start building our CRUD application with PHP and PostgreSQL First, We have to create a database in PostgreSQL. To do that login to your PostgreSQL from the terminal or CMD and run this</p><pre>create database users_db</pre><p>here this command creates a database called users_db in Postgres. you can also create the database from the UI, this depends on how you installed Postgres on your PC or MacBook.</p><h4>Create a database table to store users&#39; information.</h4><p>Now that we have created our Database we can now create tables inside the database. so here we are going to make a users table. to create the table we going to run the following command in our terminal or CMD.</p><pre>CREATE TABLE public.&quot;user&quot;<br>(<br>    id serial NOT NULL,<br>    name character varying(250),<br>    email character varying(250),<br>    phone bigint,<br>    address text,<br>    PRIMARY KEY (id)<br>)</pre><p>here our table is called user, it has the following fields id, name, email, phone, and address. for this article, we are going to have only one table in our database.</p><h4>We are going to connect the PHP application to the database</h4><p>To use PHP with PostgreSQL we need to connect to the database and we will do so, by creating a PHP file and calling it <strong><em>connection.php</em></strong> in our application root directory. inside the <strong><em>connection.php</em></strong> file, we will then have the following PHP code.</p><pre>&lt;?php <br>   $host = &quot;localhost&quot;;<br>   $port = &quot;5432&quot;;<br>   $dbname = &quot;users_db&quot;;<br>   $user = &quot;postgres&quot;;<br>   $password = &quot;password&quot;; <br>   $connection_string = &quot;host={$host} port={$port} dbname={$dbname}   <br>                              user={$user} password={$password} &quot;;</pre><pre>   $dbconn = pg_connect($connection_string);     <br>?&gt;</pre><p>Here we are connected to PostgreSQL using the PHP function <strong>pg_connect()<br></strong>Please update the $dbname, $user, and $password with your details.</p><h4>Building Reusable PHP functions that will help us interact with PostgreSQL Database</h4><p>Now that we have connected to our database, we have to create another PHP file to handle all the database queries. the db_class will have the following code.</p><pre>&lt;?php<br>     include_once(&#39;connection.php&#39;); </pre><pre>    class Db_Class<br>    {<br>        private $table_name = &#39;user&#39;;</pre><pre>        function createUser()<br>        {<br>             $sql = &quot;INSERT INTO PUBLIC.&quot;.$this-&gt;table_name.&quot;  <br>             (name,email,mobile_no,address) &quot;.&quot;VALUES(&#39;&quot;.<br>             $this-&gt;cleanData($_POST[&#39;name&#39;]).&quot;&#39;,&#39;&quot;.<br>             $this-&gt;cleanData($_POST[&#39;email&#39;]).&quot;&#39;,&#39;&quot;.<br>             $this-&gt;cleanData($_POST[&#39;phone&#39;]).&quot;&#39;,&#39;&quot;.<br>             $this-&gt;cleanData($_POST[&#39;address&#39;]).&quot;&#39;)&quot;;</pre><pre>            return pg_affected_rows(pg_query($sql));<br>        }<br><br>        function getUsers()<br>        {             <br>            $sql =&quot;select *from public.&quot; . $this-&gt;table_name . &quot;  <br>            ORDER BY id DESC&quot;;</pre><pre>           return pg_query($sql);<br>        } <br><br>        function getUserById(){    <br>  <br>            $sql =&quot;select *from public.&quot; . $this-&gt;table_name . &quot;  <br>            where id=&#39;&quot;.$this-&gt;cleanData($_POST[&#39;id&#39;]).&quot;&#39;&quot;;</pre><pre>            return pg_query($sql);<br>        } <br><br>       function deleteuser()<br>       {    <br>  <br>            $sql =&quot;delete from public.&quot; . $this-&gt;table_name . &quot;  <br>            where id=&#39;&quot;.$this-&gt;cleanData($_POST[&#39;id&#39;]).&quot;&#39;&quot;;</pre><pre>            return pg_query($sql);<br>       } <br><br>       function updateUser($data=array())<br>       {       <br>     <br>          $sql = &quot;update public.user set name=&#39;&quot;.<br>          $this-&gt;cleanData($_POST[&#39;name&#39;]).&quot;&#39;,email=&#39;&quot;.<br>          $this-&gt;cleanData($_POST[&#39;email&#39;]).&quot;&#39;, phone=&#39;&quot;.<br>          $this-&gt;cleanData($_POST[&#39;phone&#39;]).&quot;&#39;,address=&#39;&quot;.<br>          $this-&gt;cleanData($_POST[&#39;address&#39;]).&quot;&#39; where id = &#39;&quot;.<br>          $this-&gt;cleanData($_POST[&#39;id&#39;]).&quot;&#39; &quot;;</pre><pre>          return pg_affected_rows(pg_query($sql));        <br>       }<br>       function cleanData($val)<br>       {<br>         return pg_escape_string($val);<br>       }<br>?&gt;</pre><p>This file contains reusable PHP codes that will help us to interact with PostgreSQL.</p><h4>Handling the reading and deleting of data from PostgreSQL</h4><p>The index page in PHP is the first page that we visit when we open a website on the browser. for this article, we create a simple index page. Create an index.php file and add the below PHP code.</p><pre>&lt;?php <br>     include(&#39;header.php&#39;);<br>     $users = $obj-&gt;getUsers();<br>     $sn=1;</pre><pre>     if(isset($_POST[&#39;update&#39;]))<br>     {<br>        $user = $obj-&gt;getUserById();<br>        $_SESSION[&#39;user&#39;] = pg_fetch_object($user);<br>        header(&#39;location:edit.php&#39;);<br>     }</pre><pre>     if(isset($_POST[&#39;delete&#39;]))<br>     {<br>         $ret_val = $obj-&gt;deleteuser();</pre><pre>          if($ret_val==1)<br>           {<br>              echo &quot;&lt;script language=&#39;javascript&#39;&gt;&quot;;<br>              echo &quot;alert(&#39;Record Deleted Successfully&#39;)<br>           {<br>            window.location.reload();<br>      }&quot;;</pre><pre>      echo &quot;&lt;/script&gt;&quot;;<br>  }<br>}<br>?&gt;</pre><pre>  &lt;div class=&quot;container-fluid bg-3 text-center&quot;&gt;<br>    <br>     &lt;h3&gt;CRUD Example Using PHP OOPS And PostgreSQL&lt;/h3&gt;</pre><pre>     &lt;a href=&quot;insert.php&quot; class=&quot;btn btn-primary pull-right&quot;              <br>     style=&#39;margin-top:-30px&#39;&gt; &lt;span class=&quot;glyphicon glyphicon-<br>     plus-sign&quot;&gt;&lt;/span&gt;Add Record&lt;/a&gt;</pre><pre>  &lt;br&gt;<br>  <br>  &lt;div class=&quot;panel panel-primary&quot;&gt;<br>        &lt;div class=&quot;panel-heading&quot;&gt;CRUD Example Using PHP OOPS And PostgreSQL&lt;/div&gt;<br>             <br>            &lt;div class=&quot;panel-body&quot;&gt;<br>            &lt;table class=&quot;table table-bordered table-striped&quot;&gt;<br>    &lt;thead&gt;<br>      &lt;tr class=&quot;active&quot;&gt;<br>            &lt;th&gt;Sr. No.&lt;/th&gt;  <br>            &lt;th &gt;Name&lt;/th&gt;       <br>            &lt;th&gt;Email&lt;/th&gt;<br>            &lt;th&gt;Mobile Number&lt;/th&gt;<br>            &lt;th&gt;Address&lt;/th&gt;<br>            &lt;th&gt;Action&lt;/th&gt;<br>      &lt;/tr&gt;<br>    &lt;/thead&gt;<br>    &lt;tbody&gt;<br>    &lt;?php while($user = pg_fetch_object($users)): ?&gt;   <br>      &lt;tr align=&quot;left&quot;&gt;<br>        &lt;td &gt;&lt;?=$sn++?&gt;&lt;/td&gt;<br>        &lt;td&gt;&lt;?= $user-&gt;name ?&gt;&lt;/td&gt;<br>        &lt;td&gt;&lt;?= $user-&gt;email ?&gt;&lt;/td&gt;<br>        &lt;td&gt;&lt;?= $user-&gt;phone ?&gt;&lt;/td&gt;<br>        &lt;td&gt;&lt;?= $user-&gt;address?&gt;&lt;/td&gt;<br>        &lt;td&gt;<br>            &lt;form method=&quot;post&quot;&gt;<br>                &lt;input type=&quot;submit&quot; class=&quot;btn btn-success&quot; name= &quot;update&quot; value=&quot;Update&quot;&gt;   <br>                &lt;input type=&quot;submit&quot; onClick=&quot;return confirm(&#39;Please confirm deletion&#39;);&quot; class=&quot;btn btn-danger&quot; name= &quot;delete&quot; value=&quot;Delete&quot;&gt;<br>                &lt;input type=&quot;hidden&quot; value=&quot;&lt;?=$user-&gt;id?&gt;&quot; name=&quot;id&quot;&gt;<br>            &lt;/form&gt;<br>        &lt;/td&gt;<br>      &lt;/tr&gt;<br>    &lt;?php endwhile; ?&gt;   <br>    &lt;/tbody&gt;<br>  &lt;/table&gt;<br>&lt;/div&gt;<br> <br>&lt;/div&gt;<br>&lt;/div&gt;  <br>&lt;?php include(&#39;footer.php&#39;);?&gt;</pre><p>This <strong>index.php</strong> file contains the HTML code, we can also delete and update a user record from this <strong>index.php </strong>file. Next, we need to create the <strong>header.php</strong>, this is where all the headers of the application will load. Create a header.php file and add the below PHP code.</p><pre>&lt;?php <br>    session_start();<br>    require(&#39;db_class.php&#39;);<br>    $obj = new Db_Class();<br>?&gt;<br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;title&gt;PHP PostgreSQL OOPS CRUD Example&lt;/title&gt;<br>  &lt;meta charset=&quot;utf-8&quot;&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;<br>  &lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css&quot;&gt;<br>  <br>  &lt;style&gt;<br>    /* Remove the navbar&#39;s default margin-bottom and rounded borders */ <br>    .navbar {<br>      margin-bottom: 0;<br>      border-radius: 0;<br>    }<br>    <br>    /* Add a gray background color and some padding to the footer */<br>    footer {<br>      background-color: #f2f2f2;<br>      padding: 25px;<br>    }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br><br>&lt;nav class=&quot;navbar navbar-inverse&quot;&gt;<br>  &lt;div class=&quot;container-fluid&quot;&gt;<br>    &lt;div class=&quot;navbar-header&quot;&gt;<br>      &lt;button type=&quot;button&quot; class=&quot;navbar-toggle&quot; data-toggle=&quot;collapse&quot; data-target=&quot;#myNavbar&quot;&gt;<br>        &lt;span class=&quot;icon-bar&quot;&gt;&lt;/span&gt;<br>        &lt;span class=&quot;icon-bar&quot;&gt;&lt;/span&gt;<br>        &lt;span class=&quot;icon-bar&quot;&gt;&lt;/span&gt;                        <br>      &lt;/button&gt;<br>      &lt;a class=&quot;navbar-brand&quot; href=&quot;#&quot;&gt;PHP4EVER&lt;/a&gt;<br>    &lt;/div&gt;<br>    &lt;div class=&quot;collapse navbar-collapse&quot; id=&quot;myNavbar&quot;&gt;<br>      &lt;ul class=&quot;nav navbar-nav&quot;&gt;<br>        &lt;li class=&quot;active&quot;&gt;&lt;a href=&quot;#&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;        <br>      &lt;/ul&gt;       <br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/nav&gt;</pre><p>we are also going to create a <strong>footer.php </strong>which will contain the code for the footer on the application. Create a <strong>footer.php</strong> file and add the below PHP code.</p><pre>&lt;footer class=&quot;container-fluid text-center&quot;&gt;<br>  &lt;p&gt;PHPFOREVER © &lt;?=date(&#39;Y&#39;)?&gt;&lt;/p&gt;<br>&lt;/footer&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h4>Handling the insertion of data into the database table</h4><p>Create an <strong>insert.php </strong>file and add the below PHP code.</p><pre>&lt;?php <br>include(&#39;header.php&#39;);<br>if(isset($_POST[&#39;submit&#39;]) and !empty($_POST[&#39;submit&#39;])){<br>$ret_val = $obj-&gt;createUser();<br>if($ret_val==1){<br>    echo &#39;&lt;script type=&quot;text/javascript&quot;&gt;&#39;; <br>    echo &#39;alert(&quot;Record Saved Successfully&quot;);&#39;; <br>    echo &#39;window.location.href = &quot;index.php&quot;;&#39;;<br>    echo &#39;&lt;/script&gt;&#39;;<br>}<br>}<br>?&gt;<br>&lt;div class=&quot;container-fluid bg-3 text-center&quot;&gt;    <br>  &lt;h3&gt;CRUD Example Using PHP OOPS And PostgreSQL&lt;/h3&gt;<br>  &lt;a href=&quot;index.php&quot; class=&quot;btn btn-primary pull-right&quot; style=&#39;margin-top:-30px&#39;&gt;&lt;span class=&quot;glyphicon glyphicon-eye-open&quot;&gt;&lt;/span&gt; View Records&lt;/a&gt;<br>  &lt;br&gt;<br>  <br>  &lt;div class=&quot;panel panel-primary&quot;&gt;<br>        &lt;div class=&quot;panel-heading&quot;&gt;CRUD Example Using PHP OOPS And PostgreSQL&lt;/div&gt;<br>            &lt;form class=&quot;form-horizontal&quot; method=&quot;post&quot;&gt;<br>            &lt;div class=&quot;panel-body&quot;&gt;<br>             <br>             &lt;div class=&quot;form-group&quot;&gt;<br>               &lt;label class=&quot;control-label col-sm-2&quot;&gt;Name:&lt;span style=&#39;color:red&#39;&gt;*&lt;/span&gt;&lt;/label&gt;<br>               &lt;div class=&quot;col-sm-5&quot;&gt;<br>                  &lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;name&quot; required&gt;<br>               &lt;/div&gt;<br>            &lt;/div&gt;<br>             &lt;div class=&quot;form-group&quot;&gt;<br>               &lt;label class=&quot;control-label col-sm-2&quot;&gt;Email:&lt;span style=&#39;color:red&#39;&gt;*&lt;/span&gt;&lt;/label&gt;<br>               &lt;div class=&quot;col-sm-5&quot;&gt;<br>                  &lt;input class=&quot;form-control&quot; type=&quot;email&quot; name=&quot;email&quot; required&gt;<br>               &lt;/div&gt;<br>            &lt;/div&gt;<br>            <br>             &lt;div class=&quot;form-group&quot;&gt;<br>               &lt;label class=&quot;control-label col-sm-2&quot;&gt;Mobile Number:&lt;span style=&#39;color:red&#39;&gt;*&lt;/span&gt;&lt;/label&gt;<br>               &lt;div class=&quot;col-sm-5&quot;&gt;<br>                  &lt;input class=&quot;form-control&quot; type=&quot;number&quot; name=&quot;phone&quot; required&gt;<br>               &lt;/div&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;form-group&quot;&gt;<br>               &lt;label class=&quot;control-label col-sm-2&quot;&gt;Address:&lt;span style=&#39;color:red&#39;&gt;*&lt;/span&gt;&lt;/label&gt;<br>               &lt;div class=&quot;col-sm-5&quot;&gt;<br>                  &lt;textarea rows=&quot;5&quot; cols=&quot;5&quot; class=&quot;form-control&quot; name=&quot;address&quot; required&gt;&lt;/textarea&gt;<br>               &lt;/div&gt;<br>            &lt;/div&gt;<br>             &lt;div class=&quot;form-group&quot;&gt;<br>               &lt;label class=&quot;control-label col-sm-2&quot;&gt;  &lt;/label&gt;<br>               &lt;div class=&quot;col-sm-5&quot;&gt;<br>                  &lt;input type=&quot;submit&quot; class=&quot;btn btn-primary&quot; name=&quot;submit&quot;  value=&quot;Submit&quot;&gt;<br>               &lt;/div&gt;<br>            &lt;/div&gt; <br>        &lt;/div&gt;      <br>&lt;/form&gt;<br>&lt;/div&gt;<br>&lt;/div&gt;  <br> &lt;?php include(&#39;footer.php&#39;);?&gt;</pre><p>The <strong>insert.php</strong> file is used to insert data into the PostgreSQL database, it contains HTML code and PHP code, used to submit the data into the PostgreSQL database.</p><h4>Handling the editing and updating of data in the database.</h4><p>Create an <strong>edit.php</strong> file and add the below PHP code.</p><pre>&lt;?php <br>include(&#39;header.php&#39;);<br>$user = $_SESSION[&#39;user&#39;];<br>if(isset($_POST[&#39;update&#39;]) and !empty($_POST[&#39;update&#39;])){<br>$ret_val = $obj-&gt;updateUser();<br>if($ret_val==1){<br>    echo &#39;&lt;script type=&quot;text/javascript&quot;&gt;&#39;; <br>    echo &#39;alert(&quot;Record Updated Successfully&quot;);&#39;; <br>    echo &#39;window.location.href = &quot;index.php&quot;;&#39;;<br>    echo &#39;&lt;/script&gt;&#39;;<br>}<br>}<br>?&gt;<br>&lt;div class=&quot;container-fluid bg-3 text-center&quot;&gt;    <br>  &lt;h3&gt;CRUD Example Using PHP OOPS And PostgreSQL&lt;/h3&gt;<br>  &lt;a href=&quot;index.php&quot; class=&quot;btn btn-primary pull-right&quot; style=&#39;margin-top:-30px&#39;&gt;&lt;span class=&quot;glyphicon glyphicon-step-backward&quot;&gt;&lt;/span&gt;Back&lt;/a&gt;<br>  &lt;br&gt;  <br>  &lt;div class=&quot;panel panel-primary&quot;&gt;<br>        &lt;div class=&quot;panel-heading&quot;&gt;CRUD Example Using PHP OOPS And PostgreSQL&lt;/div&gt;<br>            &lt;form class=&quot;form-horizontal&quot; method=&quot;post&quot;&gt;<br>            &lt;div class=&quot;panel-body&quot;&gt;             <br>             &lt;div class=&quot;form-group&quot;&gt;<br>               &lt;label class=&quot;control-label col-sm-2&quot;&gt;Name:&lt;span style=&#39;color:red&#39;&gt;*&lt;/span&gt;&lt;/label&gt;<br>               &lt;div class=&quot;col-sm-5&quot;&gt;<br>                  &lt;input class=&quot;form-control&quot; value= &quot;&lt;?=$user-&gt;name?&gt;&quot;type=&quot;text&quot; name=&quot;name&quot; required&gt;<br>               &lt;/div&gt;<br>            &lt;/div&gt;<br>             &lt;div class=&quot;form-group&quot;&gt;<br>               &lt;label class=&quot;control-label col-sm-2&quot;&gt;Email:&lt;span style=&#39;color:red&#39;&gt;*&lt;/span&gt;&lt;/label&gt;<br>               &lt;div class=&quot;col-sm-5&quot;&gt;<br>                  &lt;input class=&quot;form-control&quot; value= &quot;&lt;?=$user-&gt;email?&gt;&quot;type=&quot;email&quot; name=&quot;email&quot; required&gt;<br>               &lt;/div&gt;<br>            &lt;/div&gt;            <br>             &lt;div class=&quot;form-group&quot;&gt;<br>               &lt;label class=&quot;control-label col-sm-2&quot;&gt;Mobile Number:&lt;span style=&#39;color:red&#39;&gt;*&lt;/span&gt;&lt;/label&gt;<br>               &lt;div class=&quot;col-sm-5&quot;&gt;<br>                  &lt;input class=&quot;form-control&quot; value= &quot;&lt;?=$user-&gt;mobile_no?&gt;&quot;type=&quot;number&quot; name=&quot;mobileno&quot; required&gt;<br>               &lt;/div&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;form-group&quot;&gt;<br>               &lt;label class=&quot;control-label col-sm-2&quot;&gt;Address:&lt;span style=&#39;color:red&#39;&gt;*&lt;/span&gt;&lt;/label&gt;<br>               &lt;div class=&quot;col-sm-5&quot;&gt;<br>                  &lt;textarea rows=&quot;5&quot; cols=&quot;5&quot; class=&quot;form-control&quot; name=&quot;address&quot; required&gt;&lt;?=$user-&gt;address?&gt;&lt;/textarea&gt;<br>               &lt;/div&gt;<br>               &lt;input type=&quot;hidden&quot; value=&quot;&lt;?=$user-&gt;id?&gt;&quot; name=&quot;id&quot;&gt;<br>            &lt;/div&gt;<br>             &lt;div class=&quot;form-group&quot;&gt;<br>               &lt;label class=&quot;control-label col-sm-2&quot;&gt;  &lt;/label&gt;<br>               &lt;div class=&quot;col-sm-5&quot;&gt;<br>                 &lt;input type=&quot;submit&quot; class=&quot;btn btn-success&quot; name=&quot;update&quot; value=&quot;Update&quot;&gt;                    <br>                &lt;/div&gt;<br>            &lt;/div&gt; <br>        &lt;/div&gt;      <br>&lt;/form&gt;<br>&lt;/div&gt;<br>&lt;/div&gt;  <br> &lt;?php include(&#39;footer.php&#39;);?&gt;</pre><p>The<strong> edit.php </strong>file contains HTML code and PHP code we are going to use the HTML form to update the user record on the database.</p><h4>Conclusion</h4><p>We have come to the end of this article, I hope you understood the basics of how to build an Application with PHP and PostgreSQL. To understand more about how to build an Application with PHP and PostgreSQL, I recommend you search for more tutorials on PHP and PostgreSQL, some of them are available on Youtube.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a5d2b590ea7" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/how-to-build-an-application-with-php-and-postgresql-1a5d2b590ea7">How to build an Application with PHP and PostgreSQL</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EVERYTHING ABOUT CRYPTOCURRENCY, BLOCKCHAIN, AND WEB3]]></title>
            <link>https://medium.com/@officialozioma/everything-about-cryptocurrency-blockchain-and-web3-b8d45e3d4e08?source=rss-6fd1ce4118ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8d45e3d4e08</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Ozioma Dike]]></dc:creator>
            <pubDate>Tue, 07 Dec 2021 22:18:12 GMT</pubDate>
            <atom:updated>2021-12-07T23:02:46.514Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M3iRREvXRJQe3oIY" /><figcaption>Photo by <a href="https://unsplash.com/@launchpresso?utm_source=medium&amp;utm_medium=referral">Launchpresso</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This article tries the explain what blockchain is all about from a beginner&#39;s perspective. This is my understanding of blockchain, cryptocurrency, and web3.</p><p>What is cryptocurrency? well if you are living on the planet and have access to the internet. you must have heard the words crypto, cryptocurrency, for an average person, when you hear the cryptocurrency you think about bitcoin Ethereum and other cryptocurrencies.</p><blockquote>A cryptocurrency is a digital or virtual currency that is secured by cryptography, which makes it nearly impossible to counterfeit or double-spend. Many cryptocurrencies are decentralized networks based on blockchain technology</blockquote><p>Cryptocurrencies are systems that allow for secure payments online which are denominated in terms of virtual “tokens,” which are represented by ledger entries internal to the system. “Crypto” refers to the various encryption algorithms and cryptographic techniques that safeguard these entries, such as elliptical curve encryption, public-private key pairs, and hashing functions.</p><h4>The key things to takeaway</h4><ul><li>A cryptocurrency is a form of digital asset based on a network that is distributed across a large number of computers. This decentralized structure allows them to exist outside the control of governments and central authorities.</li><li>The word “cryptocurrency” is derived from the encryption techniques which are used to secure the network.</li><li>Blockchains, which are organizational methods for ensuring the integrity of transactional data, is an essential component of many cryptocurrencies.</li><li>Many experts believe that blockchain and related technology will disrupt many industries, including finance and law.</li><li>Cryptocurrencies face criticism for a number of reasons, including their use for illegal activities, exchange rate volatility, and vulnerabilities of the infrastructure underlying them. However, they also have been praised for their portability, divisibility, inflation resistance, and transparency.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mHyiQH-xgFJQ0jqh" /><figcaption>Photo by <a href="https://unsplash.com/@executium?utm_source=medium&amp;utm_medium=referral">Executium</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Advantages and Disadvantages of Cryptocurrency</h3><h4>Advantages</h4><p>Cryptocurrencies hold the promise of making it easier to transfer funds directly between two parties, without the need for a trusted third party like a bank or credit card company. These transfers are instead secured by the use of public keys and private keys and different forms of incentive systems, like <a href="https://www.investopedia.com/terms/p/proof-work.asp">Proof of Work</a> or <a href="https://www.investopedia.com/terms/p/proof-stake-pos.asp">Proof of Stake</a>.</p><p>In modern cryptocurrency systems, a user’s “wallet,” or account address, has a public key, while the private key is known only to the owner and is used to sign transactions. Fund transfers are completed with minimal processing fees, allowing users to avoid the steep fees charged by banks and financial institutions for wire transfers.</p><h4>Disadvantages</h4><p>The semi-anonymous nature of cryptocurrency transactions makes them well-suited for a host of illegal activities, such as money laundering and tax evasion. However, cryptocurrency advocates often highly value their anonymity, citing benefits of privacy like protection for whistleblowers or activists living under repressive governments. Some cryptocurrencies are more private than others.</p><p>Bitcoin, for instance, is a relatively poor choice for conducting illegal business online, since the forensic analysis of the Bitcoin blockchain has helped authorities arrest and prosecute criminals. More privacy-oriented coins do exist, however, such as <a href="https://www.investopedia.com/terms/d/dash.asp">Dash</a>, Monero, or <a href="https://www.investopedia.com/terms/z/zcash.asp">ZCash</a>, which are far more difficult to trace.</p><h3>What Is a Blockchain?</h3><p>A blockchain is a distributed database that is shared among the nodes of a computer network. As a database, a blockchain stores information electronically in digital format. Blockchains are best known for their crucial role in cryptocurrency systems, such as Bitcoin, for maintaining a secure and decentralized record of transactions. The innovation with a blockchain is that it guarantees the fidelity and security of a record of data and generates trust without the need for a trusted third party. One key difference between a typical database and a blockchain is how the data is structured. A blockchain collects information together in groups, known as blocks, that hold sets of information. Blocks have certain storage capacities and, when filled, are closed and linked to the previously filled block, forming a chain of data known as the blockchain. All new information that follows that freshly added block is compiled into a newly formed block that will then also be added to the chain once filled. A database usually structures its data into tables, whereas a blockchain, like its name implies, structures its data into chunks (blocks) that are strung together. This data structure inherently makes an irreversible timeline of data when implemented in a decentralized nature. When a block is filled, it is set in stone and becomes a part of this timeline. Each block in the chain is given an exact timestamp when it is added to the chain.</p><h4>The key things to takeaway</h4><ul><li>Blockchain is a type of shared database that differs from a typical database in the way that it stores information; blockchains store data in blocks that are then linked together via cryptography.</li><li>As new data comes in, it is entered into a fresh block. Once the block is filled with data, it is chained onto the previous block, which makes the data chained together in chronological order.</li><li>Different types of information can be stored on a blockchain, but the most common use so far has been as a ledger for transactions.</li><li>In Bitcoin’s case, blockchain is used in a decentralized way so that no single person or group has control — rather, all users collectively retain control.</li><li>Decentralized blockchains are immutable, which means that the data entered is irreversible. For Bitcoin, this means that transactions are permanently recorded and viewable to anyone.</li></ul><h4>How Does a Blockchain Work?</h4><p>The goal of blockchain is to allow digital information to be recorded and distributed, but not edited. In this way, a blockchain is a foundation for immutable ledgers, or records of transactions that cannot be altered, deleted, or destroyed. This is why blockchains are also known as <a href="https://www.investopedia.com/terms/d/distributed-ledger-technology-dlt.asp">distributed ledger technology (DLT)</a>.</p><p>First proposed as a research project in 1991, the blockchain concept predated its first widespread application in use: Bitcoin, in 2009. In the years since, the use of blockchains has exploded via the creation of various cryptocurrencies, <a href="https://www.investopedia.com/decentralized-finance-defi-5113835">decentralized finance (Defi)</a> applications, <a href="https://www.investopedia.com/non-fungible-tokens-nft-5115211">non-fungible tokens (NFTs)</a>, and <a href="https://www.investopedia.com/terms/s/smart-contracts.asp">smart contracts</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*uT5N2BedIkvEv2NoeANUEw.jpeg" /><figcaption>Web 3.0</figcaption></figure><h3>What Is Web3</h3><p>Wait, web3? is there web2 and web1, or web4 and web5, if you are like me that&#39;s so sarcastic and funny guy that is the first question you will ask when you hear it for the first time. well, there is web 3.0, and there is web2 and web1. Ok, so my <strong><em>Hello World program</em></strong> what web is it?</p><p><a href="https://en.wikipedia.org/wiki/Web_1.0">Web 1.0</a> and <a href="https://en.wikipedia.org/wiki/Web_2.0">Web 2.0</a> refer to eras in the history of the Internet as the internet evolved through various technologies and formats. Web 1.0 refers roughly to the period from 1991 to 2004, where the vast majority of Internet users were solely consumers of content. Most websites were static pages that displayed content from the server filesystem rather than a database. Web 2.0 is based around the idea of “the web as platform”. Far more users of the Internet produce content, which they upload to social networking services, blogs, or video or image-sharing websites. Many web pages are dynamic and serve content from relational databases, or are full-featured web applications. Web 2.0 is generally considered to have begun around 2004 and continues to the current day.</p><p>Web3 is distinguished from a concept for a semantic web created in 1999 by <a href="https://en.wikipedia.org/wiki/Tim_Berners-Lee">Tim Berners-Lee</a>, which has also been called “Web 3.0”. Some writers referring to the decentralized concept usually known as “Web3” have used the terminology “Web 3.0”, leading to some confusion between the two concepts; furthermore, some visions of Web3 also incorporate ideas relating to the semantic web.</p><p><strong>What, exactly, is Web3?</strong></p><p>Web3 refers to a potential new iteration of the internet that runs on public blockchains, the record-keeping technology best known for facilitating cryptocurrency transactions. The appeal of Web3 is that it is decentralized so that instead of users accessing the internet through services mediated by the likes of Google, Apple, or Facebook, it’s the individuals themselves who own and control pieces of the internet. Web3 does not require “permission,” meaning that central authorities don’t dictate who uses what services, nor is there a need for “trust,” referring to the idea that an intermediary does not need to facilitate virtual transactions between two or more parties. Web3 theoretically protects user privacy better as well, because it’s these authorities and intermediaries that are doing most of the data collection.</p><p>Of course, this is all an idealized vision of Web3 sketched out by blockchain developers and boosters for the future, so it might not be so egalitarian in practice. One element of Web3 that’s gaining a lot of traction is decentralized finance, also known as <strong>Defi</strong>, which involves conducting IRL financial transactions on the blockchain without assistance from banks or the government. Meanwhile, a number of large companies and venture capital firms are already investing huge sums to build Web3, and it’s hard to imagine that their involvement wouldn’t amount to some kind of centralized power.</p><p><strong>OK, but Web3 is a crypto thing, right?</strong></p><p>NFTs, digital currencies, and other blockchain entities are going to be crucial to Web3. For instance, Reddit is currently making Web3 inroads by trying to devise a way to use cryptocurrency tokens to allow users to essentially own portions of the communities they participate in on the site. The idea would be that users would use tokens known as “community points,” which they earn by posting on a certain subreddit. The user then accrues points based on how many upvotes or downvotes that post gets from other users. (It’s basically Reddit Karma on the blockchain.) Those points can essentially function as voting shares, allowing users who have made valued contributions to have more of a say when it comes to making decisions that will affect the community. Because those points exist on the blockchain, their owners have more control over them; they can’t easily be taken away and they follow you around. To be sure, this is only one use case, a kind of corporate version of a Web3 concept known as Decentralized Autonomous Organizations, or DAOs, which use tokens to make ownership and decision-making powers more equitable. One example of a DAO is Augur, a decentralized betting platform.</p><p>NFTs are also another cornerstone of Web3. They’re essentially one-of-a-kind cryptocurrency tokens; because each of them is unique, they’re typically used as certificates of ownership for virtual objects like artwork or basketball clips. (This is as opposed to a Bitcoin, one of which is interchangeable with any other Bitcoin.) If Web3 boosters are to be believed, the digital scarcity represented by NFTs will allow users of this new internet to exchange everything from video-game skins to medical records.</p><p><strong>Why is there all this Web3 hype all of sudden?</strong></p><p>Much of the excitement seems to be coming from the cryptocurrency community, which would obviously benefit from an internet that’s more reliant on their technology. Some of the buzz also has to do with a few notable companies, including Reddit, making moves to get a head start on developing Web3 services and platforms. In late October, CoinDesk reported that GameStop is trying to hire a “Head of Web3 Gaming” and software engineers for an unannounced NFT platform. There has been a lot of discussion about Web3 could augment video games by, for example, allowing players to more easily buy and sell in-game items or earn tokens that will give them more power to determine how the game is run. However, the Verge also posited that GameStop might just be throwing around terms like “Web3” and “blockchain” in its job descriptions to inspire the same kind of viral support it enjoyed from alternative investors in January. A perhaps more consequential recent development was the venture capital firm Andreessen Horowitz’s Web3 lobbying push in Washington, D.C., in early October. The firm, which has invested heavily in cryptocurrency and other blockchain technologies, said it sent executives to Capitol Hill and the White House to promote Web3 as a solution to Silicon Valley consolidation and to propose regulations for the burgeoning virtual ecosystem.</p><p><strong>The hype around Web3 is entirely measured and reasonable, right?</strong></p><p>In late October, a 28-year-old artist posted a meme entitled, “Love in The Time of Web3,” which features a cartoon couple lying in bed and gazing at the prices of Bitcoin and Ethereum. After billionaire Elon Musk reposted the meme on Twitter and garnered hundreds of thousands of likes, the artist was able to turn the meme into an NFT and sell it for almost $20,000. In other news, there’s a group churning out NFTs attached to cartoon apes that aims to be a “Web3 streetwear band.” One of those cartoon apes recently sold for $3.4 million.</p><h3>Elon Musk on Twitter: &quot;pic.twitter.com/pCO0wNNZtz / Twitter&quot;</h3><p>pic.twitter.com/pCO0wNNZtz</p><p>That&#39;s a brief article about blockchain, cryptocurrency, and web3. I will be writing more on the topic as I progress in learning and understanding blockchain, cryptocurrency, and web3.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8d45e3d4e08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My goals for HNG Internship]]></title>
            <link>https://medium.com/@officialozioma/my-goals-for-hng-internship-e3c1cdd0dc42?source=rss-6fd1ce4118ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3c1cdd0dc42</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[hngi8]]></category>
            <category><![CDATA[internships]]></category>
            <category><![CDATA[php-developers]]></category>
            <dc:creator><![CDATA[Ozioma Dike]]></dc:creator>
            <pubDate>Mon, 16 Aug 2021 23:46:36 GMT</pubDate>
            <atom:updated>2021-08-16T23:52:50.910Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*5vtECt44QzmhTCX8DOoddw.jpeg" /><figcaption>HNG Internship 8</figcaption></figure><p><a href="https://hng.tech/">HNG internship</a> is one of the remote internships that equip developers with the necessary skills to work as remote developers. the internship is so diverse that it includes not only developers but also designers, the current HNG8 includes digital marketers and entrepreneurs, and it&#39;s operated by <a href="https://zuri.team/">Zuri</a>. <a href="https://internship.zuri.team/">https://internship.zuri.team/</a></p><p>Over the years, the HNG internship has expanded not only across Africa but also across the whole world, with countries like India participating in the internship. It&#39;s fair to say that the internship is now a global internship.</p><blockquote>Starting this internship, I have set many goals in mind, including advancing my skills and learning new technology such as GOlang. I also hope to meet and make new friends and expand my network. Like the popular saying <strong><em>your network is your net worth.</em></strong> I hope to build a good solid network and make new friends, from around the world.</blockquote><p>In tech having a great network helps in the advancement of skills and landing a great job. most tech jobs are based on referrals.</p><p>As a back-end developer, I have skills in PHP, which is one of the popular programming languages for the web, I also have work with Laravel and CodeIgniter. PHP as a web language has many frameworks which make the language easy to use, such as Laravel, CodeIgniter, Symfony, CakePHP, Zend, Phalcon, etc. <a href="https://laravel.com/">Laravel</a> is one of the popular PHP frameworks, it makes use of the MVC design pattern.</p><p>To learn more about PHP here is a beginners tutorial from <a href="https://www.youtube.com/channel/UC_UMEcP_kF0z4E6KbxCpV1w">The Codeholic</a> that can help you begin with PHP <a href="https://www.youtube.com/watch?v=yXzWfZ4N4xU">https://www.youtube.com/watch?v=yXzWfZ4N4xU</a></p><p>Skills in Git, is a must-have for a developer, whether front-end or back-end. Git is the most commonly used version control system. Git tracks the changes you make to files, so you have a record of what has been done, and you can revert to specific versions should you ever need to. Git also makes collaboration easier, allowing changes by multiple people to be merged into one source. To learn more about git here is a beginner&#39;s tutorial from <a href="https://www.youtube.com/channel/UCWv7vMbMWH4-V0ZXdmDpPBA">Programming with Mosh</a> that can help you begin with git. <a href="https://www.youtube.com/watch?v=8JJ101D3knE">https://www.youtube.com/watch?v=8JJ101D3knE</a></p><p>Designers use Figma for UI design, which gives the frontend developer a picture of how the app or website will look like. To learn more about Figma here is a beginner&#39;s tutorial from <a href="https://butteracademy.com/figma-tutorial-beginners">butter-academy</a> that can help you as a beginner. <a href="https://www.youtube.com/watch?v=6t_dYhXyYjI">https://www.youtube.com/watch?v=6t_dYhXyYjI</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3c1cdd0dc42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reasons you should be a member of ILGSA]]></title>
            <link>https://medium.com/@officialozioma/reasons-you-should-be-a-member-of-ilgsa-cd548935f11?source=rss-6fd1ce4118ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd548935f11</guid>
            <category><![CDATA[culture]]></category>
            <category><![CDATA[isu]]></category>
            <dc:creator><![CDATA[Ozioma Dike]]></dc:creator>
            <pubDate>Wed, 09 Oct 2019 16:41:46 GMT</pubDate>
            <atom:updated>2019-10-09T16:41:46.401Z</atom:updated>
            <content:encoded><![CDATA[<p>Isu Local government students Association (ILGSA), is an association of students who are from Isu Local Government Area of Imo state. <br> The students from this Local Government Area came together to establish an association for their common good and to experience the goodness and joy of brotherly love. As it motto says Ezi nwanne amaka meaning that brotherhood love is good. <br> <br> Isu Local Government Area, is one of the 27 Local Government Areas in Imo State, Nigeria. The Local Government Comprises of 5 Main autonomous Communities, with over 30 villages. Students in the association came from these 5 communities in Isu Local Government Area. These 5 communities includes AMURIE OMANZE, EKWE, UMUNDUGBA AMANDUGBA and ISUNJABA. Isu Local Government Area has her headquarters at Umundugba.<br> The Isu Local Government Students Association, has chapters which is Located at different campuses in Imo state and beyond, some one these chapters include IMSU CHAPTER, ALVAN CHAPTER, FEDPOLY NEKEDE CHAPTER AND IMOPOLY CHAPTER.<br> The Imsu chapter has Ozioma Dike as her President.<br> <br> The core values of Isu Local Government Students Association is promote Igbo culture and Isu culture, these also include promoting the brotherhood love that exists in Igbo culture.<br> The Association serves as a means of uniting all the students from Isu. Thereby creating an Avenue for solving problems together as a group and as brothers. With the help of some notable Lecturers from Isu Local Government Area, some of the problem students face in school are being solved. Problems includes Missing scripts, sexual harassment, intimidation etc. Also this Association has brought together people who mate each other and got married and are now happy as couples. Students finds the love of their life in this Association.<br> <br> And lastly this association serves a means of learning and understanding the Igbo Language. Some students were born outside Igbo Land, most of these students don’t have the privilege or opportunity to learn the Igbo Language. But with the help our meetings which is been conducted in Igbo Language, these students are able to pick up and understand Igbo language. <br> <br> As a student from the Isu Local Government Area, it is very necessary you join the Association of students from your Local Government Area, so as to experience joy of brotherly love and also to from solutions to different issues and problems you face in school. <br> <br> Written by :<br> Ozioma Dike <br> President ILGSA Imsu chapter</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd548935f11" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>