<?php

namespace Modules\CityManager\Http\Livewire;

use Livewire\Component;
use Modules\CityManager\Models\CityManager;

class CityManagerInfo extends Component
{
    public $manager = false;
    public function mount()
    {
        $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');
    }
}