src/Traits/Favoriteable.php
/**
     * Return a collection with the Users who marked as favorite this Object.
     * 
     * @return Collection
     */
Return a collection with the Users who marked as favorite this Object.

@return Collection
Return a collection with the Users who marked as favorite this Object . @return Collection
public function favoritedBy()
    {
        return $this->favorites()
            ->with('user')
            ->get()
            ->mapWithKeys(function ($item) {
                return [$item['user']->id => $item['user']];
            });
    }
public function favoritedBy ( ) { return $ this -> favorites ( ) -> with ( 'user' ) -> get ( ) -> mapWithKeys ( function ( $ item ) { return [ $ item [ 'user' ] -> id => $ item [ 'user' ] ] ; } ) ; }
Return a collection with the Users who marked as favorite this Object.
Return a collection with the Users who marked as favorite this Object .