<?php

declare(strict_types=1);

namespace Seka\Vzdelavanie\Dtos;

use Illuminate\Database\Eloquent\Model;

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