Open geeksesi opened 1 year ago
We need Category
model with One To Many
relation. Each Blog
can have one category. #17
We need Tag
model with Many To Many (Polymorphic)
relation. Each Blog
can be in 0, 1 or more tags.
We need Comment
model with One To Many (Polymorphic)
relation. Each Blog
can get 0, 1 or more comments. ( We need reply ).
We need Bookmark
model with One To Many (Polymorphic)
relation. Each Blog
can get 0, 1 or more bookmarks.
We need Rate
model with One To Many (Polymorphic)
relation. Each Blog
can get 0, 1 or more rates.
For Post model, we need:
Title
Body
Slug
Meta description ( for SEO )
Logo ( Image address )
View count
Comment count
Rate count
Rate sum
User id ( save creator id ) For now, Only the creator of the blog can delete or update it.
[x] Read about Polymorphic
relation in Laravel
each category has many posts. each post has many categories or one category?! @geeksesi
We need Category model with many To many relation. Each post can have many categories.
We need Post model with many To many relation. Each category can have many posts.
We need Comment model with One To Many relation. Each post can get 0, 1 or more comments.
We need User model with One To Many relation. Each User can put 0, 1 or more comments.
We need a table for relation between category &post with many To many relation. Each post can have many categories and Each category can have many posts. For this we need: Id(It's primary key in post model) Id(It's primary key in category model)
For Category model, we need: Title, description,Id
For User model, we need: Author_name, Author_email, password, Username
For Post model, we need: Title, body, thumbnail, SEO description, tags, Id(It's primary key in category model), Id(it's primary key in this table)
For comment model, we need: Id(It's primary key in post model), description, author_name
first step :
Story
we need blog ability, to post news, documents, and etc... about products, shop and our job.
we should be able to make some post, and add the posts to categories ( blog post could have multiple categories )
people could leave comment on posts. ( it's not necessary to login but if they are logged in should be use their name )
posts are contain :
Technical
data models :
anyone with a name and email could make a comment on post, if a user is logged in for a comment should use the logged in email and name.
DOD
resources :