I have a problem of checking whether any values in an array match any values in json column which contains an array with a name. suppose i have an array [25,36,45,52] and json column is {"values": [25,24,15]}. I want to check whether any values in array match any of values in json column in xampp mysql. please provide a better solution of doing this. this image show table structure of my database
i have 4 tables.
- user
- profile
- profile
- jobs
user table (id,userid)
jobs table (id,user_id,skill_id)
skill table (id,job_id,)
profile table (id,user_id)
now i want to search all jobs that match some or at least one skills. i have tried with this but this is giving all jobs with out skills filtered.
$jobs = Job::with(['user','profile'])->with(['skills' => function($query){
$query->whereJsonContains('skills->skills',[35]);
}])->where('jobs.is_completed',0);
please help me.