Skip to content

Commit

Permalink
Merge pull request #8 from mrvnklm/patch-1
Browse files Browse the repository at this point in the history
trigger scan in queue from ManageTranslations.php
  • Loading branch information
3x1io authored May 22, 2024
2 parents 1a7f7fc + 09bd56f commit cdc1488
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Resources/TranslationResource/Pages/ManageTranslations.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Illuminate\Http\Request;
use TomatoPHP\FilamentTranslations\Exports\TranslationsExport;
use TomatoPHP\FilamentTranslations\Imports\TranslationsImport;
use TomatoPHP\FilamentTranslations\Jobs\ScanJob;
use TomatoPHP\FilamentTranslations\Services\SaveScan;
use TomatoPHP\FilamentTranslations\Resources\TranslationResource;
use Filament\Notifications\Notification;
Expand Down Expand Up @@ -85,8 +86,13 @@ public function import(array $data)

public function scan()
{
$scan = new SaveScan();
$scan->save();
if(config('filament-translations.use_queue_on_scan')){
dispatch(new ScanJob());
}
else {
$scan = new SaveScan();
$scan->save();
}

Notification::make()
->title(trans('filament-translations::translation.loaded'))
Expand Down

0 comments on commit cdc1488

Please sign in to comment.