<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Brian</title>
    <description>The latest articles on Forem by Brian (@yehnda).</description>
    <link>https://forem.com/yehnda</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1080800%2F47edf420-1995-401f-91dc-de9e64924302.jpeg</url>
      <title>Forem: Brian</title>
      <link>https://forem.com/yehnda</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/yehnda"/>
    <language>en</language>
    <item>
      <title>How to Deploy a Laravel App on Shared Hosting (The Right Way)</title>
      <dc:creator>Brian</dc:creator>
      <pubDate>Wed, 07 May 2025 12:46:38 +0000</pubDate>
      <link>https://forem.com/yehnda/how-to-deploy-a-laravel-app-on-shared-hosting-the-right-way-iif</link>
      <guid>https://forem.com/yehnda/how-to-deploy-a-laravel-app-on-shared-hosting-the-right-way-iif</guid>
      <description>&lt;p&gt;Not every project needs a VPS or cloud infrastructure. If you're working with a tight budget or launching a side project, &lt;strong&gt;shared hosting&lt;/strong&gt; might be your go-to.&lt;/p&gt;

&lt;p&gt;But deploying a Laravel app on shared hosting isn’t as straightforward as uploading files — it requires a few tweaks. In this guide, I’ll walk you through how to deploy Laravel properly on a cPanel-style shared hosting environment.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧰 What You’ll Need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A Laravel project (locally tested)&lt;/li&gt;
&lt;li&gt;Access to shared hosting (cPanel-based)&lt;/li&gt;
&lt;li&gt;PHP 8.1+ on the server&lt;/li&gt;
&lt;li&gt;Database (MySQL)&lt;/li&gt;
&lt;li&gt;FTP or File Manager access&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📁 Step 1: Prepare Laravel for Production
&lt;/h2&gt;

