Skip to content

Commit

Permalink
Added Htmlable interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiandedeyne committed Apr 4, 2016
1 parent 87aee36 commit 3b35187
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace Spatie\Menu\Laravel;

use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Traits\Macroable;
use Illuminate\Contracts\Auth\Access\Gate;
use Spatie\Menu\Item;
use Spatie\Menu\Menu as BaseMenu;

class Menu extends BaseMenu
class Menu extends BaseMenu implements Htmlable
{
use Macroable;

Expand Down Expand Up @@ -193,4 +194,12 @@ public function routeIfCan($authorization, string $name, string $text, array $pa
{
return $this->addIfCan($authorization, Link::route($name, $text, $parameters, $absolute, $route));
}

/**
* @return string
*/
public function toHtml() : string
{
return $this->render();
}
}

0 comments on commit 3b35187

Please sign in to comment.