34 lines
990 B
PHP
34 lines
990 B
PHP
<?php
|
|
|
|
namespace Modules\CityManager\Http\Livewire;
|
|
|
|
use Livewire\Component;
|
|
use Modules\CityManager\Models\CityManager;
|
|
|
|
class CityManagerInfo extends Component
|
|
{
|
|
public $managers = [];
|
|
public $manager = false;
|
|
public function mount()
|
|
{
|
|
$availableCities = GetAvailableCities();
|
|
CityManager::whereIn('city_id', $availableCities->pluck('id'))->get()->each(function ($cityManager) {
|
|
$this->managers[] = $cityManager->user;
|
|
});
|
|
|
|
//depricated, but leave for now, maybe will be used in future for list of managers in city
|
|
$city = false;
|
|
if (($company = AdminCompanyOfUser()) || ($company = AgentCompanyOfUser()))
|
|
{
|
|
if ($cityManager = CityManager::where('city_id', $company->city->id)->first())
|
|
{
|
|
$this->manager = $cityManager->user;
|
|
}
|
|
}
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
return view('citymanager::livewire.info.index');
|
|
}
|
|
} |