<?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: Daniel Mabadeje</title>
    <description>The latest articles on Forem by Daniel Mabadeje (@danielmabadeje).</description>
    <link>https://forem.com/danielmabadeje</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%2F507245%2Fec4bd258-a00f-455c-8c3b-33da45b0aca5.jpeg</url>
      <title>Forem: Daniel Mabadeje</title>
      <link>https://forem.com/danielmabadeje</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/danielmabadeje"/>
    <language>en</language>
    <item>
      <title>Automating Laravel CI/CD with GitHub Actions on Namecheap</title>
      <dc:creator>Daniel Mabadeje</dc:creator>
      <pubDate>Tue, 23 Apr 2024 10:18:50 +0000</pubDate>
      <link>https://forem.com/danielmabadeje/automating-laravel-cicd-with-github-actions-on-namecheap-46aa</link>
      <guid>https://forem.com/danielmabadeje/automating-laravel-cicd-with-github-actions-on-namecheap-46aa</guid>
      <description>&lt;p&gt;&lt;strong&gt;Who is this article for?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Have you had some struggles hosting your Laravel application on namecheap? Or you have been looking for a way to automate your deployments to your namecheap server? This article is for you.&lt;/p&gt;

&lt;p&gt;Lets talk about Github actions a bit🙂&lt;/p&gt;

&lt;p&gt;GitHub Actions is a powerful tool for automating various workflows and tasks within the GitHub ecosystem. Here are some of the key benefits of using GitHub Actions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Continuous Integration and Deployment (CI/CD): GitHub Actions enables you to set up automated CI/CD pipelines, allowing you to build, test, and deploy your applications with ease. You can define custom workflows that trigger actions based on events like pushes, pull requests, or scheduled intervals. (This is what we will be focusing in this article)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Flexibility and Customization: GitHub Actions provides a flexible and customizable platform where you can define workflows using YAML syntax. You have granular control over the steps, dependencies, and conditions of your actions, allowing you to create tailored workflows that fit your specific needs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Seamless Integration with GitHub: Since GitHub Actions is tightly integrated with the GitHub platform, it offers seamless integration with your repositories, issues, pull requests, and other GitHub features. You can leverage this integration to create workflows that interact with your repository, update issues, trigger notifications, and more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scalability: GitHub Actions is designed to scale with your needs. You can run workflows on different types of virtual machines and specify resource allocation for each job. Additionally, parallel and matrix strategies allow you to distribute workloads across multiple machines, enabling faster execution times.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cross-Platform Support: GitHub Actions supports a wide range of platforms and operating systems, including Linux, macOS, and Windows. You can test your applications across different environments, ensuring compatibility and reliability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cost-Efficient: GitHub Actions provides a generous amount of free usage every month, allowing you to automate your workflows without incurring additional costs. If you require more resources or have high-demand workflows, you can choose from various pricing options that align with your needs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Vast Ecosystem and Community Support: GitHub Actions has a large ecosystem of pre-built actions that you can use to perform common tasks. These actions, created by both GitHub and the community, cover a wide range of functionalities, from building and testing applications to deploying to various platforms. You can also create and share your own actions with others.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With all these mentioned, It is safe to say that Github actions is the real IDAN (magic but colloquially means boss.)😂&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So How Do I Setup this Github Actions?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So first of all lets head to our cpanel, you shouls see something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7lkunose6r041momflnz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7lkunose6r041momflnz.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This particular step here should be followed if you want to deploy to a sub domain. If you want to deploy to the main domain itself, you may skip this step&lt;/p&gt;

&lt;p&gt;Click on Subdomains&lt;/p&gt;

&lt;p&gt;Fill in the details for your sub domain and click on create. &lt;br&gt;
This would automatically create the subdomain and also create the document root.&lt;/p&gt;

&lt;p&gt;Sidenote: I prefer to use the subdomain I created as the actual document root. So I can have my subdomain field as danielsub, my document root would be danielsub.myazabox.site.&lt;br&gt;
After we have successfully created the sub domain, we create an FTP account&lt;/p&gt;

&lt;p&gt;What is an FTP Account?🤔&lt;br&gt;
According to Techopedia, A file transfer protocol account (FTP account) is a type of user account that enables the transfer of files with a host computer by using FTP services.&lt;br&gt;
So basically we are creating an account to facilitate file transfer to a server.&lt;/p&gt;

