Vivek Bora
Vivek Bora

Reputation: 45

How can i use single category table for having category in Posts, Pages and Advertisement Section in Laravel

i need some help regarding using single category db table for all categories in my application. I want to have a single table which contains all type of categories.

And when creating a Post , i would like to display only Post Model related Categories and while creating a Page i would like to display only Page Related Categories for selection.

How can i achieve this?

Upvotes: 0

Views: 98

Answers (1)

sandip bharadva
sandip bharadva

Reputation: 646

@Vivek Bora it is very simple just add type column in your categories table Ex: type = post or advertisement or anything that you want.

Upvotes: 2

Related Questions