forked from nathalie/pedi2
24 lines
470 B
PHP
24 lines
470 B
PHP
<?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)
|
|
{
|
|
if (!session('subpedido_nombre') || !session('subpedido_id')) {
|
|
return redirect()->route('subpedidos.create');
|
|
}
|
|
return $next($request);
|
|
}
|
|
}
|