Skip to content

Commit d1ef09e

Browse files
committed
Test Laravel and Lumen Support
1 parent 8d2a14a commit d1ef09e

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"php": "^8.0",
1414
"ext-pdo": "*",
1515
"laravel/helpers": "^1.5",
16-
"illuminate/console": "~5.8.0|^6.0|^7.0|^8.0|^9.0"
16+
"illuminate/console": "~5.8.0|^6.0|^7.0|^8.0|^9.0",
17+
"illuminate/support": "^5.5|^6.0|^7.0|^8.0|^9.0"
1718
},
1819
"autoload": {
1920
"psr-4": {

src/DatabaseRepositoryServiceProvider.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
use Nanvaie\DatabaseRepository\Commands\MakeRepository;
1212
use Nanvaie\DatabaseRepository\Commands\MakeResource;
1313
use Illuminate\Support\ServiceProvider;
14+
use Laravel\Lumen\Application as LumenApplication;
15+
use Illuminate\Foundation\Application as LaravelApplication;
1416

1517
/**
16-
* Laravel service provider for DatabaseRepositor.
17-
*
18+
* Laravel service provider for DatabaseRepository.
1819
*/
1920
class DatabaseRepositoryServiceProvider extends ServiceProvider
2021
{
@@ -28,13 +29,15 @@ class DatabaseRepositoryServiceProvider extends ServiceProvider
2829
*/
2930
public function boot()
3031
{
31-
if ($this->app->runningInConsole()) {
32+
if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
3233
$this->publishes([
33-
__DIR__ . '/Config/' . self::CONFIG_FILE => config_path(self::CONFIG_FILE),
34-
], 'config');
35-
36-
$this->register();
34+
__DIR__.'/config/' . self::CONFIG_FILE => config_path(self::CONFIG_FILE),
35+
], 'telegram-config');
36+
} elseif ($this->app instanceof LumenApplication) {
37+
$this->app->configure('telegram');
3738
}
39+
40+
$this->register();
3841
}
3942

4043
/**

0 commit comments

Comments
 (0)