55namespace DragonCode \LaravelActions \Helpers ;
66
77use DragonCode \Support \Facades \Helpers \Arr ;
8+ use Illuminate \Config \Repository ;
89
910use function base_path ;
10- use function config as appConfig ;
1111use function ltrim ;
1212use function rtrim ;
1313use function str_replace ;
1414
1515class Config
1616{
17+ public function __construct (
18+ protected Repository $ config
19+ ) {}
20+
1721 public function environment (): ?string
1822 {
19- return appConfig ('app.env ' , 'production ' );
23+ return $ this -> config -> get ('app.env ' , 'production ' );
2024 }
2125
2226 public function connection (): ?string
2327 {
24- return appConfig ('actions.connection ' );
28+ return $ this -> config -> get ('actions.connection ' );
2529 }
2630
2731 public function table (): string
2832 {
29- return appConfig ('actions.table ' );
33+ return $ this -> config -> get ('actions.table ' );
3034 }
3135
3236 public function exclude (): array
3337 {
34- return Arr::of ((array ) appConfig ('actions.exclude ' ))
38+ return Arr::of ((array ) $ this -> config -> get ('actions.exclude ' ))
3539 ->map (fn (string $ path ) => str_replace (['\\' , '/ ' ], DIRECTORY_SEPARATOR , $ path ))
3640 ->filter ()
3741 ->toArray ();
@@ -49,6 +53,6 @@ public function gitPath(): string
4953
5054 protected function directory (): string
5155 {
52- return appConfig ('actions.path ' , base_path ('actions ' ));
56+ return $ this -> config -> get ('actions.path ' , base_path ('actions ' ));
5357 }
5458}
0 commit comments