app->when(AnimeFactory::class) ->needs(MediaModelFactoryDescriptor::class) ->give(AnimeModelFactoryDescriptor::class); $this->app->when(MangaFactory::class) ->needs(MediaModelFactoryDescriptor::class) ->give(MangaModelFactoryDescriptor::class); } }