Laravel 5 relationship using a 'JSON' column
问题 Is it possible to use Eloquent to create a relationship in Laravel 5 where the foreign key exists in a field in a JSON column? If it is, how so? Example: I have a table called chats with a participantIds column, of a JSON datatype. The JSON format of the data looks like this: {"creator": "1", "recipient": "2"} I want to join the users table using those fields to get the participants of the Chats. How do I do that? 回答1: Laravel has no native support for JSON relationships. I created a package