Файловый менеджер - Редактировать - /home/clickysoft/public_html/travel-guru.clickysoft.net/app/Http/Middleware/ValidateHotLunch.php
Назад
<?php namespace App\Http\Middleware; use App\Models\HotLunch; use Carbon\Carbon; use Closure; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; class ValidateHotLunch { public function handle($request, Closure $next, $guard = null) { $now = Carbon::now()->format('Y-m-d'); $hotLunch = HotLunch::where('reg_starts', '<=', $now) ->where('reg_ends', '>=', $now) ->where('status', 1) ->first(); $userCart = Session::get('user_cart'); if(empty($userCart) || $hotLunch->id !== (int)$userCart['hot_lunch_id']){ return redirect('/'); } return $next($request); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка