<?php

declare(strict_types=1);

namespace Seka\Terminy\Dtos;

use Illuminate\Database\Eloquent\Model;

/**
 * Trait ModelToDTOTrait
 *
 * @package Seka\Terminy\Dtos
 */
trait ModelToDTOTrait
{
    /**
     * @param \Illuminate\Database\Eloquent\Model $model
     *
     * @return static
     */
    public static function fromModel(Model $model)
    {
        return new static($model->toArray());
    }
}
