-
-
Save jeffochoa/d67179af2b06e2b90c0b543fc8c0db72 to your computer and use it in GitHub Desktop.
Simple Blade components for your Laravel applications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MenuComponent | |
{ | |
public function __toString() | |
{ | |
// build your $menu data | |
return view('partials.menu', ['menu' => $menu])->render(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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