for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Malezha\Menu\Render;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use Malezha\Menu\Contracts\MenuRender;
/**
* Class Blade
* @package Malezha\Menu\Render
*/
class Blade implements MenuRender
{
* @var Container
protected $container;
* @var Factory
protected $factory;
* @var View
protected $view = null;
* @inheritDoc
public function __construct(Container $container)
$this->container = $container;
$this->factory = $this->container->make(Factory::class);
}
public function make($view)
if (!$this->exists($view)) {
throw new \Exception('View not found');
$this->view = $this->factory->make($view);
return $this;
public function with($params, $value = null)
if (!is_null($this->view)) {
$this->view->with($params, $value);
public function render()
return $this->view->render();
return '';
* Determine if a given view exists.
*
* @param string $view
* @return bool
public function exists($view)
return $this->factory->exists($view);