Recca0120\LaravelTracy\Debugbar::dispatchAssets PHP Method

dispatchAssets() public method

dispatchAssets.
public dispatchAssets ( ) : string
return string
    public function dispatchAssets()
    {
        ob_start();
        $this->bar->dispatchAssets();
        return ob_get_clean();
    }

Usage Example

Example #1
0
 /**
  * dispatchAssets.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 protected function dispatchAssets($request, $next)
 {
     $assets = $request->get('_tracy_bar');
     switch ($assets) {
         case 'css':
             $content = $this->debugbar->dispatchAssets();
             $headers = ['content-type' => 'text/css; charset=utf-8', 'cache-control' => 'max-age=86400'];
             break;
         case 'js':
         case 'assets':
             $content = $this->debugbar->dispatchAssets();
             $headers = ['content-type' => 'text/javascript; charset=utf-8', 'cache-control' => 'max-age=86400'];
             break;
         default:
             $this->storeWrapper->start();
             $this->storeWrapper->restore();
             $content = $this->debugbar->dispatchContent();
             $headers = ['content-type' => 'text/javascript; charset=utf-8'];
             $this->storeWrapper->clean($assets)->close();
             break;
     }
     return $this->responseFactory->make($content, 200, array_merge($headers, ['content-length' => strlen($content)]));
 }
All Usage Examples Of Recca0120\LaravelTracy\Debugbar::dispatchAssets