&lt;p&gt;On your CPanel, Navigate to the files section as shown in the image&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2For9tgx9ofmtaimhtqn76.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2For9tgx9ofmtaimhtqn76.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on FTP Accounts. At this point you should have something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6smll4z3iekvmnkw0ion.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6smll4z3iekvmnkw0ion.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Put in your desired login details and ensure you stored those details properly in maybe your notes or somewhere safe (you would need them). Also select domain you want to assign the ftp account to. In this case it would be the subdomain that we created recently.&lt;/p&gt;

&lt;p&gt;When you are done, you can click on the "Create FTP Account" button.&lt;/p&gt;

&lt;p&gt;If you look below, you should see a new ftp account created as shown below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fadhjm331xp7h3lbozob5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fadhjm331xp7h3lbozob5.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;to view your ftp details like Username, server details and in some cases Port. click on "Configure FTP Client"&lt;br&gt;
Now we are done with CPANEL, lets move over to github and perform this magic.&lt;/p&gt;

&lt;p&gt;At this point I believe you already have your Laravel project pushed to Github. If this has not been done, ensure you have pushed your laravel project to your repository. (This deployment procedure works for both personal and organisation account).&lt;/p&gt;

&lt;p&gt;So for the purpose of this article, I will use a laravel application that I have pushed long ago.&lt;br&gt;
Navigate to the repository that houses your laravel project, and click on the actions tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5v756fmymfgzjfnufqx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5v756fmymfgzjfnufqx.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on "setup new workflow for yourself -&amp;gt; "&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftwxdcxrwh7p10exqhonq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftwxdcxrwh7p10exqhonq.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This would create a .yml file for you to work with (mostly a main.yml file)&lt;/p&gt;

&lt;p&gt;Copy the code below and paste it in your main.yml&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

name: Deploy Laravel Project on push
on:
  push:
    branches:
      - main
jobs:
  web-deploy:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
      - name: Get the latest code
        uses: actions/checkout@v2.3.2
      - uses: actions/setup-node@master
      - name: Copy .env
        run: php -r "file_exists('.env') || copy('.env.example', '.env');"
      - name: Install Dependencies
        run: composer update --ignore-platform-reqs
      - name: Generate key
        run: php artisan key:generate
      - name: Generate storage link
        run: php artisan storage:link
      - name: Directory Permissions
        run: chmod -R 777 storage bootstrap/cache
      - name: 📂 Sync files
        uses: SamKirkland/FTP-Deploy-Action@v4.3.4
        with:
          server: ${{ secrets.YOURSITE_FTP_SERVER}}
          username: ${{ secrets.USERNAME }}
          password: ${{ secrets.YOUR_PASSWORD }}


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

&lt;/div&gt;

&lt;p&gt;You can use the code above in your main.yml or you could go to Samkirkland to view other use cases to deploy your application with Github actions. Note that it is best practice to create secret keys rather than hard coding the values.&lt;/p&gt;

&lt;p&gt;The code above basically checks if there is a new push to the branch you specified. (In this case the main branch). Runs a composer update, generates a key with the laravel commands and also links the storage.&lt;/p&gt;

&lt;p&gt;After this is done, it uploads the files to the document directory in your CPanel. Do not forget to change the username, ftp and password field to their respective values which you saved earlier on. To take it a notch higher, you can store them as SECRETS on github.&lt;/p&gt;

&lt;p&gt;It is Important to note that your first deployment may take a long time to sync its files as it copies the newly created vendor folder (which houses a lot of files).&lt;br&gt;
One more thing, If you are using an Apache server, there may be need to create a .htaccess in your root directory. After the .htaccess file creation, add the following code.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

# RewriteEngine on

# # serve existing files in the /public folder as if they were in /
# RewriteCond %{DOCUMENT_ROOT}public%{REQUEST_URI} -f
# RewriteRule (.+) /public/$1 [L]

# # route everything else to /public/index.php
# RewriteRule ^ /public/index.php [L]

# DirectoryIndex index.php
&amp;lt;IfModule mod_rewrite.c&amp;gt;

    RewriteEngine On
    # RewriteBase /public_html/

    RewriteRule ^$ public/index.php [L]

    RewriteRule ^((?!public/).*)$ public/$1 [L,NC]

&amp;lt;/IfModule&amp;gt;


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

&lt;/div&gt;

