I want get types only where wef is equal to current table wef. how to achieve this i am not able to get wef attribute with $this->attributes['wef']. Thanks in advance.
class Gst extends Model
    {
        //
        use Traits\UserAutoUpdate;
        protected $connection = 'mysql';
        protected $table = "gst";
        protected $fillable = ['name','wef'];
        public function types(){
           return $this->hasMany(GstType::class,'gst_id','id')->where('wef', $this->attributes['wef']);
        }   
    }
Error : "Undefined index: wef"