&lt;p&gt;Before uploading anything, clean and prep your Laravel project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Update environment config in &lt;code&gt;.env.production&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   APP_ENV=production
   APP_DEBUG=false
   APP_URL=https://yourdomain.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run the following commands locally:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
   php artisan config:cache&lt;br&gt;
   php artisan route:cache&lt;br&gt;
   php artisan view:cache&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Zip everything &lt;em&gt;except&lt;/em&gt; &lt;code&gt;node_modules&lt;/code&gt; and &lt;code&gt;.git&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  📦 Step 2: Upload Files to the Server
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your hosting panel.&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;File Manager&lt;/strong&gt; and go to the root of your site (usually &lt;code&gt;public_html&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Upload your zipped Laravel project.&lt;/li&gt;
&lt;li&gt;Extract it there — it will create a folder like &lt;code&gt;laravel-app&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🔁 Step 3: Point &lt;code&gt;public/&lt;/code&gt; to the Root
&lt;/h2&gt;

&lt;p&gt;Laravel’s entry point is &lt;code&gt;public/index.php&lt;/code&gt;, but shared hosting expects everything in &lt;code&gt;public_html&lt;/code&gt;. Two options:&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Option 1: Move Files (Recommended)
&lt;/h3&gt;

&lt;p&gt;Move everything from &lt;code&gt;laravel-app/public/&lt;/code&gt; into &lt;code&gt;public_html/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then edit &lt;code&gt;index.php&lt;/code&gt; in &lt;code&gt;public_html&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;php&lt;br&gt;
require __DIR__.'/../vendor/autoload.php';&lt;br&gt;
$app = require_once __DIR__.'/../bootstrap/app.php';&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;➡ Change paths to:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;php&lt;br&gt;
require __DIR__.'/../laravel-app/vendor/autoload.php';&lt;br&gt;
$app = require_once __DIR__.'/../laravel-app/bootstrap/app.php';&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚠️ Option 2: Use .htaccess Rewrite
&lt;/h3&gt;

&lt;p&gt;(Not ideal. Option 1 is more stable and secure.)&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Step 4: Set Permissions
&lt;/h2&gt;

&lt;p&gt;Ensure proper permissions:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
chmod -R 755 storage&lt;br&gt;
chmod -R 755 bootstrap/cache&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Some hosts allow this via the file manager. Others might need support help.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛢️ Step 5: Configure the Database
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;In cPanel, create a new MySQL database and user.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Grant the user full access to the DB.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In your &lt;code&gt;.env&lt;/code&gt; file (on the server), update the following:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;env&lt;br&gt;
   DB_CONNECTION=mysql&lt;br&gt;
   DB_HOST=localhost&lt;br&gt;
   DB_PORT=3306&lt;br&gt;
   DB_DATABASE=your_db&lt;br&gt;
   DB_USERNAME=your_user&lt;br&gt;
   DB_PASSWORD=your_password&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Then run migrations by visiting:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
   https://yourdomain.com/artisan/migrate&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Or trigger it using a route/controller if CLI is unavailable.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧪 Step 6: Test Everything
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Visit &lt;code&gt;https://yourdomain.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Make sure routes, DB, and views load&lt;/li&gt;
&lt;li&gt;Check for permission issues in logs (&lt;code&gt;storage/logs&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Bonus Tips
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;php artisan storage:link&lt;/code&gt; manually by creating a symlink via cPanel Terminal&lt;/li&gt;
&lt;li&gt;Use a custom &lt;code&gt;.htaccess&lt;/code&gt; to force HTTPS and pretty URLs&lt;/li&gt;
&lt;li&gt;Don’t upload &lt;code&gt;.env&lt;/code&gt; locally — create it on the server from &lt;code&gt;.env.production&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ✅ Conclusion
&lt;/h2&gt;

&lt;p&gt;Deploying Laravel on shared hosting isn’t as elegant as with tools like Forge or Amezmo, but it’s absolutely doable. With some tweaks and careful file organization, you can make it work reliably.&lt;/p&gt;




</description>
      <category>laravel</category>
      <category>php</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>A Beginner's Guide to Deploying PHP Apps with Amezmo</title>
      <dc:creator>Brian</dc:creator>
      <pubDate>Wed, 07 May 2025 12:41:38 +0000</pubDate>
      <link>https://forem.com/yehnda/a-beginners-guide-to-deploying-php-apps-with-amezmo-4klg</link>
      <guid>https://forem.com/yehnda/a-beginners-guide-to-deploying-php-apps-with-amezmo-4klg</guid>
      <description>&lt;p&gt;If you're tired of complex deployment pipelines and fiddly VPS setups, &lt;strong&gt;Amezmo&lt;/strong&gt; might be exactly what you need. It's a fully managed PHP hosting platform designed specifically for modern PHP apps like Laravel, Slim, and vanilla PHP.&lt;/p&gt;

&lt;p&gt;In this beginner-friendly guide, we'll walk through how to deploy a PHP application on Amezmo in just a few minutes — &lt;strong&gt;no DevOps background required&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧰 Why Use Amezmo?
&lt;/h2&gt;

&lt;p&gt;Before we jump into the steps, here’s why Amezmo is worth considering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⚡ &lt;strong&gt;Instant deployments via Git&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🔒 &lt;strong&gt;Free SSL and daily backups&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🐘 &lt;strong&gt;PHP 8.x support out of the box&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🪄 &lt;strong&gt;Composer, queues, and crons built-in&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🔥 &lt;strong&gt;No server maintenance required&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s built for PHP, and that makes it super streamlined compared to general-purpose providers.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Step 1: Sign Up and Create an App
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Head to &lt;a href="https://www.amezmo.com" rel="noopener noreferrer"&gt;amezmo.com&lt;/a&gt; and sign up.&lt;/li&gt;
&lt;li&gt;Once inside your dashboard, click &lt;strong&gt;"New App"&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Choose:

&lt;ul&gt;
&lt;li&gt;A name for your app&lt;/li&gt;
&lt;li&gt;Your Git provider (GitHub, GitLab, Bitbucket)&lt;/li&gt;
&lt;li&gt;The branch to deploy&lt;/li&gt;
&lt;li&gt;PHP version (e.g., PHP 8.2)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create App&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Amezmo will spin up an isolated environment for your app — no server provisioning required!&lt;/p&gt;




&lt;h2&gt;
  
  
  🔧 Step 2: Configure Environment Settings
&lt;/h2&gt;

&lt;p&gt;Head to the &lt;strong&gt;Environment&lt;/strong&gt; tab for your app:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add &lt;code&gt;.env&lt;/code&gt; variables (just like Laravel or other frameworks)&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;SSL&lt;/strong&gt; for HTTPS (free via Let's Encrypt)&lt;/li&gt;
&lt;li&gt;Choose a &lt;strong&gt;document root&lt;/strong&gt; — for Laravel, it's usually &lt;code&gt;/public&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click &lt;strong&gt;Save&lt;/strong&gt; after you configure your environment.&lt;/p&gt;




&lt;h2&gt;
  
  
  📦 Step 3: Deploy Your Code
&lt;/h2&gt;

&lt;p&gt;Amezmo uses Git to deploy your app. It can pull directly from your Git repo.&lt;/p&gt;

&lt;p&gt;To deploy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Either manually trigger a deploy from the dashboard
&lt;em&gt;or&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Push to the branch you connected during app creation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Amezmo will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clone the repo
&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;composer install&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Deploy the app
&lt;/li&gt;
&lt;li&gt;Reload your web process&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s that simple.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ Step 4: Set Up Queues, Crons, and Background Tasks
&lt;/h2&gt;

&lt;p&gt;Laravel users — you're in luck.&lt;/p&gt;

&lt;p&gt;Under the &lt;strong&gt;Workers&lt;/strong&gt; section, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add a &lt;code&gt;php artisan queue:work&lt;/code&gt; process&lt;/li&gt;
&lt;li&gt;Schedule &lt;code&gt;artisan schedule:run&lt;/code&gt; in the &lt;strong&gt;Crons&lt;/strong&gt; tab (every minute)&lt;/li&gt;
&lt;li&gt;Run any long-running command you need&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No need to SSH in or configure Supervisor manually.&lt;/p&gt;




&lt;h2&gt;
  
  
  📁 Step 5: Manage Storage and Backups
&lt;/h2&gt;

&lt;p&gt;Amezmo gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Persistent &lt;code&gt;/storage&lt;/code&gt; directory
&lt;/li&gt;
&lt;li&gt;Daily automatic backups of code and DB
&lt;/li&gt;
&lt;li&gt;One-click restore in case of failure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Laravel apps, storage is already pre-configured. Just run:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
bash
php artisan storage:link
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>php</category>
      <category>deployment</category>
      <category>laravel</category>
      <category>webdev</category>
    </item>
    <item>
      <title>🛠️ How to Deploy a Laravel App with Zero Downtime Using Git Hooks</title>
      <dc:creator>Brian</dc:creator>
      <pubDate>Wed, 07 May 2025 12:35:52 +0000</pubDate>
      <link>https://forem.com/yehnda/how-to-deploy-a-laravel-app-with-zero-downtime-using-git-hooks-3lj6</link>
      <guid>https://forem.com/yehnda/how-to-deploy-a-laravel-app-with-zero-downtime-using-git-hooks-3lj6</guid>
      <description>&lt;p&gt;Deploying a Laravel application can be as simple or as sophisticated as you want it to be. If you're working on a small project or don't want the overhead of CI/CD tools, Git hooks provide a lightweight way to automate your deployment — with minimal downtime.&lt;/p&gt;

&lt;p&gt;In this tutorial, we’ll walk through setting up a zero-downtime Git-based deployment flow for your Laravel app using a post-receive hook.&lt;/p&gt;

&lt;p&gt;🔍 What You'll Need&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A server (e.g., Ubuntu-based VPS or cloud instance)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SSH access&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Git installed on both local and server&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A Laravel project under version control&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Basic Linux terminal skills&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Prepare the Server
&lt;/h2&gt;

&lt;p&gt;First, SSH into your server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh user@your-server-ip

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

&lt;/div&gt;



&lt;p&gt;Install the required packages (if you haven’t already):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install git unzip php-cli php-mbstring php-xml php-bcmath php-curl composer -y

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

&lt;/div&gt;



&lt;p&gt;Create a directory where your Laravel app will live:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p /var/www/myapp
cd /var/www/myapp

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Initialize a Bare Git Repository
&lt;/h2&gt;

&lt;p&gt;Create a bare Git repository to receive code from your local machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p /home/deploy/myapp.git
cd /home/deploy/myapp.git
git init --bare

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

&lt;/div&gt;



&lt;p&gt;This bare repo is where your code will be pushed — it won’t contain a working tree (no real files), just Git metadata.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Create the post-receive Hook
&lt;/h2&gt;

&lt;p&gt;Inside your bare repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /home/deploy/myapp.git/hooks
nano post-receive

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

&lt;/div&gt;



&lt;p&gt;Paste this script into post-receive:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

GIT_WORK_TREE=/var/www/myapp git checkout -f

cd /var/www/myapp

# Install PHP dependencies
composer install --no-interaction --prefer-dist --optimize-autoloader

# Set permissions
chown -R www-data:www-data /var/www/myapp
chmod -R 775 /var/www/myapp/storage

# Laravel setup
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan view:cache

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

&lt;/div&gt;



&lt;p&gt;Make the hook executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod +x post-receive

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4: Add the Server as a Git Remote on Your Local Machine
&lt;/h2&gt;

&lt;p&gt;Back on your local machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add production ssh://user@your-server-ip:/home/deploy/myapp.git

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

&lt;/div&gt;



&lt;p&gt;To push your code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push production main

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

&lt;/div&gt;



&lt;p&gt;This will trigger the post-receive hook and deploy the latest version of your app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Optional: Zero Downtime with Atomic Deployment
&lt;/h2&gt;

&lt;p&gt;If you want true zero downtime, add atomic deploys using a symlinked current directory:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Push to a timestamped release folder like /var/www/releases/20250507120000&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After deployment, update a symlink: ln -sfn /var/www/releases/20250507120000 /var/www/myapp&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your web server always points to /var/www/myapp, which stays live&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can extend the post-receive hook to automate this entire process.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔐 Bonus Tips for Production
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Use .env.production and symlink it after each deploy&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set up a queue worker supervisor (e.g., with supervisord or systemd)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Monitor logs via journalctl or Laravel's /storage/logs/laravel.log&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Git hooks offer a powerful, low-cost deployment solution — perfect for solo developers, MVPs, or side projects. With a little scripting and Laravel tooling, you can automate everything and deploy confidently with minimal or no downtime.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Getting started with Laravel</title>
      <dc:creator>Brian</dc:creator>
      <pubDate>Fri, 12 Jul 2024 21:09:10 +0000</pubDate>
      <link>https://forem.com/yehnda/getting-started-with-laravel-bca</link>
      <guid>https://forem.com/yehnda/getting-started-with-laravel-bca</guid>
      <description>&lt;p&gt;&lt;strong&gt;How to create a Laravel Project&lt;/strong&gt;&lt;br&gt;
For beginners who would like to get started with Laravel, i'll provide the most crucial snippets of code that you will encounter in this amazing framework&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;PHP: Laravel requires PHP 8.0 or later.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Composer: This is a dependency manager for PHP&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Web server: Apache, Nginx, or Laravel's built-in-server &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Start your XAMPP web server since this will be required for the database&lt;/p&gt;

&lt;p&gt;Creatae a new project using composer directly. Replace project-name with the desired name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer create-project --prefer-dist laravel/laravel project-name


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

&lt;/div&gt;



&lt;p&gt;cd project-name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd project-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Serve the Application&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will start the development server at '&lt;a href="http://localhost:8000" rel="noopener noreferrer"&gt;http://localhost:8000&lt;/a&gt;'.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configure your environemnt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Laravel uses a &lt;strong&gt;'.env&lt;/strong&gt; file for environmental configuaration. Open the &lt;strong&gt;'.env'&lt;/strong&gt; file in the root of your project and configure your database and other settings&lt;/p&gt;

&lt;p&gt;As for the latest installation it comes with sqlite by default but i prefer using mysql so we are going to change that&lt;/p&gt;

&lt;p&gt;This is what it looks like by default&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;change it to, make sure to uncomment the commented parts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel-dev-database
DB_USERNAME=root
DB_PASSWORD=


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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Run migrations&lt;/strong&gt;&lt;br&gt;
Laravel uses migrations to create database tables. Run the migration  with&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Laravel uses MVC (Model, View, Controller) Architecture&lt;/strong&gt;&lt;br&gt;
We are going to discuss this in a moment&lt;/p&gt;

&lt;p&gt;Congratulations, you have successfully created your first Laravel application. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Insert data in to MYSQL database using PHP</title>
      <dc:creator>Brian</dc:creator>
      <pubDate>Mon, 20 Nov 2023 23:23:21 +0000</pubDate>
      <link>https://forem.com/yehnda/insert-data-in-to-mysql-database-using-php-4n3</link>
      <guid>https://forem.com/yehnda/insert-data-in-to-mysql-database-using-php-4n3</guid>
      <description>&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;XAMPP/LAMPP Server&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;2.Editor( VS code/ Sublime text)&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1
&lt;/h2&gt;

&lt;p&gt;Navigate to the htdocs folder and create folder named student, create an &lt;em&gt;index.php&lt;/em&gt; in the student folder, &lt;/p&gt;

&lt;p&gt;paste the code below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;User Details Form&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;h2&amp;gt;User Details Form&amp;lt;/h2&amp;gt;

&amp;lt;form action="process_form.php" method="post"&amp;gt;
    &amp;lt;label for="name"&amp;gt;Name:&amp;lt;/label&amp;gt;
    &amp;lt;input type="text" id="name" name="name" required&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;

    &amp;lt;label for="email"&amp;gt;Email:&amp;lt;/label&amp;gt;
    &amp;lt;input type="email" id="email" name="email" required&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;

    &amp;lt;label for="course"&amp;gt;Course:&amp;lt;/label&amp;gt;
    &amp;lt;input type="text" id="course" name="course" required&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;

    &amp;lt;input type="submit" value="Submit"&amp;gt;
&amp;lt;/form&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create a new file &lt;em&gt;process_form.php&lt;/em&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Retrieve user input from the form
    $name = $_POST["name"];
    $email = $_POST["email"];
    $course = $_POST["course"];

    // Database connection details
    $hostname = "localhost";
    $username = "root";
    $password = "";
    $database = "tech_art";

    // Create a database connection
    $conn = new mysqli($hostname, $username, $password, $database);

    // Check the connection
    if ($conn-&amp;gt;connect_error) {
        die("Connection failed: " . $conn-&amp;gt;connect_error);
    }

    // Prepare and execute the SQL query to insert data into the database
    $sql = "INSERT INTO user_details (name, email, course) VALUES (?, ?, ?)";
    $stmt = $conn-&amp;gt;prepare($sql);
    $stmt-&amp;gt;bind_param("sss", $name, $email, $course);

    if ($stmt-&amp;gt;execute()) {
        echo "&amp;lt;h2&amp;gt;Data saved successfully!&amp;lt;/h2&amp;gt;";
    } else {
        echo "&amp;lt;h2&amp;gt;Error: " . $stmt-&amp;gt;error . "&amp;lt;/h2&amp;gt;";
    }

    // Close the statement and connection
    $stmt-&amp;gt;close();
    $conn-&amp;gt;close();
}
?&amp;gt;


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

&lt;/div&gt;



&lt;h2&gt;
  
  
  NB:Change the database details accordingly
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Create the database and tables
&lt;/h2&gt;

&lt;p&gt;Navigate to access the admin section that manages databases in Mysql&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost/phpmyadmin/index.php"&gt;http://localhost/phpmyadmin/index.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a database named tech_art,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5P55Czmt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/50zfytihnigcfx7xhgg6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5P55Czmt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/50zfytihnigcfx7xhgg6.png" alt="Create a database" width="800" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We'' use queries to create our table&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NQqxs00p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ymevz4dk6jqr34sazd77.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NQqxs00p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ymevz4dk6jqr34sazd77.png" alt="Create a query" width="800" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Paste the following query and run to create the table&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
CREATE TABLE user_details (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    email VARCHAR(255) NOT NULL,
    course VARCHAR(255) NOT NULL
);


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

&lt;/div&gt;



&lt;p&gt;This will create the table that will be used to store the details needed&lt;/p&gt;

&lt;p&gt;Navigate to your browser and paste the following link&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost/student/"&gt;http://localhost/student/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Input the details and taraaa you have saved the details in the database!&lt;/p&gt;

&lt;p&gt;Hope you had fun,incase of any question please reach out.&lt;/p&gt;

</description>
      <category>php</category>
      <category>database</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
