PHP code example of phpexperts / postgres-for-laravel
1. Go to this page and download the library: Download phpexperts/postgres-for-laravel 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/ */
phpexperts / postgres-for-laravel example snippets
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use PHPExperts\PostgresForLaravel\PostgresMigrationHelper;
class UseNativePostgresTimestamps extends Migration
{
private const TABLES = [
'packages',
];
public function up(): void
{
PostgresMigrationHelper::addPostgresTimestamps(static::TABLES);
}
public function down(): void
{
PostgresMigrationHelper::dropPostgresTimestamps(static::TABLES, PostgresMigrationHelper::DEFAULT_TIMESTAMPS);
}
}