jeudi 13 octobre 2016

Compare tags separated by a comma Laravel

I've got this code I'm trying to replicate in Laravel from php from an old project I'm porting. But I'm unsure how to do the comparison in Laravel.

We've got this descriptors table in the database that has a tags collumn with entries like, 3A-2, 7A-11, 3A-8, etc.

These tags are stored in other tables like so : 1A-8,3A-1,3A-5,8-8,8-16,8-18

How do I get Laravel to look at each tag in the database entry and compare it to the tags collumn in the descriptors table to get the actual value assigned that tag?

So if 1A-8 has in its row Category, subcategory and description in the descriptor's table, I'd like to be able to compare and grab that data, then move to 3A-1, then 3A-5, and so on.

Normally if it was a straight comparison I might do a where comparison but this has some extra conditional logic I'm a bit lost on.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire