<?php

namespace App\Core;

use Dipper\Foundation\Core\Model as Eloquent;

/**
 * Base Model.
 */
abstract class Model extends Eloquent
{
    protected $guarded = [];

    /**
     * 模型的「启动」方法
     *
     * @return void
     */
    protected static function boot()
    {
        parent::boot();
    }

    public function attributesToArray()
    {
        $attributes = parent::attributesToArray();

        foreach ($attributes as $key => $value) {
            if (is_numeric($value) && $value > 4294967295) {
                $attributes[$key] = (string) $value;
            }
        }

        return $attributes;
    }
}
