<?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 ,
],
// Model classes matching these patterns are hidden, even inside a scanned path.
// Entries match the FQCN and may use `*` as a wildcard (leading `\` is ignored).
'excluded_models' => [
// 'Laravel\\Telescope\\*',
// 'App\\Models\\Internal\\AuditLog',
],
// 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\\',
],
// Related records shown per page when drilling into a to-many relation,
// and the cap on collection-returning accessor values.
'per_page' => env('MODEL_EXPLORER_PER_PAGE', 15),
// Cache model discovery and inspection results (recommended for large apps).
// Disabled by default so model changes appear immediately during development.
'cache' => [
'enabled' => env('MODEL_EXPLORER_CACHE', false),
'store' => env('MODEL_EXPLORER_CACHE_STORE'), // null = default store
'ttl' => env('MODEL_EXPLORER_CACHE_TTL'), // seconds; null = forever
],
];