PHP code example of haakco / laravel-postgres-helper
1. Go to this page and download the library: Download haakco/laravel-postgres-helper 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/ */
haakco / laravel-postgres-helper example snippets
// Update all functions manually
PgHelperLibrary::updateDateColumnsDefault();
PgHelperLibrary::addUpdateUpdatedAtColumn();
PgHelperLibrary::addUpdateUpdatedAtColumnForTables();
PgHelperLibrary::addFixAllSeq();
PgHelperLibrary::addFixDb();
use HaakCo\PostgresHelper\Libraries\PgHelperLibrary;
// Fix all sequences after inserting records with explicit IDs
PgHelperLibrary::fixAll();
// Fix only specific tables (much faster)
PgHelperLibrary::fixSequences(['users', 'permissions']);
// Fix triggers for tables with updated_at columns
PgHelperLibrary::fixTriggers(['users', 'posts']);
// Run comprehensive health check
$health = PgHelperLibrary::runHealthCheck();
echo "Database health: {$health['overall_score']}%";
// Validate table structure
$validation = PgHelperLibrary::validateStructure();
if (!$validation['valid']) {
// Handle validation errors
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.