<?php

namespace App\Classes\Modules\Accounts\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Accounts\DataTransferObjects\FullNameObject;
use App\Models\User;

class UpdatesUser extends AbstractUpdateRecord
{

    /**
     * @param User $model
     * @param FullNameObject $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(User $model, FullNameObject $object) {

        $model->name = $object->getName();
        return $this->handler($model);

    }
}