rixgov

Experience

16,330

0 Best Reply Awards

  • Member Since 10 Months Ago
  • 162 Lessons Completed
  • 0 Favorites

17th July, 2017

rixgov started a new conversation How To Call Specific Entry From Array? • 1 week ago

I'm having trouble calling the "name" so i can save it to a variable. Something like activity->subject->owner->name?... can't figure it out.

Any help would be awesome, thanks!

{ "id": 11, "user_id": 552, "subject_id": 507, "subject_type": "App\Reply", "type": "created_reply", "created_at": "2017-07-17 22:16:23", "updated_at": "2017-07-17 22:16:23", "subject": { "id": 507, "thread_id": 54, "user_id": 552, "body": "TEST TEST TEST 123", "created_at": "2017-07-17 22:16:23", "updated_at": "2017-07-17 22:16:23", "owner": { "id": 552, "name": "Test Man", "email": "[email protected]", "photo_url": null, "uses_two_factor_auth": false,

}, "favorites": [] }

12th July, 2017

rixgov left a reply on TDD Forum: User Activities • 1 week ago

It seems like there must be a way to manipulate ProfilesController to cycle through all the activity, since Activity accepts each individual user, takes the id and matches that against the activities table. I just can't figure out where I'm going wrong. I should be able to simply cycle through each activity in the create_activities table, match/bind the user_id table to the Users table and create a list of activities by their owner.

rixgov left a reply on TDD Forum: User Activities • 1 week ago

Oh it's actually right out of Jeffrey's Forum TDD series

Here's the GitHub files.... activity is located in the App directory

Thanks :)

rixgov left a reply on TDD Forum: User Activities • 2 weeks ago

What if i passed the IDs over as a collection? ... just unsure of how to key it

     $otherUsers = $user->where('id', '!=', Auth::id())->get()->pluck('id');
     foreach($otherUsers as $otherUser) {
          return Activity::feed($otherUser, 50);

11th July, 2017

rixgov started a new conversation TDD Forum: User Activities • 2 weeks ago

Has anybody had any luck creating a feed with either all users, or all users except the current user? Just can't seem to get it to work with all the information already in MYSQL. Any suggestions?

Activity class:

public static function allFeed($user, $take = 50) //where $take = feed Activity count # { $otherUsers = $user->where('id', '!=', Auth::id())->get();

     return static::where('user_id', $otherUsers)
           ->latest()
           ->with('subject')
           ->take($take)
           ->get()
           ->groupBy(function ($activity) {
          return $activity->created_at->format('Y-m-d');
     });

}

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.