<?php

namespace App\Classes\Modules\Addresses\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Models\Address;

class SetsAddressToDefault extends AbstractUpdateRecord
{

    /**
     * @param Address $model
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(Address $model)
    {
        $model->default = true;

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