ldc-groupe/app/View/Components/Front/Pages/KnowUs/OurImplantations.php

44 lines
1.3 KiB
PHP

<?php
namespace App\View\Components\Front\Pages\KnowUs;
use App\Models\Company;
use App\Models\CompanyActivity;
use Illuminate\View\Component;
class OurImplantations extends Component
{
public string $id;
public $implantations;
public $companyModels;
public $companyActivityModels;
/**
* Create a new component instance.
*/
public function __construct($id, $implantations)
{
$this->id = $id;
$this->implantations = $implantations;
$this->companyModels = Company::getModelsCached()
->where('published', true)
->whereNotNull('sector_id')
->values();
$this->companyActivityModels = CompanyActivity::getModelsCached()
->where('published', true)
->values();
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|\Closure|string
*/
public function render(): \Illuminate\Contracts\View\View|\Closure|string
{
return view('components.front.pages.know-us.our-implantations', [
'companyModels' => $this->companyModels,
'companyActivityModels' => $this->companyActivityModels,
]);
}
}