&lt;p&gt;And Voila!!!🎉🎉🎉🎉🎉&lt;br&gt;
You have successfully deployed a laravel application to your cpanel through github actions.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Follow me on twitter : &lt;a href="https://twitter.com/mabadejedanphp" rel="noopener noreferrer"&gt;https://twitter.com/mabadejedanphp&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>cicd</category>
      <category>github</category>
    </item>
    <item>
      <title>How to Preview Laravel Notification Emails</title>
      <dc:creator>Daniel Mabadeje</dc:creator>
      <pubDate>Tue, 23 Apr 2024 10:13:22 +0000</pubDate>
      <link>https://forem.com/danielmabadeje/how-to-preview-laravel-notification-emails-3f61</link>
      <guid>https://forem.com/danielmabadeje/how-to-preview-laravel-notification-emails-3f61</guid>
      <description>&lt;p&gt;It’s a hassle trying to test your the HTML of your notification class by sending multiple requests to trigger the Notification to your mail. Do you want to preview your emails in the browser and see what they would look like in the recepients mailbox without having to go through the hassles of sending multiple requests to trigger the notifications? Here are a few lines of codes that can help you with that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9odkba8gydmdde56mpzl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9odkba8gydmdde56mpzl.png" alt="Image of laravel notifciation" width="800" height="635"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Snippet below shows how you can preview your notifications with your web routes. I am assuming you have created a Notification called TemplateNotification (for this example) or you replaced TemplateNotification with your custom class name. In the example below, my notification class did not require any parameters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get(‘mailable’, function () {
  return (new App\Notifications\TemplateNotification())-&amp;gt;toMail((object) [])-&amp;gt;render();
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s try this with a class that requires a parameter let’s say the UserRegisteredNotification class that requires the User Object. The code would look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('mailable', function () {
    $user = App\Models\User::inRandomOrder()-&amp;gt;first();
    return (new App\Notifications\UserRegisteredNotification($user))-&amp;gt;toMail((object) [])-&amp;gt;render();    

});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you observed in the examples above, you would see that I typecasted an empty array as an object to the toMail method. This is because the toMail method is expecting an object as a parameter.&lt;br&gt;
I hope this helps&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Follow me on twitter : &lt;a href="https://twitter.com/mabadejedanphp"&gt;https://twitter.com/mabadejedanphp&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>beginners</category>
      <category>notifications</category>
    </item>
    <item>
      <title>How to create tables on Heroku Postgresql</title>
      <dc:creator>Daniel Mabadeje</dc:creator>
      <pubDate>Wed, 03 Mar 2021 20:38:39 +0000</pubDate>
      <link>https://forem.com/danielmabadeje/how-to-create-tables-on-heroku-postgresql-1n42</link>
      <guid>https://forem.com/danielmabadeje/how-to-create-tables-on-heroku-postgresql-1n42</guid>
      <description>&lt;p&gt;So you want to deploy this your idea or project for demo on heroku. Probably, you are deploying from Github, then it’s time for you to migrate or create postgres databases and tables, but then you get confused especially when it’s not a laravel application where you can use the console to migrate tables. so you check the documentation and you get even more confused. this article is for you.&lt;br&gt;
I encountered this some time ago and I felt bad so I decided to do an article on this.&lt;br&gt;
Here we are going to cover everything concerning database and table creation starting from :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Adding heroku-postgres as an add-on&lt;/li&gt;
&lt;li&gt;Attaching it as a database&lt;/li&gt;
&lt;li&gt;Getting configuration&lt;/li&gt;
&lt;li&gt;Creating table using dataclips&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this article I believe you have a heroku account and you have add your project there so we move over to adding heroku-postgres as an add-on&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding Heroku-Postgres as an add-on
&lt;/h2&gt;

&lt;p&gt;On the tabs menu you will see the resources link, when clicked should take you to something like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dashboard.heroku.com/apps/%7Byour_app%7D/resources" rel="noopener noreferrer"&gt;https://dashboard.heroku.com/apps/{your_app}/resources&lt;/a&gt;&lt;br&gt;
you will see something like this..&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw7h5le44av8nz5wloxj0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw7h5le44av8nz5wloxj0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
so click on find more add-ons and search for Heroku postgres you will see this&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F688s0qz6gxzf4fghtp9d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F688s0qz6gxzf4fghtp9d.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
click on heroku postgres which will take you to this page..&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwoiidhvt528chx9bn36b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwoiidhvt528chx9bn36b.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
click on install heroku postgres and add it to your project.&lt;br&gt;
now we move over to attaching it as a database&lt;/p&gt;

