File: D:/HostingSpaces/SBogers68/otium-gebiedsontwikkeling.nl/app/Projects/ProjectService.php
<?php
namespace App\Projects;
use App\Base\Service;
use App\Projects\Models\Project;
use Carbon\Carbon;
class ProjectService extends Service
{
private $today;
public function __construct()
{
$this->today = Carbon::now()->addHour();
$this->today = $this->today->format('Y-m-d H:i:s');
parent::__construct();
}
private function baseQuery()
{
return Project::with('translation', 'images')
->where('active', 1)
->orderBy('lft')
->whereHas('translation');
}
public function getAllProjects()
{
return $this->baseQuery()->get();
}
public function getMoreProjects(Project $project)
{
return $this->baseQuery()
->where('projects.id', '!=', $project->id)
->get();
}
}