user; $policys = Followable::mine()->where('followable_type', 'App\Models\Policy')->paginate(); $articles = Followable::mine()->where('followable_type', 'App\Models\Article')->paginate(); $explains = Followable::mine()->where('followable_type', 'App\Models\Explain')->paginate(); $data = [ 'policys' => FavoriteResource::collection($policys), 'articles' => FavoriteResource::collection($articles), 'explains' => FavoriteResource::collection($explains), ]; return [ 'status' => 'SUCCESS', 'status_code' => 0, 'data' => $data, ]; // $type = $request->type ?? 'Policy'; // $lists = Followable::mine()->where('followable_type', 'like', "%$type")->paginate(); // return FavoriteResource::collection($lists)->additional([ // 'status' => 'SUCCESS', // 'status_code' => 0, // ]); } }