&lt;h2&gt;
  
  
  Attaching as a Database
&lt;/h2&gt;

&lt;p&gt;if you check your resources page you will see that heroku-postgres has been installed and you will see a button that says Attach As Database, click on it which will give you your configuration details. Once this is done, check your settings page and click reveal config var you will a url added there. It contains your database name, password, database host, database name. those are the credentials you add to your app to connect to database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Tables Using Dataclips
&lt;/h2&gt;

&lt;p&gt;If you want to know about dataclips you could check &lt;a href="https://devcenter.heroku.com/articles/dataclips" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
So “Heroku Dataclips enable you to create SQL queries for your Heroku Postgres databases and share the results with colleagues, third-party tools, and the public” — heroku.&lt;br&gt;
so see them as saved queries or as endpoints or as shortcodes (for wordpress people) where you write your SQL queries and they are saved and can be ran.&lt;br&gt;
So we going to use this to create a users table with a dataclip&lt;br&gt;
Note: Datclips by default allow users to read only i.e you can write queries to select data from database but you can’t manipulate it.&lt;br&gt;
for you to alter this setting, you need to write this&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

set transaction read write; 


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

&lt;/div&gt;

&lt;p&gt;before writing your queries.&lt;br&gt;
Now back to creating our table.&lt;br&gt;
so when we select new dataclip it takes us to a page we can write our queries&lt;br&gt;
we select the project we want the query to execute in and also give a title to our dataclip. then we write our query.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

CREATE TABLE user( user_id serial PRIMARY KEY, username VARCHAR ( 50 ) UNIQUE NOT NULL, password VARCHAR ( 50 ) NOT NULL, email VARCHAR ( 255 ) UNIQUE NOT NULL, created_on TIMESTAMP NOT NULL, last_login TIMESTAMP );


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

&lt;/div&gt;

&lt;p&gt;once this written click on save and run.&lt;br&gt;
Voila!!&lt;br&gt;
You have created your first table on Heroku..&lt;br&gt;
Congrats!!&lt;br&gt;
If you like this article, feel free to check my profile for more amazing content&lt;br&gt;
also check me on github as:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/DanielMabadeje" rel="noopener noreferrer"&gt;https://github.com/DanielMabadeje&lt;/a&gt;&lt;br&gt;
Thanks&lt;/p&gt;

</description>
      <category>heroku</category>
      <category>postgres</category>
      <category>sql</category>
      <category>php</category>
    </item>
    <item>
      <title>PHP Getting Started</title>
      <dc:creator>Daniel Mabadeje</dc:creator>
      <pubDate>Wed, 04 Nov 2020 09:06:41 +0000</pubDate>
      <link>https://forem.com/danielmabadeje/php-getting-started-3536</link>
      <guid>https://forem.com/danielmabadeje/php-getting-started-3536</guid>
      <description>&lt;p&gt;So you want to start PHP?&lt;br&gt;
Welcome, because in this article we will be looking at getting started with  PHP&lt;/p&gt;

&lt;p&gt;First of all what is PHP?&lt;br&gt;
PHP is an acronym for "PHP: Hypertext Preprocessor". PHP is a widely-used, open source scripting language. PHP scripts are executed on the server. That means PHP is a server-side language i.e scripts executed on the server mostly backend.&lt;/p&gt;

&lt;p&gt;Before we go into installation, lets see what PHP can do. PHP can do this and more:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;PHP can generate dynamic page content.&lt;/li&gt;
&lt;li&gt;It can create, open, read, write, delete, and close files on 
the server.&lt;/li&gt;
&lt;li&gt;It can collect form data.&lt;/li&gt;
&lt;li&gt;This language also, can send and receive cookies.&lt;/li&gt;
&lt;li&gt;PHP can add, delete, modify data in your database, in other 
words, it can manipulate the database.&lt;/li&gt;
&lt;li&gt;As a server-side language, it can be used to control user-access.&lt;/li&gt;
&lt;li&gt;It can encrypt data.&lt;/li&gt;
&lt;li&gt;PHP files can contain HTML,CSS and Javascript.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;so Why PHP?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, 
etc.)&lt;/li&gt;
&lt;li&gt;PHP is compatible with almost all servers used today (Apache, 
IIS, etc.)&lt;/li&gt;
&lt;li&gt;PHP supports a wide range of databases&lt;/li&gt;
&lt;li&gt;PHP is free. Download it from the official PHP resource: 
&lt;a href="http://www.php.net"&gt;www.php.net&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;PHP is easy to learn&lt;/li&gt;
&lt;li&gt;It runs efficiently on the server side&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;At the time this article was written the version of PHP was version php 7.&lt;br&gt;
At the moment PHP is much faster than previous PHP versions, it supports new operators and it also has an improved error handling technique.&lt;/p&gt;
&lt;h2&gt;
  
  
  Getting started with PHP.
