File tree 3 files changed +19
-3
lines changed
3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ Install via composer:
10
10
11
11
composer require tectonic/laravel-localisation
12
12
13
+ Publish the configuration
14
+
15
+ ``` shell
16
+ php artisan vendor:publish --provider=" Tectonic\LaravelLocalisation\ServiceProvider"
17
+ ```
13
18
## Documentation
14
19
15
20
You can view the rest of the documentation here: (https://github.com/tectonic/laravel-localisation/wiki )
Original file line number Diff line number Diff line change 4
4
/**
5
5
* Define the model you wish to use for any translation features.
6
6
*/
7
- 'model ' => \Tectonic \LaravelLocalisation \Database \Translation::class
7
+ 'model ' => \Tectonic \LaravelLocalisation \Database \Translation::class,
8
+
9
+ /**
10
+ * Define your custom transformers that will be used to transform the data.
11
+ */
12
+ 'transformers ' => [
13
+ //
14
+ ]
8
15
];
Original file line number Diff line number Diff line change @@ -76,11 +76,15 @@ private function registerTranslator()
76
76
{
77
77
$ this ->app ->scoped ('localisation.translator ' , function ($ app ) {
78
78
$ translatorEngine = new Engine ;
79
-
79
+
80
80
$ translatorEngine ->registerTransformer (
81
81
$ app ->make (ModelTransformer::class),
82
82
$ app ->make (CollectionTransformer::class),
83
- $ app ->make (PaginationTransformer::class)
83
+ $ app ->make (PaginationTransformer::class),
84
+ ...array_map (
85
+ fn ($ transformer ) => $ app ->make ($ transformer ),
86
+ $ app ['config ' ]->get ('localisation.transformers ' , [])
87
+ )
84
88
);
85
89
86
90
return $ translatorEngine ;
You can’t perform that action at this time.
0 commit comments