get(); } /** * 根据物品ID查找种子 * * @param int $itemId * @return FarmSeed|null */ public function findByItemId(int $itemId): ?FarmSeed { return FarmSeed::where('item_id', $itemId)->first(); } /** * 获取所有普通种子 * * @return Collection */ public function findNormalSeeds(): Collection { return FarmSeed::where('type', 1)->get(); } /** * 获取所有神秘种子 * * @return Collection */ public function findMysteriousSeeds(): Collection { return FarmSeed::where('type', 2)->get(); } /** * 获取所有巨化种子 * * @return Collection */ public function findGiantSeeds(): Collection { return FarmSeed::where('type', 3)->get(); } }