PHP code example of onelearningcommunity / laravel-model-explorer

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

    

onelearningcommunity / laravel-model-explorer example snippets


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

return [
    // Set to false to disable entirely (e.g. force off in production regardless of gate)
    'enabled' => env('MODEL_EXPLORER_ENABLED', true),

    // URL prefix for all Model Explorer routes
    'path' => env('MODEL_EXPLORER_PATH', '_model-explorer'),

    // Middleware applied to all routes ('web' is ,
    ],

    // Traits whose FQN begins with these prefixes will be hidden in the UI
    'excluded_trait_prefixes' => [
        'Illuminate\Database\Eloquent\Concerns\\',
        'Illuminate\Database\Eloquent\HasCollection',
        'Illuminate\Support\Traits\\',
    ],
];
bash
php artisan vendor:publish --tag="model-explorer-config"