<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Trace extends Model
{
//    public $fillable = ['key', 'gid', 'slug', 'group'];
    protected $guarded = [];

    public $appends = [];

    public function good()
    {
        return $this->belongsTo(Good::class, 'gid');
    }

    public function getUrlAttribute()
    {
        return config('app.url') . '/key/' . $this->attributes['slug'];
    }
    
    public function dealer()
    {
        return $this->belongsTo(Dealer::class);
    }

}
