That's not a good way (comma separated values) to store data in the DB, as you're now discovering. In addition to being extremely hard to get data, it is next to impossible to accurately query it. You need to separate the relationships into separate tables:
characters -id -name
titles -id -name
character_title -character_id -title_id
character_title holds the many-to-many relationships between characters and titles. Then you simply setup your Laravel models following the examples at http://laravel.com/docs/eloquent#many-to-many.
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us
The Laravel portal for problem solving, knowledge sharing and community building.