@php
use Modules\Project\Entities\Project;
$posts = App\Post::all();
$projects = $posts
->where('post_type', 'Modules\Project\Entities\Project')
->where('published', 1);
@endphp
@foreach($projects->chunk(4) as $chunk)
@foreach($chunk as $project)
@php
$location = Project::find($project->post_id)->location;
@endphp
@php
$thumb = (preg_replace('/(.*)(\/)([^\/]+)$/', '$1/thumbs/' . $project->slug . '.jpeg', $project->featured_image));
if(file_exists(public_path( $thumb ))){
$thumb = $thumb;
} else {
$thumb = $project->featured_image;
}
@endphp
{{$project->title}}
{{$location}}
{!!$project->description!!}
{{$project->title}}
@if($project->slug == 'before-and-after')
@include('componentproject::layouts.before-and-after-modal')
@else
@include('componentproject::layouts.modal')
@endif
@endforeach
@endforeach