pedi2/app/Http/Middleware/Subpedido.php

24 lines
470 B
PHP
Raw Permalink Normal View History

<?php
namespace App\Http\Middleware;
use Closure;
class Subpedido
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
2022-01-11 17:24:46 -03:00
if (!session('subpedido_nombre') || !session('subpedido_id')) {
return redirect()->route('subpedidos.create');
}
return $next($request);
}
}