Support the ongoing development of Laravel.io →
Configuration Architecture Installation

I'm building a kiosk app which centers around managing footage which is stored on a shared drive.

If the drive isn't there, pretty much most of the app won't run, so I need to test for the drive before all requests, and if not found, redirect to a "setup" page.

Where would be the best place to do this?

I tried in my AppServiceProvider->boot() method, but the redirect didn't work.

My next thought was middleware, but the drive existing is not really a function of the Request.

Where should I do this?

Thanks.

Last updated 3 years ago.
0

I solved the problem using middleware in the end:

  1. Add new Setup middleware class and entry in HttpKernel middleware array
  2. Check for existence of paths in middleware class
  3. If not found, and the route name is not already admin/setup (or else we get into a loop) return a redirect to admin/setup
  4. in admin/setup controller, run the setup logic and load a view

Is a reasonably straightforward solution.

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.