{"id":18504214,"url":"https://github.com/phpexpertsinc/postgresforlaravel","last_synced_at":"2025-05-14T08:11:18.882Z","repository":{"id":212566638,"uuid":"731795397","full_name":"PHPExpertsInc/PostgresForLaravel","owner":"PHPExpertsInc","description":"A utility library for ease of using PostgreSQL with Laravel.","archived":false,"fork":false,"pushed_at":"2023-12-15T00:02:47.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-22T23:45:38.562Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PHPExpertsInc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-14T22:37:32.000Z","updated_at":"2023-12-14T23:36:40.000Z","dependencies_parsed_at":"2023-12-15T00:46:27.621Z","dependency_job_id":null,"html_url":"https://github.com/PHPExpertsInc/PostgresForLaravel","commit_stats":null,"previous_names":["phpexpertsinc/postgresforlaravel"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPExpertsInc%2FPostgresForLaravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPExpertsInc%2FPostgresForLaravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPExpertsInc%2FPostgresForLaravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPExpertsInc%2FPostgresForLaravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PHPExpertsInc","download_url":"https://codeload.github.com/PHPExpertsInc/PostgresForLaravel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101559,"owners_count":22014908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T14:03:31.410Z","updated_at":"2025-05-14T08:11:13.829Z","avatar_url":"https://github.com/PHPExpertsInc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postgres For Laravel Library\n\n[![TravisCI]()]()\n[![Maintainability]()]()\n[![Test Coverage]()]()\n\nPostgres For Laravel is a PHP Experts, Inc., Project meant to ease the use of the PostgreSQL database in Laravel.\n\n## Installation\n\nVia Composer\n\n```bash\ncomposer require phpexperts/postgres-for-laravel\n```\n\n## Usage\n\nThe library should be ready to be used immediately after including via composer.\n\n### PostgreSQL Timestamps\n\nPostgres' timestamp support is extremely suprior to MySQL's. Yet, Laravel only supports the dumbed-down timestamps\nby default. For best performance -including- both timezone-aware and millisecond resolution timestamps, it is best\nto let POstgres itself handle every table's timestamps. To do this, do the following:\n\n      vendor   |       project        |         created_at         |         updated_at\n    ------------+----------------------+----------------------------+----------------------------\n    phpexperts | simple-dto           | 2020-04-30 23:35:00        | 2023-07-18 19:08:47\n    phpexperts | rest-speaker         | 2023-07-30 09:35:53        | 2023-07-30 09:37:37\n    phpexperts | postgres-for-laravel | 2023-12-14 17:58:46.381623 | 2023-12-14 17:58:46.417537\n\n\n**Automatic Autowiring**\n\n1. Extend every model from PHPExperts\\PostgresForLaravel\\PostgresModel.\n2. Run `./artisan migrate`\n\n**Manual Wiring** \n\n1. Add `public $timestamps = false;` to your Model.\n2. Create a new migration: `./artisan make:migration use_native_postgres_timestamps`\n3. Add the following code to the migration:\n\n```php\n\u003c?php declare(strict_types=1);\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse PHPExperts\\PostgresForLaravel\\PostgresMigrationHelper;\n\nclass UseNativePostgresTimestamps extends Migration\n{\n    private const TABLES = [\n        'packages',\n    ];\n\n    public function up(): void\n    {\n        PostgresMigrationHelper::addPostgresTimestamps(static::TABLES);\n    }\n\n    public function down(): void\n    {\n        PostgresMigrationHelper::dropPostgresTimestamps(static::TABLES, PostgresMigrationHelper::DEFAULT_TIMESTAMPS);\n    }\n}\n```\n\n## Use cases\n\n ✔ Use PostgreSQL native timestamp generation code.  \n\n## Testing\n\n```bash\nphpunit --testdox\n```\n\n## Contributors\n\n[Theodore R. Smith](https://www.phpexperts.pro/]) \u003ctheodore@phpexperts.pro\u003e  \nGPG Fingerprint: 4BF8 2613 1C34 87AC D28F  2AD8 EB24 A91D D612 5690  \nCEO: PHP Experts, Inc.\n\n## License\n\nMIT license. Please see the [license file](LICENSE) for more information.\n:wq\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpexpertsinc%2Fpostgresforlaravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpexpertsinc%2Fpostgresforlaravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpexpertsinc%2Fpostgresforlaravel/lists"}