<?php

declare(strict_types=1);

namespace App\Dtos;

use Illuminate\Database\Eloquent\Model;

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