belongsTo( 'App\User' ); } public function items() { return $this->belongsToMany( 'App\Item' , 'item_package' )->withPivot( 'count' ); } public function labels() { return $this->hasMany( 'App\Label' ); } public function transfers() { return $this->morphMany( 'App\Transfer' , "transferable" )->where( "status" ,"approved" ); } public function transferActive() { return $this->morphMany( 'App\Transfer' , "transferable" )->where( "status" ,"approved" )->whereNull( "to_date" ); } }