Laravel - How to query if an array field in DB contains a value
<p>I have a field in my model <code>Person</code> called <code>jobs</code> that I'm casting as an array. <code>jobs</code> is an array of ids related to a Jobs table. I want to be able to query Person and return all that have a certain id in their jobs array. I see that Laravel has a <code>whereIn</code> clause which checks if a database value is in an array but I need the opposite - to check whether a database array contains a value.</p>

<p>Am I stuck having to use <code>where('jobs', 'like', '%"' . $job_id . '"%')</code>?</p>