codestudiohq / laravel-totem

Manage Your Laravel Schedule From A Web Dashboard
MIT License
1.79k stars 224 forks source link

N+1 problem #309

Closed usernotnull closed 2 years ago

usernotnull commented 2 years ago

I have Model::preventLazyLoading(app()->isLocal()); in my service provider to avoid n+1 issues.

When entering totem dashboard, I get

Attempted to lazy load [frequencies] on model [Studio\Totem\Task] but lazy loading is disabled. (View: /home/john/Sites/marvelcoding.com/vendor/studio/laravel-totem/resources/views/tasks/index.blade.php)

I can temporarily get around it by commenting out preventLazyLoading, but the solution is not optimal.

Is there a plan to resolve this issue?

qschmick commented 2 years ago

@usernotnull I don't have time immediately to tackle this, but if you're willing to open a PR we'd be happy to review and get a new version released. Otherwise we might get this fixed by EOY or early January

usernotnull commented 2 years ago

Alright. I have to finish a project first. If this wasn't resolved by January I'll give it a go. Thanks.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

qschmick commented 2 years ago

Thanks @locnguyen1842

FYI @usernotnull -> https://github.com/codestudiohq/laravel-totem/releases/tag/v8.3.2