Simple blog application in laravel 5

NOTE:

If you face any problem then please don't ask question on demo website (in test posts). Please use our forum http://www.findalltogether.com/forum/laravel/. You will get email when there will be any response to your question.

What is this application?

This is a simple blogging application with the following features:

  1. Anyone can login/register
  2. Users can be 'admin', 'author' or 'subscriber'.
  3. Authors can write/update/delete their own posts.
  4. Admin has full access on the website and can read/ write/ update/ delete any of the posts.
  5. Anyone can read these posts
  6. Users can comment on the posts (only after login)

Demo:

Demo of the application is hosted on Heroku. View Demo. By default, users are authors (so that you can see complete demo). Your email is required to avoid spam users. Your email will neither be shared with third party nor be used by us for sending emails. Honestly we do not spam your inbox. (Although if you do want to receive relevant tutorial emails from us you can subscribe!)

Single page of demo blogging website

Source code:

The source code of this application is on Github. Code on Github. This code is open source and you can use and modify it for your projects.

Pre-requirements:

Knowledge:

This series is written with an assumption that readers are newbies to the Laravel framework but have some experience with PHP. If you don't know PHP then use my Step by step PHP tutorials series. For laravel tutorials read Laravel 5 Tutorials.

Softwares:

Installed PHP, Mysql, Laravel 5

Install Laravel 5:

  1. curl -sS https://getcomposer.org/installer | php
  2. mv composer.phar /usr/local/bin/composer
  3. composer global require "laravel/installer=~1.1"
  4. laravel new blog

Now change directory (in terminal) to inside blog folder and use command:

Introduction to all parts:

1) Setup database

  • Connect with mysql database
  • Create posts and comments tables

2) Make routes and models

  • Routes
  • Create post model
  • Create comment model
  • Create User model

3) Controllers

  • PostController
  • CommentController

4) Build front end

  • Customize app.blade.php
  • make home view
  • Create posts
  • Show posts
  • Edit posts

5) Add tinymce and Make user profile

  • Add tinymce to posts
  • Make profile backend
  • View for profile
Edit post page with tinyMCE WYSIWYG editor

NOTE:

  • I am assuming that you are following the tutorial to create the application and not just reading the code.
  • I am giving all commands from the app directory, i.e., from the folder blog.
  • This is very simple blogging application. I will extend it to be more advanced in upcoming articles.


About Harish Kumar

Harish is an interested person in the field of web development and blogging. He works for the need of young web developers in learning various languages, latest technologies and other essential tips and tricks. If you need some help or you have some suggestion then you email him at harish@findalltogether.com without any hesitation. You can also suggest/demand for articles of your own choice.

Related Articles

Laravel is a MVC framework. Models are the real world entities in data form. Views are the response content to the vi...
Laravel framework architecture
Routes map urls with the controllers. In this section we will read about how route maps urls with controllers and how...
Basics routing and controllers in laravel 5
Views are the HTML content served by the server. These are served by returning from controllers. Views are .php or .b...
View in Laravel 5

Login or Sign up to leave comment.