PHP code example of clcbws / laravel-schema-sentinel
1. Go to this page and download the library: Download clcbws/laravel-schema-sentinel 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/ */
clcbws / laravel-schema-sentinel example snippets
use Sentinel\SchemaSentinel\Facades\Sentinel;
$diff = Sentinel::check(strict: true);
if ($diff->hasDifferences()) {
// Schema has drifted
$healthScore = $diff->getHealthScore();
$missingTables = $diff->missingTables;
}
$tables = Sentinel::parse(); // Returns array of TableDefinition DTOs
$results = Sentinel::standardizeIndexes();
// Returns array with 'deviations' and 'redundant' indexes