%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/apache/htdocs/app/Models/Concerns/
Upload File :
Create Path :
Current File : //usr/local/apache/htdocs/app/Models/Concerns/Meta.php

<?php

namespace App\Models\Concerns;

use Illuminate\Database\Eloquent\Model;
use App\Collection\MetaCollection;
use Exception;
use Illuminate\Database\Eloquent\Builder;

/**
 * Class Meta
 *
 */
abstract class Meta extends Model
{
    /**
     * @var bool
     */
    public $timestamps = false;

    /**
     * @var array
     */
    protected $appends = ['value'];

    /**
     * @return mixed
     */
    public function getValueAttribute()
    {
        try {
            $value = unserialize($this->meta_value);

            return $value === false && $this->meta_value !== false ?
                $this->meta_value :
                $value;
        } catch (Exception $ex) {
            return $this->meta_value;
        }
    }

    /**
     * @param array $models
     * @return MetaCollection
     */
    public function newCollection(array $models = [])
    {
        return new MetaCollection($models);
    }
}

Zerion Mini Shell 1.0