&lt;/h2&gt;

&lt;p&gt;To start using PHP, you can:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Find a web host with PHP and MySQL support.&lt;/li&gt;
&lt;li&gt;Install a web server on your own PC, and then install PHP and 
MySQL.
Most web hosts used are Laragon, Xampp, Wamp etc.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If your server has activated support for PHP you do not need to do anything.&lt;/p&gt;

&lt;p&gt;Just create some .php files, place them in your web directory, and the server will automatically parse them for you.&lt;/p&gt;

&lt;p&gt;You do not need to compile anything or install any extra tools.&lt;/p&gt;

&lt;p&gt;Because PHP is free, most web hosts (locally or production) like the ones listed above offer PHP support.&lt;/p&gt;

&lt;p&gt;However, if your server does not support PHP, you will need to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;install a web server.&lt;/li&gt;
&lt;li&gt;install PHP.&lt;/li&gt;
&lt;li&gt;install a database, such as MySQL.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After doing all this, create a file with &lt;strong&gt;.php&lt;/strong&gt; extension in the folder provided for you to put your projects. E.g In Laragon, every project you want create is in &lt;strong&gt;www&lt;/strong&gt; folder. while in xampp, it is in the &lt;strong&gt;htdocs&lt;/strong&gt; folder.&lt;/p&gt;

&lt;p&gt;now lets write our first line of code in the newly created file..&lt;br&gt;
Please note that PHP codes start with &lt;strong&gt;&amp;lt;?php&lt;/strong&gt; and end with &lt;strong&gt;?&amp;gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;so let's try..&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;?php
$txt = "PHP";
echo "I love $txt!";
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And Voila!! you have setup PHP on your PC.&lt;/p&gt;

&lt;h2&gt;
  
  
  MATERIALS
&lt;/h2&gt;

&lt;p&gt;In order to get full documentation on PHP&lt;/p&gt;

&lt;p&gt;check &lt;a href="http://www.php.net"&gt;www.php.net&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As other languages have their frameworks, so does PHP&lt;/p&gt;

&lt;p&gt;Frameworks like..&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://laravel.com/"&gt;Laravel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codeigniter.com/"&gt;CodeIgniter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://symfony.com/"&gt;Symphony&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cakephp.org/"&gt;CakePHP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://framework.zend.com/"&gt;Zend&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.yiiframework.com/"&gt;Yii&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://fuelphp.com/"&gt;Fuel PHP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.phalcon.io/4.0/en/introduction"&gt;Phalcon&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;and many others&lt;/p&gt;

&lt;p&gt;for tutorials check&lt;br&gt;
 &lt;a href="https://www.w3schools.com/php/default.asp"&gt;https://www.w3schools.com/php/default.asp&lt;/a&gt;&lt;br&gt;
 &lt;a href="https://www.tutorialspoint.com/php/php_introduction.htm"&gt;https://www.tutorialspoint.com/php/php_introduction.htm&lt;/a&gt; &lt;br&gt;
and others..&lt;/p&gt;

&lt;p&gt;for Online Code editors or environments you could check&lt;br&gt;
&lt;a href="https://phpsandbox.io/"&gt;https://phpsandbox.io/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;feel free to check me out on Github:&lt;a href="https://github.com/DanielMabadeje"&gt;https://github.com/DanielMabadeje&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
    </item>
    <item>
      <title>How Web Browsers and Servers Communicate</title>
      <dc:creator>Daniel Mabadeje</dc:creator>
      <pubDate>Tue, 03 Nov 2020 16:25:58 +0000</pubDate>
      <link>https://forem.com/danielmabadeje/how-web-browsers-and-servers-communicate-54am</link>
      <guid>https://forem.com/danielmabadeje/how-web-browsers-and-servers-communicate-54am</guid>
      <description>&lt;p&gt;Have you ever wondered how you are able to go to website on the browser and it views it or wondered why the website you opened in country is not allowed in another country? Or have you wanted to have a sneak peak of the behind the scenes that happen on the web? Then this is the right article for you there are protocols in which your browser follows in order to have access to a particular website which we will cover in this article.&lt;/p&gt;

