<?php
namespace App\KommaApp\Jobs;
use App\KommaApp\Jobs\Models\Job;
use Carbon\Carbon;
class JobService
{
public function getAllJobs($pagination = false, $itemsPerPage = 9)
{
$jobs = Job::where('active', '1')
->with('translation', 'images')
->with('translation.route')
->orderBy('created_at');
if($pagination)
{
$jobs = $jobs->paginate($itemsPerPage);
}
else
{
$jobs = $jobs->get();
}
return $jobs;
}
}