Server : Apache System : Linux host44.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64 User : vapecompany ( 2719) PHP Version : 7.4.33 Disable Function : NONE Directory : /home/vapecompany/demo.vapecompany.com.bd/vendor/laravel/framework/src/Illuminate/View/Middleware/ |
Upload File : |
<?php namespace Illuminate\View\Middleware; use Closure; use Illuminate\Contracts\View\Factory as ViewFactory; use Illuminate\Support\ViewErrorBag; class ShareErrorsFromSession { /** * The view factory implementation. * * @var \Illuminate\Contracts\View\Factory */ protected $view; /** * Create a new error binder instance. * * @param \Illuminate\Contracts\View\Factory $view * @return void */ public function __construct(ViewFactory $view) { $this->view = $view; } /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { // If the current session has an "errors" variable bound to it, we will share // its value with all view instances so the views can easily access errors // without having to bind. An empty bag is set when there aren't errors. $this->view->share( 'errors', $request->session()->get('errors') ?: new ViewErrorBag ); // Putting the errors in the view for every view allows the developer to just // assume that some errors are always available, which is convenient since // they don't have to continually run checks for the presence of errors. return $next($request); } }