dcblogdev/laravel-sent-emails

Lazy loading since 2.0.5

Opened this issue · 2 comments

Since the latest version, the page throws lazy loading issue.

Can you provide more details on this issue?

I have configured Laravel to throw an error when lazy loading is detected. As a result, I'm encountering the following error with the newest version:

Attempted to lazy load [attachments] on model [Dcblogdev\LaravelSentEmails\Models\SentEmail] but lazy loading is disabled. (View: /xxx/vendor/dcblogdev/laravel-sent-emails/src/resources/views/index.blade.php)

I believe that a with statement should be added to this line in the SentEmailsController to load attachments together with emails. This will prevent n+1 query issues.