<?php

namespace App\Classes\Modules\Companies\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Companies\DataTransferObjects\CompanyModuleObject;
use App\Models\CompanyModule;

class UpdatesCompanyModuleName extends AbstractUpdateRecord
{

    /**
     * @param CompanyModule $model
     * @param CompanyModuleObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(CompanyModule $model, string $name) 
    {
        $model->name = $name;

        return $this->handler($model);
    }
}