Hi Folks,
I have 2 Tables (projects and images) which I can fetch like this:
$projects = Project::with(['images' => function($query){
$query->where('state' , 0 );
}])->whereHas('user', function ($query) use ($user) {
$query->where('id', '=', $user->id);
})->get();
The Project Table has a field "stat" where the stat of the project is defined:
0 = uploaded by user
1 = deleted by user
2 = verified by admin
3 = rejected.
The Image Table has a field "state" where 0 = ok, 1 = deleted
Currently I am fetching all the projects with images with state 0 from the logged in user. What can I do to fetch only the projects with stat = 0 || stat = 2 || stat = 3?
Thank you for your advice!
Stefan