Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

officelifehq/officelife

942 stars
1 code files
View officelifehq/officelife on GitHub

app/Http/ViewHelpers/Company/Project/ProjectViewHelper.php

Open in GitHub
use App\Models\Company\Company;
 
class ProjectViewHelper
{
//
public static function index(Company $company): array
{
$projects = $company->projects()->orderBy('id', 'desc')->get();
 
$projectsCollection = collect([]);
foreach ($projects as $project) {
$projectsCollection->push([
'id' => $project->id,
'name' => $project->name,
'code' => $project->code,
'summary' => $project->summary,
'status' => $project->status,
'url' => route('projects.show', [
'company' => $company,
'project' => $project,
]),
]);
}
 
return [
'projects' => $projectsCollection,
];
}
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.