Modules\Doptor\CompanyInfo\Controllers\CompanyController::edit PHP Метод

edit() публичный Метод

Show the form for editing the specified resource.
public edit ( integer $id )
$id integer
    public function edit($id)
    {
        if (!can_user_access_company($id)) {
            abort(501);
        }
        if ($this->module_vendor) {
            $company_model = "Modules\\{$this->module_vendor}\\{$this->module_alias}\\Models\\Company";
        } else {
            $company_model = "Modules\\{$this->module_alias}\\Models\\Company";
        }
        $country_model = $this->module_namespace . 'Models\\Country';
        $countries = $country_model::names();
        $company = $company_model::with('incharges')->findOrFail($id);
        $incharge_count = $company->incharges->count() ?: 1;
        $title = "Edit Company";
        $this->layout->title = $title;
        $this->layout->content = View::make("{$this->module_alias}::companies.{$this->type}.create_edit")->with('title', $title)->with('company', $company)->with('incharge_count', $incharge_count)->with('countries', $countries);
    }