where ("user_id", "!=", null)->first (); if (!$actor) return response ()->json ([ "error" => "Actor not found" ], 404); $request = request (); $type = $request->get ("type"); Log::info ("APInboxController@index"); Log::info (json_encode ($request->all ())); switch ($type) { case "Follow": $this->handle_follow ($actor, $request->all ()); break; case "Undo": $this->handle_undo ($actor, $request->all ()); break; case "Like": $this->handle_like ($actor, $request->all ()); break; default: Log::info ("APInboxController@index"); Log::info ("Unknown type: " . $type); break; } } private function handle_follow (Actor $actor, $activity) { ActivityFollowEvent::dispatch ($activity); } public function handle_undo (Actor $actor, $activity) { ActivityUndoEvent::dispatch ($activity); } public function handle_like (Actor $actor, $activity) { ActivityLikeEvent::dispatch ($activity); } }