Skip to content

Commit 5c037f4

Browse files
committed
Fix missing loading of telegram.php route file
1 parent d6a98bf commit 5c037f4

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

routes/telegram.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
*/
1515

1616
$bot->onCommand('start', function (Nutgram $bot) {
17-
return $bot->sendMessage('Hello, world!');
17+
$bot->sendMessage('Hello, world!');
1818
})->description('The start command!');

src/NutgramServiceProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public function boot(): void
101101

102102
$this->publishes([
103103
self::CONFIG_PATH => config_path('nutgram.php'),
104+
self::ROUTES_PATH => $this->telegramRoutes,
104105
], 'nutgram');
105106
}
106107

tests/Feature/ProviderTest.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\File;
4+
use Nutgram\Laravel\NutgramServiceProvider;
5+
6+
it('publishes files', function () {
7+
File::delete(base_path('routes/telegram.php'));
8+
9+
$this->artisan('vendor:publish', [
10+
'--provider' => NutgramServiceProvider::class,
11+
'--tag' => 'nutgram',
12+
]);
13+
14+
expect(File::exists(config_path('nutgram.php')))->toBeTrue()
15+
->and(File::exists(base_path('routes/telegram.php')))->toBeTrue();
16+
});

0 commit comments

Comments
 (0)