Skip to content

Commit

Permalink
Merge pull request #14 from pxthinh/feature/update_provider
Browse files Browse the repository at this point in the history
Feature/update provider
  • Loading branch information
tanhongit authored Oct 30, 2023
2 parents 979b3e7 + 551f6b5 commit 48be0fc
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 12 deletions.
61 changes: 52 additions & 9 deletions config/telegram-git-notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,81 @@

return [
'app' => [
'name' => env('APP_NAME', 'Laravel Telegram Git Notify'),
'url' => env('APP_URL', 'http://localhost:8000'),
'name' => env('TGN_APP_NAME', 'Laravel Telegram Git Notifier'),

// Required for the bot to work properly
'url' => env('TGN_APP_URL', 'http://localhost:8000'),
'timezone' => env('TIMEZONE', 'Asia/Ho_Chi_Minh'),
],

'bot' => [
'token' => env('TELEGRAM_BOT_TOKEN', ''),
'chat_id' => env('TELEGRAM_BOT_CHAT_ID', ''),
'notify_chat_ids' => explode(
',',
env('TELEGRAM_NOTIFY_CHAT_IDS', '')
),

/**
* Set the chat IDs that will receive notifications
* You can add the owner bot ID, group ID, ...
* -------------------------------------------------------
* Note:
* Please use semicolon ";" to separate chat ids
* And use a colon ":" to separate chat ID and thread ID
* And use comma "," if you want to add multiple thread IDs
* -------------------------------------------------------
* The environment variable is expected to be in the format:
* "chat_id1;chat_id2:thread_id2;chat_id3:thread_id3_1,thread_id3_2;...".
*/
'notify_chat_ids' => env('TELEGRAM_NOTIFY_CHAT_IDS', ''),
],

'author' => [
'discussion' => env('TGN_AUTHOR_CONTACT', 'https://t.me/tannp27'),
'discussion' => env(
'TGN_AUTHOR_DISCUSSION',
'https://github.com/lbiltech/laravel-telegram-git-notifier/discussions'
),
'source_code' => env(
'TGN_AUTHOR_SOURCE_CODE',
'https://github.com/lbiltech/laravel-telegram-git-notifier'
),
],

/** Set the path to the data file */
'data_file' => [
'setting' => env(
'TGN_PATH_SETTING',
storage_path('/app/json/tgn/tgn-settings.json')
),

'platform' => [
'gitlab' => env(
'TGN_PATH_PLATFORM_GITLAB',
storage_path('/app/json/tgn/gitlab-events.json')
),
'github' => env(
'TGN_PATH_PLATFORM_GITHUB',
storage_path('/app/json/tgn/github-events.json')
),
],
],

/** Set the path to the view file */
'view' => [
'event' => [
'default' => env(
'TGN_VIEW_DEFAULT',
base_path('resources/views/vendor/telegram-git-notifier')
),

'event' => [
'default' => env('TGN_VIEW_EVENT_DEFAULT', 'default'),
],

'globals' => [
'access_denied' => env(
'TGN_VIEW_GLOBALS_ACCESS_DENIED',
'globals.access_denied'
),
],
'tools' => [

'tools' => [
'settings' => env(
'TGN_VIEW_TOOL_SETTING',
'tools.settings'
Expand All @@ -53,4 +95,5 @@
),
],
],

];
10 changes: 7 additions & 3 deletions src/Providers/TelegramGitNotifierServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ public function boot(): void
$this->loadRoutesFrom($routePath);
}

$helperPath = __DIR__.'/../../common/helpers.php';
if (file_exists($helperPath)) {
require_once $helperPath;
$viewPath = __DIR__.'/../../resources/views';
if (file_exists($viewPath)) {
$this->loadViewsFrom($viewPath, 'telegram-git-notifier');
}

$this->publishes([
__DIR__.'/../../resources/views' => base_path('resources/views/vendor/telegram-git-notifier'),
], 'views');

$this->loadTranslationsFrom(__DIR__.'/../../lang', 'telegram-git-notifier');

$this->publishes([
Expand Down

0 comments on commit 48be0fc

Please sign in to comment.