Lesson 1: Introduction to Building A blog Application using Laravel 5.5 and Php 7.0

Hey everyone, welcome to this PHP and Laravel tutorial series. My name is Henry Mbugua and I will be taking you through the various aspect of creating blog application using a popular PHP framework called Laravel. I am a software developer at Muva Technologies where our main focus is to offer services around mobile solutions(Apps), web solution and websites, payments integration, web hosting and domains, and last but not least, consultancy and training.

One of the main question new developers ask is, why create a blog application tutorial? It seems like everyone recreate a blog as their first application. Well, there is a reason for that, first of all. Everyone knows how a blog works and this make it easy for learning. When I tell you we are creating a blog, you automatically know that there is some sort of authentication system, posts are going to be the main element, there will be a page that list all the post in a particular order e.g chronologically and you also know each of these post will have comments.

Simply put, when we say a blog, you are able to visualize the end goal of the tutorial and everyone is on the same page as to what a blog entails. I think those are the main reason why a blog application? and the other important reason is, it does not involve anything overly complex but at the same time it will get you into some of the most important element of software development and this will act as a stepping stone for any application in the future.

To build our blog application, we will be using a popular php web framework called Laravel. Laravel web framework is written in php and it follows php programming language style. We hope you have basic understanding of php programming, this will give you an edge in understanding this tutorial. Here are the topics that will cover in this tutorial:

  • Lesson 1: Introduction to building a blog application using php and Laravel framework.

  • Lesson 2: Understanding Laravel folder structure in our Laravel 5.5 blog project.

Development Environment

To be honest, there are many ways to setup a local PHP development environment available. In this tutorial, we will point you to the resources that will help you get started. Whether you choose to rely on a tool like MAMP, WAMP or XAMPP, your development environment will need to have all of the following installed in order to serve Laravel sites:

  • PHP >= 7.0.0 for Laravel 5.5

  • OpenSSL PHP extension

  • PDO PHP extension

  • Mbstring PHP extension

  • Tokenizer PHP extension

  • XML PHP extension

Here are resource that you can use to setup development environment:

NB: Please leave a comment on how to setup php development environment on your platform e.g. Linux, windows, Mac Os.

Composer

Whatever operating system you are using, you need to have composer installed globally. Composer is a tool that is at the foundation of most modern PHP framework and Laravel uses composer to manage dependency. Think of composer much like NPM for Node.

Installing Laravel

At this point, we assume that you have been able to set up your development environment. There are two ways to install Laravel project:

  • Via Laravel Installer

  • Via Composer Create-Project

To learn more, please visit Laravel installation guide. In this tutorial, I will be using laravel installer to create new project. I have a folder on my desktop called php_dev, I will navigate to this folder on my terminal and run the following command: laravel new blog Here is my terminal sample output after running this command:

This above command create a new laravel project called blog. It may take a while for the above command installation to finish depending on your Internet speed.

Development Server

Laravel comes with light weight built-in development server that you can use during development. Now that we have a laravel project called blog. On my terminal I will navigate into this folder by running this command: cd blog To use laravel server, I will run the following command: php artisan serve Here is my terminal output:

 

Our terminal shows that our server is up and running. On your browser, navigate to http://localhost:8000/ and you should see the following output:

Congratulations on your first laravel-powered page!

Goals achieved in this lesson

  • We have learnt why people recreate blog application as their first project.

  • We have pointed you to resource that can help you set up development environment.

  • We learnt how to create a new laravel project.

  • We have learnt how to use laravel built-in development server.

With that we conclude our first lesson, to get the code visit building a blog application using laravel. See you in lesson 2.

Facebook Comments
Get free email updates!
Signup now and receive an email once we publish new content.
We respect your privacy

Henry Mbugua

I am a Junior Developer ready to enter major leagues. My professional ambition is to stay versatile and be able to fill different roles within a product group. As such, I have been learning technology across frontend and backend.