matchish / laravel-scout-elasticsearch

Search among multiple models with ElasticSearch and Laravel Scout
MIT License
712 stars 115 forks source link

Mail view gets dumped in console when running import command [BUG] #115

Open denitsa-md opened 4 years ago

denitsa-md commented 4 years ago

Describe the bug

When running php artisan scout:import I'm seeing my mail templates get dumped in the console.

To Reproduce

I have this mail view:

app\Domain\Reports\Mail\views\report-generated.blade.php

@component('mail::message')
# Your report is ready

Find it attached in this email.

Best Regards,<br>
{{ config('app.name') }}
@endcomponent

The directory for that view is registered in AppServiceProvider like:

View::addNamespace('report_views', app_path('Domain/Reports/Mail/views'));

This happens when I run php artisan scout:import. Notice how the view gets dumped at the start of the command.

php artisan scout:import
@component('mail::message')
# Your report is ready

Find it attached in this email.

Best Regards,<br>
{{ config('app.name') }}
@endcomponent
Importing [App\Domain\Products\Models\Product]
Switching to the new index
5/5 [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬] 100%

 [OK] All [App\Domain\Products\Models\Product] records have been imported.

Importing [App\Domain\VendorsAndPublishers\Models\Publisher]
Switching to the new index
5/5 [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬] 100%

 [OK] All [App\Domain\VendorsAndPublishers\Models\Publisher] records have been imported.

Importing [App\Domain\VendorsAndPublishers\Models\Vendor]
Switching to the new index
5/5 [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬] 100%

 [OK] All [App\Domain\VendorsAndPublishers\Models\Vendor] records have been imported.

I haven't experienced this with other commands so I wonder what might be causing this.

matchish commented 4 years ago

For someone who wants to help. First of all we need fail test. We have to upload the mail view to test application https://github.com/matchish/laravel-scout-elasticsearch/tree/master/tests/laravel/app Then we have to register the namespace in new service provider and add it here https://github.com/matchish/laravel-scout-elasticsearch/blob/f65731880ac8c2c42c6790e8917550cdca8e30ab/tests/TestCase.php#L44 If we are lucky enough it will break some tests) If no then testing framework doesn't cover this issue and we have to debug it in a real laravel application