55use Akaunting \Setting \Drivers \Database ;
66use Akaunting \Setting \Drivers \Json ;
77use Akaunting \Setting \Drivers \Memory ;
8- use Illuminate \Foundation \Application ;
98use Illuminate \Support \Manager as BaseManager ;
10- use Illuminate \Support \Str ;
119
1210class Manager extends BaseManager
1311{
1412 /**
15- * Normalized Laravel Version .
13+ * The container instance .
1614 *
17- * @var string
15+ * @var \Illuminate\Contracts\Container\Container
1816 */
19- protected $ version ;
17+ protected $ container ;
2018
2119 /**
22- * True when this is a Lumen application.
20+ * The application instance .
2321 *
24- * @var bool
25- */
26- protected $ is_lumen = false ;
27-
28- /**
29- * @param Application $app
22+ * @param \Illuminate\Contracts\Foundation\Application $app
3023 */
3124 public function __construct ($ app = null )
3225 {
33- if (!$ app ) {
34- $ app = app (); //Fallback when $app is not given
35- }
36-
37- parent ::__construct ($ app );
26+ $ this ->container = $ app ?? app ();
3827
39- $ this ->version = $ app ->version ();
40- $ this ->is_lumen = Str::contains ($ this ->version , 'Lumen ' );
28+ parent ::__construct ($ this ->container );
4129 }
4230
4331 public function getDefaultDriver ()
@@ -49,12 +37,12 @@ public function createJsonDriver()
4937 {
5038 $ path = config ('setting.json.path ' );
5139
52- return new Json ($ this ->app ['files ' ], $ path );
40+ return new Json ($ this ->container ['files ' ], $ path );
5341 }
5442
5543 public function createDatabaseDriver ()
5644 {
57- $ connection = $ this ->app ['db ' ]->connection (config ('setting.database.connection ' ));
45+ $ connection = $ this ->container ['db ' ]->connection (config ('setting.database.connection ' ));
5846 $ table = config ('setting.database.table ' );
5947 $ key = config ('setting.database.key ' );
6048 $ value = config ('setting.database.value ' );
0 commit comments