Configure separate `read` and `write` hosts in the connection definition, usually in `config/database.php`: ```php 'mysql' => [ 'driver' => 'mysql', 'read' => ['host' => [env('DB_READ_HOST')]], 'write' => ['host' => [env('DB_WRITE_HOST')]], 'sticky' => true, // shared database name, credentials, and options... ], ``` Laravel routes SELECT queries to the read connection and writes to the write connection; no application query rewrite should be needed. `sticky` can keep reads in the same reques...
Scanned 9/5/2026
Install to Claude Code
npx -y skills add HoangNguyen0403/agent-skills-standard --skill laravel-database-expert --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Laravel Database Expert?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-laravel-database-expert-55346e18)More formats (shields.io, HTML) on the badges page.
Configure separate `read` and `write` hosts in the connection definition, usually in `config/database.php`:
```php
'mysql' => [
'driver' => 'mysql',
'read' => ['host' => [env('DB_READ_HOST')]],
'write' => ['host' => [env('DB_WRITE_HOST')]],
'sticky' => true,
// shared database name, credentials, and options...
],
```
Laravel routes SELECT queries to the read connection and writes to the write connection; no application query rewrite should be needed. `sticky` can keep reads in the same request on the write connection after a write, reducing replica-lag surprises. Access environment values through configuration in application code, cache configuration after deployment, and verify the actual connection routing and replica health before relying on it.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!