 d555c42644
			
		
	
	
		d555c42644
		
			
		
	
	
	
	
		
			
			* update composer.lock * run pint * fix phpstan * update migrations (sqlite `dropForeign`) * fix migrations * Reset these back for now * Alphabetize the rules * run `php artisan filament:upgrade` --------- Co-authored-by: Lance Pioch <git@lance.sh>
		
			
				
	
	
		
			31 lines
		
	
	
		
			706 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			706 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Http\Middleware;
 | |
| 
 | |
| use Illuminate\Http\Request;
 | |
| use Illuminate\Contracts\Routing\ResponseFactory;
 | |
| 
 | |
| class MaintenanceMiddleware
 | |
| {
 | |
|     /**
 | |
|      * MaintenanceMiddleware constructor.
 | |
|      */
 | |
|     public function __construct(private ResponseFactory $response) {}
 | |
| 
 | |
|     /**
 | |
|      * Handle an incoming request.
 | |
|      */
 | |
|     public function handle(Request $request, \Closure $next): mixed
 | |
|     {
 | |
|         /** @var \App\Models\Server $server */
 | |
|         $server = $request->attributes->get('server');
 | |
|         $node = $server->getRelation('node');
 | |
| 
 | |
|         if ($node->maintenance_mode) {
 | |
|             return $this->response->view('errors.maintenance');
 | |
|         }
 | |
| 
 | |
|         return $next($request);
 | |
|     }
 | |
| }
 |