Level 2
Jun 9, 2020
2
Level 2
Join to tables
Hi there,
I want to join projects table and categories table together to get project category name
my table project
- id
- category_id
my table categories
- id
- name
with this code $pro = Project::join('categories', 'projects.category_id', 'categories.id')->get(); I have this result below:
dump(project)
"id" => 3
"user_id" => 1
"category_id" => 3
...
"name" => "Beauté"
I would like to have category name unstead.
Is it possible ?
Thank you in advance for you help.
see you.
Please or to participate in this conversation.