<?php

namespace App\Classes\Modules\Currencies\Services;

use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Models\Currency;
use App\Models\CurrencyLog;

class CreatesCurrencyLog extends AbstractUpdateRecord
{
    /**
     * @param Currency $object
     * @return \Illuminate\Database\Eloquent\Model
     * @throws \App\Classes\Exceptions\MalformedRequestException
     */
    public function execute(Currency $object) {
        $model = new CurrencyLog();
        $model->currency_id = $object->id;
        $model->created_by = Auth()->user()->id;
        return $this->handler($model);

    }
}