Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Oci8

Laravel Oci8 Laravel Package

yajra/laravel-oci8

Laravel-OCI8 is an Oracle database driver for Laravel that uses the OCI8 PHP extension to communicate with Oracle. It extends Illuminate/Database, adding Oracle connectivity and query support, with compatibility from Laravel 5.1 through 13.

View on GitHub
Deep Wiki
Context7

Laravel-OCI8 is an Oracle Database driver for Laravel built on top of Illuminate/Database. It uses the OCI8 PHP extension to communicate with Oracle, letting you use Laravel's familiar query builder, Eloquent ORM, and migrations against Oracle databases.

  • Supports Laravel 5.1 through 13.x
  • Seamless Eloquent and query builder integration
  • Optional service provider (auto-discovered on 5.5+)
  • Includes a PHPStan/Larastan extension for OCI8-specific DB methods
  • Install via Composer: composer require yajra/laravel-oci8:^13
Frequently asked questions about Laravel Oci8
How do I install yajra/laravel-oci8 in a Laravel application?
Run composer require yajra/laravel-oci8:^13, choosing the package version that matches your Laravel release. Install and enable the OCI8 PHP extension plus Oracle Instant Client libraries first. On Laravel 5.5+ the Oci8ServiceProvider is auto-discovered; older versions require manual registration, then add an oracle connection in config/database.php.
Which Laravel versions does yajra/laravel-oci8 support?
The package ships matching releases for Laravel 5.1 through 13.x, so pick the package version aligned with your framework version. Test migrations and edge cases on your exact Laravel and Oracle combination, since third-party packages may assume MySQL or PostgreSQL behavior.
How do I configure an Oracle connection in Laravel's config/database.php?
Add an entry with driver set to oracle and include host, port, database (service name or SID), username, password, charset, and optional prefix or schema. You can override credentials at runtime with callbacks for multi-tenant or role-based Oracle access. Keep TNS and pooling settings aligned with your Oracle client configuration.
Do I need the OCI8 PHP extension to use Oracle with Laravel?
Yes. Install it with pecl install oci8 or your platform package and enable it in php.ini, and make sure it matches your Oracle client version, using 12c or newer for JSON support. Version mismatches can cause connection errors or SQL syntax failures.
Does yajra/laravel-oci8 support Laravel migrations and the schema builder?
Yes, it extends Illuminate/Database to provide Oracle-specific grammar and schema handling for migrations. Watch Oracle's 30-character identifier limit (128 in 12c+) and use IDENTITY columns or sequences instead of AUTO_INCREMENT. Prefix management via DB_PREFIX_SCHEMA can help avoid naming conflicts.
How does yajra/laravel-oci8 handle JSON columns?
JSON is read-only on Oracle 12c+ through this driver, and updates require replacing the full document. Recent releases improve nested JSON path compilation for functions such as JSON_LENGTH. Test mixed read and write JSON code paths explicitly in staging.
Can I use Laravel soft deletes and timestamps with Oracle?
Yes, but Oracle defaults to case-sensitive queries and trigger-based deleted_at soft deletes can fail if triggers are scoped incorrectly. Define timestamps and nullable columns explicitly in migrations. Verify behavior for packages that assume MySQL timestamp semantics.
How do I set up yajra/laravel-oci8 in Lumen?
Lumen does not auto-discover the service provider, so manually register Oci8ServiceProvider and add the oracle connection array to config/database.php. Confirm the OCI8 extension and Oracle client libraries are installed in the Lumen runtime. Then test migrations and Eloquent queries as you would in Laravel.
Does yajra/laravel-oci8 support PHPStan and Larastan?
Yes, the package includes an optional PHPStan/Larastan extension for OCI8-specific DB methods. Include vendor/yajra/laravel-oci8/extension.neon in your phpstan.neon to have those methods recognized. This improves static analysis for Oracle-only calls without changing runtime behavior.
What are the alternatives to yajra/laravel-oci8 for Oracle in Laravel?
yajra/laravel-oci8 is the de facto Oracle driver because it extends Illuminate/Database with grammar, schema, and migration support. Alternatives such as raw OCI8 code or PDO_OCI wrappers lack Laravel's query builder and migration integration. Custom drivers require significant work to match Eloquent and schema behavior.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle