<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Config extends Model
{
    protected $casts = [
        'data' => 'array',
    ];

    public function data() 
    {
        return $this->data[0];
    }

    public static function getData($configName)
    {
        return Config::where('name',$configName)->first()->data();
    }
}
