PHP code example of mauro-pinheiro / laravel-adminlte
1. Go to this page and download the library: Download mauro-pinheiro/laravel-adminlte 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/ */
mauro-pinheiro / laravel-adminlte example snippets
namespace MyApp;
use JeroenNoten\LaravelAdminLte\Menu\Builder;
use JeroenNoten\LaravelAdminLte\Menu\Filters\FilterInterface;
use Laratrust;
class MyMenuFilter implements FilterInterface
{
public function transform($item, Builder $builder)
{
if (isset($item['permission']) && ! Laratrust::can($item['permission'])) {
return false;
}
return $item;
}
}
'filters' => [
JeroenNoten\LaravelAdminLte\Menu\Filters\ActiveFilter::class,
JeroenNoten\LaravelAdminLte\Menu\Filters\HrefFilter::class,
JeroenNoten\LaravelAdminLte\Menu\Filters\SubmenuFilter::class,
JeroenNoten\LaravelAdminLte\Menu\Filters\ClassesFilter::class,
//JeroenNoten\LaravelAdminLte\Menu\Filters\GateFilter::class, Comment this line out
MyApp\MyMenuFilter::class,
]
use Illuminate\Contracts\Events\Dispatcher;
use JeroenNoten\LaravelAdminLte\Events\BuildingMenu;
class AppServiceProvider extends ServiceProvider
{
public function boot(Dispatcher $events)
{
$events->listen(BuildingMenu::class, function (BuildingMenu $event) {
$event->menu->add('MAIN NAVIGATION');
$event->menu->add([
'text' => 'Blog',
'url' => 'admin/blog',
]);
});
}
}