get ("type"); Log::info ("APInboxController@index"); Log::info (json_encode ($request->all ())); switch ($type) { case "Follow": $this->handle_follow ($user, $request->all ()); break; case "Undo": $this->handle_undo ($user, $request->all ()); break; case "Like": $this->handle_like ($user, $request->all ()); break; default: Log::info ("APInboxController@index"); Log::info ("Unknown type: " . $type); break; } } private function handle_follow (User $user, $activity) { ActivityFollowEvent::dispatch ($activity); } public function handle_undo (User $user, $activity) { ActivityUndoEvent::dispatch ($activity); } public function handle_like (User $user, $activity) { ActivityLikeEvent::dispatch ($activity); } }