PHP code example of martinbean / laravel-menu-builder
1. Go to this page and download the library: Download martinbean/laravel-menu-builder library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
martinbean / laravel-menu-builder example snippets
namespace App;
use Illuminate\Database\Eloquent\Model;
use MartinBean\MenuBuilder\Contracts\Navigatable as NavigatableContract;
class Page extends Model implements NavigatableContract
{
protected $table = 'pages';
}
namespace App;
use Illuminate\Database\Eloquent\Model;
use MartinBean\MenuBuilder\Contracts\Navigatable as NavigatableContract;
class Page extends Model implements NavigatableContract
{
protected $table = 'pages';
public function getTitle()
{
return $this->title;
}
public function getUrl()
{
return route('page.show', [$this->slug]);
}
}