question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] web_middleware list causes errors

See original GitHub issue

In https://github.com/Laravel-Backpack/CRUD/issues/3094, @pxpm gave me some suggestions about this.

However when I check the code, I still feel confused.

In https://github.com/Laravel-Backpack/CRUD/blob/master/src/config/backpack/base.php, there are two middleware groups, one is admin, and another one is web.

As you can see, in https://github.com/Laravel-Backpack/CRUD/blob/master/src/routes/backpack/custom.php, the route loads both web and admin middleware groups.

So the problem is, @pxpm 's solution works for the admin middleware group only, if I want to make a custom array for web middleware in /config/backpack/base.php, it would cause errors. And also, modifying web_middleware to array object is what the code recommends me to do (please look the comments in the code)

https://github.com/Laravel-Backpack/CRUD/blob/d9e6201350260006ecbf4dec087a8c7639666eaf/src/config/backpack/base.php#L178-L222

_Originally posted by @hirakujira in https://github.com/Laravel-Backpack/CRUD/issues/3094#issuecomment-669015458_

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pxpmcommented, Aug 20, 2020

@hirakujira Thank you very much for submitting the bug report.

Indeed at first I did not fully understand your question, my bad, sorry for that.

I acknowledge the error your are facing and submited a PR: #3134 that I think would fix this.

It would be super if you could try out my solution on that PR and let me know there if it fixed your problem.

Do not forget php artisan config:cache and php artisan cache:clear just to make sure you pick up the correct config.

I am going to close this as we have a solution for it in #3134 and it’s better to keep any discussion related with this in that thread.

Once again, sorry for not understanding at first your issue and for the frustration of following the documentation and it didn’t work.

Hope we fix this for good 😃

Wish you the best, Pedro

0reactions
hirakujiracommented, Aug 22, 2020

@hirakujira Thank you very much for submitting the bug report.

Indeed at first I did not fully understand your question, my bad, sorry for that.

I acknowledge the error your are facing and submited a PR: #3134 that I think would fix this.

It would be super if you could try out my solution on that PR and let me know there if it fixed your problem.

Yes this fixed the issue. Thank you so much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Laravel 5.3 middleware execution order bug - Stack Overflow
I'm having a problem: No matter what I do, the auth middleware is ALWAYS executed before other middlewares! Here's what I tried: Created...
Read more >
Error Logging Middleware in ASP.NET Core - elmah.io Blog
Using middleware in ASP.NET Core, implementing custom error logging has never been easier. Learn how to log all crashes to files and much ......
Read more >
Troubleshooting Errors and Performance Issues in Laravel
You'll learn about how Laravel handles log tracking and errors, and how you can enhance the performance of your Laravel-based application.
Read more >
Handling errors in ASP.NET Core Web API - DevTrends
Handling errors in an ASP.NET Core Web API. This post looks at the best ways to handle exceptions, validation and other invalid requests...
Read more >
Error handling - Apollo GraphQL Docs
Error handling · Making errors actionable on the client and server · Built-in error codes · Custom errors · Throwing errors · Omitting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found