1234567891011121314151617181920212223242526272829 |
- <?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);
- }
- }
|