1. Go to this page and download the library: Download novius/laravel-nova-menu 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/ */
novius / laravel-nova-menu example snippets
namespace App\Providers;
use Novius\LaravelNovaMenu\LaravelNovaMenuService;
class AppServiceProvider extends ServiceProvider
{
// ...
public function boot()
{
/**
* @var LaravelNovaMenuService $menu
*/
$menu = $this->app->get('laravel-nova-menu');
$menu->setTreeUsing(function(Menu $menu, array $tree) {
// ... your actions on tree
return $tree;
});
}
}
namespace App\Providers;
use Novius\LaravelNovaMenu\LaravelNovaMenuService;
class AppServiceProvider extends ServiceProvider
{
// ...
public function boot()
{
/**
* @var LaravelNovaMenuService $menu
*/
$menu = $this->app->get('laravel-nova-menu');
$menu->setBuildTreeUsing(function(Collection $items) {
// ... your actions to build tree as an array
return $tree;
});
}
}
sh
php artisan migrate
sh
php artisan vendor:publish --provider="Novius\LaravelNovaMenu\LaravelNovaMenuServiceProvider" --tag="config"
sh
php artisan vendor:publish --provider="Novius\LaravelNovaMenu\LaravelNovaMenuServiceProvider" --tag="views"
sh
php artisan vendor:publish --provider="Novius\LaravelNovaMenu\LaravelNovaMenuServiceProvider" --tag="views"
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.