belongsTo(User::class); } function scopeActive() { return $this->where('active',TRUE); } function scopeType($query,string $type) { return $query->where('type',$type); } }