The db have 3 tables chars, tags, and chars_tags
chars has the following columns:
id | char_name
tags has the following columns:
id | tag_name
chars_tags has the following columns:
id | char_id | tag_id
I always use the code below to get the data, because last time the char table has another column called 'tag_id', now they remove the 'tag_id' column and change it to pivot table which is 'chars_tags'
$char = chars::where('id', '=', 1)
->with('tags:id,tag_name')
->get();
So how can I get the char with tag now?