Skip to content

Instantly share code, notes, and snippets.

@jeffochoa jeffochoa/1.php Secret
Last active Jun 3, 2019

Embed
What would you like to do?
Simple Blade components for your Laravel applications
<?php
class MenuComponent
{
public function __toString()
{
// build your $menu data
return view('partials.menu', ['menu' => $menu])->render();
}
}
<?php
class MenuComponent
{
public static function make()
{
return new static();
}
public function __toString()
{
// build your $menu data
return view('partials.menu', ['menu' => $menu])->render();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.