This repository was archived by the owner on Jun 18, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +42
-5
lines changed
Expand file tree Collapse file tree 2 files changed +42
-5
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Dimsav \Translatable ;
4+
5+ use Illuminate \Contracts \Config \Repository as ConfigContract ;
6+ use Illuminate \Contracts \Translation \Translator as TranslatorContract ;
7+
8+ class Locales
9+ {
10+ /**
11+ * @var ConfigContract
12+ */
13+ protected $ config ;
14+
15+ /**
16+ * @var TranslatorContract
17+ */
18+ protected $ translator ;
19+
20+ public function __construct (ConfigContract $ config , TranslatorContract $ translator )
21+ {
22+ $ this ->config = $ config ;
23+ $ this ->translator = $ translator ;
24+ }
25+ }
Original file line number Diff line number Diff line change @@ -9,17 +9,29 @@ class TranslatableServiceProvider extends ServiceProvider
99 public function boot ()
1010 {
1111 $ this ->publishes ([
12- __DIR__ . '/../config/translatable.php ' => config_path ('translatable.php ' ),
12+ __DIR__ . '/../config/translatable.php ' => config_path ('translatable.php ' ),
1313 ], 'translatable ' );
1414 }
1515
16- /**
17- * Register the service provider.
18- */
1916 public function register ()
2017 {
2118 $ this ->mergeConfigFrom (
22- __DIR__ . '/../config/translatable.php ' , 'translatable '
19+ __DIR__ . '/../config/translatable.php ' , 'translatable '
2320 );
21+
22+ $ this ->registerTranslatableHelper ();
23+ }
24+
25+ public function registerTranslatableHelper ()
26+ {
27+ $ this ->app ->singleton ('translatable.locales ' , Locales::class);
28+ $ this ->app ->singleton (Locales::class);
29+ }
30+
31+ public function provides ()
32+ {
33+ return [
34+ 'translatable.helper ' ,
35+ ];
2436 }
2537}
You can’t perform that action at this time.
0 commit comments