PHP code example of lopatin96 / laravel-navigation

1. Go to this page and download the library: Download lopatin96/laravel-navigation 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/ */

    

lopatin96 / laravel-navigation example snippets


@

@

@

@

public function boot(): void
{
    …

    Gate::define('admin_area', static function (User $user) {
        return $user->isAdmin();
    });

    Gate::define('pro_area', static function (User $user) {
        return $user->subscribed();
    });

    Gate::define('true_area', static function (User $user) {
        return true;
    });

    Gate::define('false_area', static function (User $user) {
        return false;
    });
}

php artisan vendor:publish --tag="laravel-navigation-lang"

php artisan vendor:publish --tag="laravel-navigation-views"

php artisan vendor:publish --tag="laravel-navigation-config"