&lt;p&gt;Please note that Web servers are what supply the content for web browsers. What the browser requests, the server delivers through internet network connections.&lt;/p&gt;

&lt;p&gt;In this article we will cover&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Client-Server Network Design and the Web&lt;/li&gt;
&lt;li&gt;Network Protocols for Web Browsers and Servers&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;First of all let me just start by saying Web browsers and servers communicate using TCP/IP. … The browser initiates a TCP connection to the web server or server pool (using port 80 by default) through its IP address as published in DNS. As part of this process, the browser also makes DNS lookup requests to convert the URL to an IP address.&lt;/p&gt;

&lt;h2&gt;
  
  
  Client-Server Network Design and the Web
&lt;/h2&gt;

&lt;p&gt;Web browsers and web servers function together as a client-server system. In computer networking, client-server is a standard method for designing applications where data is kept in central locations (server computers) and efficiently shared with any number of other computers (the clients) on request. All web browsers function as clients that request information from websites (servers).&lt;br&gt;
Numerous web browser clients can request data from the same website. Requests can happen at all different times or simultaneously. Client-server systems conceptually call for all requests to the same site to be handled by one server. In practice, however, because the volume of requests to web servers can sometimes grow very large, web servers are often built as a distributed pool of server computers.&lt;br&gt;
For websites popular in different countries around the world, this webserver pool is geographically distributed to help improve the response time to browsers. If the server is closer to the requesting device, the time it takes to deliver the content is faster than if the server were further away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Network Protocols for Web Browsers and Servers
&lt;/h2&gt;

&lt;p&gt;Web browsers and servers communicate using TCP/IP. Hypertext Transfer Protocol is the standard application protocol on top of TCP/IP supporting web browser requests and server responses.&lt;br&gt;
Web browsers also rely on DNS to work with URLs. These protocol standards enable different brands of web browsers to communicate with different brands of web servers without requiring particular logic for each combination.&lt;br&gt;
Like most internet traffic, web browser and server connections typically run through a series of intermediate network routers.&lt;br&gt;
A basic web browsing session works like this:&lt;br&gt;
A person specifies a URL in a browser.&lt;br&gt;
The browser initiates a TCP connection to the server or server pool (using port 80, by default) through its IP address, as published in DNS. As part of this process, the browser also makes DNS lookup requests to convert the URL to an IP address.&lt;br&gt;
After the server completes the acknowledgment of its side of the TCP connection, the browser sends HTTP requests to the server to retrieve the content.&lt;br&gt;
After the server replies with content for the page, the browser retrieves it from the HTTP packets and displays it accordingly. Content can include embedded URLs for advertising banners or other external content, which in turn triggers the browser to issue new TCP connection requests to those locations. The browser may also save temporary information, called cookies, about its connections to local files on the client computer.&lt;br&gt;
Any errors encountered during the request for the content might appear as HTTP status lines.&lt;br&gt;
Ok so thats basically everything you need to know about client-side and their protocols&lt;br&gt;
I did this with some help from &lt;a href="https://www.quora.com/How-does-a-browser-communicate-with-a-web-server"&gt;https://www.quora.com/How-does-a-browser-communicate-with-a-web-server&lt;/a&gt; and &lt;a href="https://www.lifewire.com/web-browsers-and-web-servers-communicate-817764"&gt;https://www.lifewire.com/web-browsers-and-web-servers-communicate-817764&lt;/a&gt;&lt;br&gt;
You can email me at: &lt;a href="mailto:mabadejedaniel1@gmail.com"&gt;mabadejedaniel1@gmail.com&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/DanielMabadeje/"&gt;Github&lt;/a&gt;: &lt;a href="https://github.com/DanielMabadeje/"&gt;https://github.com/DanielMabadeje/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>servers</category>
      <category>dev</category>
    </item>
  </channel>
</rss>
