PHP code example of farzai / laravel-schema

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

    

farzai / laravel-schema example snippets


return [
    // Subdomain for Laravel Schema (optional)
    'domain' => env('SCHEMA_DOMAIN'),

    // URI path where the dashboard is accessible
    'path' => env('SCHEMA_PATH', 'schema'),

    // Route middleware
    'middleware' => ['web'],

    // Authorization settings
    'authorization' => [
        'enabled' => true,
        'gate' => 'viewLaravelSchema',
    ],

    // Path to migrations directory
    'migrations_path' => 'database/migrations',

    // Database connection (null = default)
    'connection' => null,

    // Tables to ignore during comparison
    'ignored_tables' => [
        'migrations',
        'password_reset_tokens',
        'sessions',
        'cache',
        'cache_locks',
        'jobs',
        'job_batches',
        'failed_jobs',
    ],
];

use Farzai\LaravelSchema\SchemaInspector;

public function boot(): void
{
    SchemaInspector::auth(function ($request) {
        return app()->environment('local') ||
               in_array($request->user()?->email, [
                   '[email protected]',
               ]);
    });
}
bash
php artisan vendor:publish --tag=laravel-schema-config
bash
php artisan vendor:publish --tag=laravel-schema-assets