<?php namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\DB; use App\Models\Setting; class CheckMaintenanceMode { public function handle($request, Closure $next) { $maintenanceMode = site_setting('maintains_mode'); // dd($maintenanceMode); if ($maintenanceMode == 'true') { return redirect()->route('maintainMode'); } else{ return $next($request); } } }