belongsTo( 'App\User' ); } public function creator() { return $this->belongsTo( 'App\User' , "creator_id" ); } public function items() { return $this->hasMany( 'App\Item' ); } public function labels() { return $this->hasMany( 'App\Label' ); } public function transfersAll() { return $this->morphMany( 'App\Transfer' , "transferable" ); } public function transfers() { return $this->morphMany( 'App\Transfer' , "transferable" )->where( "status" , StatusTypeEnum::APPROVED ); } public function transferActive() { return $this->morphMany( 'App\Transfer' , "transferable" )->where( "status" , StatusTypeEnum::APPROVED )->whereNull( "to_date" ); } }