@@ -34,7 +34,7 @@ public function boot()
34
34
*/
35
35
private function registerTranslationRepository ()
36
36
{
37
- $ this ->app ->singleton (TranslationRepository::class, function ($ app ) {
37
+ $ this ->app ->scoped (TranslationRepository::class, function ($ app ) {
38
38
$ model = $ app ['config ' ]->get ('localisation.model ' );
39
39
40
40
return new EloquentTranslationRepository (new $ model );
@@ -47,7 +47,7 @@ private function registerTranslationRepository()
47
47
*/
48
48
private function registerModelTransformer ()
49
49
{
50
- $ this ->app ->singleton (ModelTransformer::class, function ($ app ) {
50
+ $ this ->app ->scoped (ModelTransformer::class, function ($ app ) {
51
51
$ modelTransformer = new ModelTransformer ;
52
52
$ modelTransformer ->setTranslationRepository ($ app ->make (TranslationRepository::class));
53
53
@@ -61,7 +61,7 @@ private function registerModelTransformer()
61
61
*/
62
62
private function registerCollectionTransformer ()
63
63
{
64
- $ this ->app ->singleton (CollectionTransformer::class, function ($ app ) {
64
+ $ this ->app ->scoped (CollectionTransformer::class, function ($ app ) {
65
65
$ collectionTransformer = new CollectionTransformer ;
66
66
$ collectionTransformer ->setTranslationRepository ($ app ->make (TranslationRepository::class));
67
67
@@ -74,7 +74,7 @@ private function registerCollectionTransformer()
74
74
*/
75
75
private function registerTranslator ()
76
76
{
77
- $ this ->app ->singleton ('localisation.translator ' , function ($ app ) {
77
+ $ this ->app ->scoped ('localisation.translator ' , function ($ app ) {
78
78
$ translatorEngine = new Engine ;
79
79
80
80
$ translatorEngine ->registerTransformer (
0 commit comments