Laravel Classroom image

To post your Question Join Classroom
Lesson Topics's No:-  |1 | 2 | 3 | 4 | 5 | 6 | 7 | 8|Last
Lessons:-The Blog Tutorial

The Blog Tutorial
It’s finally time to write our first full application. If you haven’t read the other chapters you
might find this a little tricky. Let’s have a look at what we are going to be using to create the
• Routes
• Migrations
• Eloquent
• Blade Templates
• Authentication
• Filters
Let’s have a look at the plan Stan, and see exactly what we are going to be building.
Oh yeah, if you would like to see what we are making then you will find the source code for this
tutorial on github¹.
15.1 The Design
We are going to build a three page blog. The first page will consist of a listing of blog posts.
Similar to the front of a Wordpre.. Wordpush blog. The next page will be the full-view page.
It is the page you reach when you click an article that you want to read. The final page will be
the page where we write our posts.
Normally you would have the ability to edit or delete posts, but we can add all that stuff later.
I’m not counting the usual login page in that count, since it is used with any application that
implements authentication.
Let’s think about the database schema for a moment. We know that we are going to need a table
to store our blog posts. We will also need a table to store our users. We are also going to need
some form of relationship between them both. Let’s map this out and think about the fields.
Table : posts
Field Type
title VARCHAR(128)
body TEXT
author_id INTEGER
created_at DATETIME
updated_at DATETIMETable : users
Field Type
username VARCHAR(128)
nickname VARCHAR(128)
password VARCHAR(64)
created_at DATETIME
updated_at DATETIME
Ok that looks good. We can use the author_id field on the Post object to reference the User
object, which represents the post’s author.
Right, to work!



Skills    Laravel

Qualifications :-
Location :-,,,

  Students (0)