Hey,
first: that's a One-to-Many relationship. ONE Category can have MANY questions.
You confused the methods. You need a hasMany relationship in the categories (since every category has multiple questions) and a belongsTo relationship in the questions (since every question belongs to one category).
After that you can say
$question->category->cat_name
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community