@php use app\Post; use Modules\Project\Entities\Project; use Modules\CaseStudy\Entities\CaseStudy; $posts = App\Post::all(); $projects = $posts->where('post_type', 'Modules\Project\Entities\Project'); if(isset($sub->project_url)) { $case_study = Post::where('slug', $sub->project_url . '-case-study')->first(); $post = Post::where('slug', $sub->project_url)->where('post_type', 'Modules\Project\Entities\Project')->first(); $project = Project::find($post->post_id); } @endphp {{-- Project Gallery --}} @if(isset($sub->project_url))