PHPackages                             jfelder/oracledb - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. jfelder/oracledb

ActiveLibrary[Database &amp; ORM](/categories/database)

jfelder/oracledb
================

Oracle DB driver for Laravel

v13.0.0(4mo ago)11518.6k↓12.5%45MITPHPPHP ^8.3CI passing

Since Jan 14Pushed 2mo ago15 watchersCompare

[ Source](https://github.com/jfelder/Laravel-OracleDB)[ Packagist](https://packagist.org/packages/jfelder/oracledb)[ RSS](/packages/jfelder-oracledb/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (7)Versions (67)Used By (0)

Laravel Oracle Database Driver
==============================

[](#laravel-oracle-database-driver)

[![PHP Version](https://camo.githubusercontent.com/e8d96935cfd73cd68ac69376e1f45bd06ad0e33e4c4802674bfebc0c22f13407/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a66656c6465722f6f7261636c6564622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jfelder/oracledb)[![Latest Version](https://camo.githubusercontent.com/82e4d9d5e0601512750917e3da1049c4be8dd98c98a6ab3fa63e6d128ed9d9d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a66656c6465722f6f7261636c6564622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jfelder/oracledb)[![Total Downloads](https://camo.githubusercontent.com/06109d48cb2292b72fc9899d955c88fff072a3efd52f5bd17fe0d76abd39dc6a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a66656c6465722f6f7261636c6564622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jfelder/oracledb)[![License](https://camo.githubusercontent.com/de2eb7dbf54db472a6e563aa0037c3e82ac44b036c990232dfab4e61c45ead84/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a66656c6465722f6f7261636c6564622e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Tests](https://github.com/jfelder/Laravel-OracleDB/actions/workflows/tests.yml/badge.svg)](https://github.com/jfelder/Laravel-OracleDB/actions/workflows/tests.yml)[![Coverage](https://github.com/jfelder/Laravel-OracleDB/actions/workflows/coverage.yml/badge.svg)](https://github.com/jfelder/Laravel-OracleDB/actions/workflows/coverage.yml)[![Codecov](https://camo.githubusercontent.com/a4bd42e10645bcad8ccbd0847d7007e5de41683c30394c4c33db16d390a412c7/68747470733a2f2f636f6465636f762e696f2f6769746875622f6a66656c6465722f4c61726176656c2d4f7261636c6544422f67726170682f62616467652e7376673f746f6b656e3d77525775626f65373964)](https://codecov.io/github/jfelder/Laravel-OracleDB)

OracleDB is an Oracle Database driver for Laravel 13. It extends [Illuminate Database](https://github.com/illuminate/database) and provides a PDO-compatible adapter built on PHP's [OCI8 extension](https://www.php.net/manual/en/book.oci8.php).

Please [report bugs through GitHub Issues](https://github.com/jfelder/Laravel-OracleDB/issues).

- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Basic Usage](#basic-usage)
- [Known Limitations](#known-limitations)
- [Testing](#testing)
- [Contributing](#contributing)
- [License](#license)

Requirements
------------

[](#requirements)

- Laravel 13 (`illuminate/* ^13.0`)
- PHP 8.3 or later (`^8.3`)
- The PHP [OCI8 extension](https://www.php.net/manual/en/oci8.installation.php)
- Oracle Client or Oracle Instant Client libraries compatible with the OCI8 extension

Package major versions follow Laravel major versions. Use OracleDB 13.x with Laravel 13.x. CI currently tests PHP 8.3, 8.4, and 8.5, including the lowest and latest supported Laravel 13 dependency sets.

> **Important:** OracleDB no longer supports the [PDO\_OCI extension](https://www.php.net/manual/en/ref.pdo-oci.php). OCI8 is the only supported Oracle transport.

Installation
------------

[](#installation)

Install the Laravel 13-compatible package with Composer:

```
composer require jfelder/oracledb:^13.0
```

Laravel's package auto-discovery automatically registers OracleDB's service provider.

Publish the package configuration file:

```
php artisan vendor:publish --tag=oracledb-config
```

This copies the package configuration to `config/oracledb.php`.

Configuration
-------------

[](#configuration)

The published `config/oracledb.php` file defines a connection named `oracle` and is merged into Laravel's `database.connections` configuration. A typical service-name connection uses:

```
DB_CONNECTION=oracle
DB_HOST=127.0.0.1
DB_PORT=1521
DB_SERVICE_NAME=FREEPDB1
DB_USERNAME=app_user
DB_PASSWORD=secret
DB_CHARSET=AL32UTF8
```

Set `DB_CHARSET` to the character set required by your Oracle client and database. The package default is `WE8ISO8859P1`.

You may configure the connection in either of these ways:

- Set `DB_TNS` to a complete TNS descriptor. When it is present, the host, port, service name, and SID settings are not used to build the connection descriptor.
- Set `DB_HOST`, `DB_PORT`, and `DB_SERVICE_NAME` for a service-name connection.
- Leave `DB_SERVICE_NAME` empty and set `DB_DATABASE` to connect using an SID.

The `quoting` option in `config/oracledb.php` defaults to `false`, allowing Oracle to apply its normal identifier casing. Set it to `true` when your schema relies on case-sensitive quoted identifiers.

To define multiple Oracle connections, copy the `oracle` connection entry, give each copy a unique name, and use distinct environment-variable names for each connection.

### NLS Session Parameters

[](#nls-session-parameters)

The previous `date_format` option has been replaced by Oracle NLS session parameters. Defaults are defined by the package and may be overridden through the `session_parameters` array in `config/oracledb.php` or the corresponding environment variables, such as `NLS_DATE_FORMAT`.

These settings affect Eloquent date attributes and Query Builder operations that bind Carbon instances.

ParameterDefault value`NLS_TIME_FORMAT``HH24:MI:SS``NLS_DATE_FORMAT``YYYY-MM-DD HH24:MI:SS``NLS_TIMESTAMP_FORMAT``YYYY-MM-DD HH24:MI:SS``NLS_TIMESTAMP_TZ_FORMAT``YYYY-MM-DD HH24:MI:SS TZH:TZM``NLS_NUMERIC_CHARACTERS``.,`Basic Usage
-----------

[](#basic-usage)

Once the Oracle connection is configured, use Laravel's `DB` facade normally:

```
use Illuminate\Support\Facades\DB;

$results = DB::select('select * from users where id = ?', [1]);
```

This example assumes `oracle` is Laravel's default database connection. `select()` returns an array of result rows.

Select an explicit connection when Oracle is not the default:

```
$results = DB::connection('oracle')->select(
    'select * from users where id = ?',
    [1],
);
```

### Inserting Records With a Generated ID

[](#inserting-records-with-a-generated-id)

```
$id = DB::connection('oracle')->table('users')->insertGetId(
    ['email' => 'john@example.com', 'votes' => 0],
    'userid',
);
```

For this driver, Laravel's second `insertGetId()` argument (named `$sequence` in Laravel's API) identifies the column returned by Oracle's `RETURNING` clause. It defaults to `id`. The database must populate this column through an identity, trigger, default, or equivalent mechanism.

See the [Laravel database documentation](https://laravel.com/docs/13.x/database) for general Query Builder and connection usage.

Known Limitations
-----------------

[](#known-limitations)

Some features available in Laravel's first-party database drivers are not implemented by this package. The lists below distinguish operations that throw an unsupported-operation exception from fluent options that are accepted but do not affect the generated Oracle SQL.

Pull requests are welcome for implementing these features or expanding this list.

### Unsupported: Query Builder

[](#unsupported-query-builder)

- Group limiting via `$query->groupLimit($value, $column)`. Laravel uses this to limit eagerly loaded results per parent.
- Lateral joins via `joinLateral()` or `leftJoinLateral()`.
- Case-insensitive `LIKE` operations such as `DB::table('users')->whereLike('email', '%foo%', caseSensitive: false)->get()`. Use an `UPPER(column) LIKE ?`expression instead.
- `DB::table('users')->insertOrIgnore(['email' => 'foo'])`.
- `DB::table('users')->insertOrIgnoreReturning([['email' => 'foo']], ['id'])`.
- `DB::table('users')->insertOrIgnoreUsing(['email'], DB::table('staging_users')->select('email'))`.
- Calling `insertGetId()` with an empty values array. Non-empty inserts are supported.
- Upserts via `DB::table('users')->upsert($values, 'email')`.
- Deleting with a join.
- Deleting with an order or limit.
- JSON query and update operations, including JSON path access, containment, overlap, key-existence, and length operations.
- Full-text queries such as `DB::table('users')->whereFullText('description', 'Hello World')`.

### Unsupported: Eloquent

[](#unsupported-eloquent)

- Setting `$guarded` to a non-empty list, for example `protected $guarded = ['id'];`. Models must either inherit Laravel's default guarded configuration or set `$guarded` to an empty array. A custom non-empty list may cause Eloquent to request unsupported column-listing metadata.
- Limiting the number of eagerly loaded results per parent, such as `User::with(['posts' => fn ($query) => $query->limit(3)])->get()`.

### Unsupported: Schema Builder

[](#unsupported-schema-builder)

- Schema dumping through `php artisan schema:dump` or `php artisan schema:dump --prune`.
- Creating databases through `Schema::createDatabase('example')`.
- Dropping databases through `Schema::dropDatabaseIfExists('example')`.
- Schema inspection methods that retrieve columns, indexes, foreign keys, or user-defined types. This includes `getColumns()`, `getColumnListing()`, `getIndexes()`, `getForeignKeys()`, `getTypes()`, `hasColumn()`, `hasColumns()`, `hasIndex()`, `hasForeignKey()`, and conditional helpers built on these methods.
- Renaming an index through `$blueprint->renameIndex('foo', 'bar')`.
- Creating spatial indexes through `$blueprint->spatialIndex('coordinates')` or `$blueprint->point('coordinates')->spatialIndex()`.
- Creating generated columns with `virtualAs`, `storedAs`, or `generatedAs`.
- Creating geometry or geography columns.
- Creating vector columns or vector indexes.
- Ensuring a vector extension exists through `Schema::ensureVectorExtensionExists()`.

### Accepted But Currently No-Op

[](#accepted-but-currently-no-op)

- Table collation through `$blueprint->collation('BINARY_CI')`.
- Column collation through `$blueprint->string('some_column')->collation('BINARY_CI')`.
- The `$blueprint->temporary()` flag. It is ignored, so the generated statement creates a regular table.
- Index algorithms passed as the third argument to `$blueprint->index(['foo', 'bar'], 'baz', 'hash')`.
- Starting values on identity columns through `$blueprint->increments('id')->startingValue(1000)`.

### Supported With Limitations

[](#supported-with-limitations)

- `json()` and `jsonb()` schema columns are stored as `CLOB`. Query Builder JSON operators remain unsupported.

Testing
-------

[](#testing)

Install development dependencies:

```
composer install
```

If OCI8 is not installed locally, run the portable portion of the test suite:

```
vendor/bin/phpunit --exclude-group oci8
```

If OCI8 is available, run the full suite:

```
vendor/bin/phpunit
```

Verify compatibility with the lowest supported dependency versions:

```
composer update --prefer-lowest --prefer-stable --prefer-dist --no-progress --no-interaction
vendor/bin/phpunit
```

Check code style:

```
vendor/bin/pint --test
```

This repository intentionally does not commit `composer.lock` because it is a library. CI resolves both the lowest and current stable dependency sets.

Contributing
------------

[](#contributing)

Bug reports and pull requests are welcome. When reporting a database issue, include the Laravel, PHP, OCI8, Oracle Client, and Oracle Database versions, together with a minimal query or migration that reproduces the behavior.

Use [GitHub Issues](https://github.com/jfelder/Laravel-OracleDB/issues) for confirmed bugs and compatibility reports.

License
-------

[](#license)

OracleDB is open-source software licensed under the [MIT License](LICENSE).

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance82

Actively maintained with recent releases

Popularity43

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity93

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 83.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~69 days

Recently: every ~6 days

Total

65

Last Release

143d ago

Major Versions

6.x-dev → 9.0.02022-11-29

9.x-dev → 10.0.02024-07-25

10.x-dev → 11.0.02024-08-06

11.0.2 → v12.0.02026-02-18

v12.1.1 → v13.0.02026-03-17

PHP version history (13 changes)0.2.0PHP &gt;=5.3.0

4.2.1PHP &gt;=5.4.0

5.1.1PHP &gt;=5.5.9

5.4.x-devPHP &gt;=5.6.4

5.6.1PHP &gt;=7.1.3

5.8.0PHP ^7.1.3

6.0.0PHP ^7.2

7.0.0PHP ^7.2.5

8.x-devPHP ^7.3.0

9.0.0PHP ^8.1.0

10.0.0PHP ^8.1

11.0.0PHP ^8.2

v13.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/00ab6e50d23c1d72f3d284600853a27a434e91aa9f3f7e9045c0d12caad02297?d=identicon)[jfelder](/maintainers/jfelder)

---

Top Contributors

[![jfelder](https://avatars.githubusercontent.com/u/4504343?v=4)](https://github.com/jfelder "jfelder (144 commits)")[![efcor](https://avatars.githubusercontent.com/u/7902985?v=4)](https://github.com/efcor "efcor (20 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")[![yajra](https://avatars.githubusercontent.com/u/2687997?v=4)](https://github.com/yajra "yajra (3 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![m1kl](https://avatars.githubusercontent.com/u/2827671?v=4)](https://github.com/m1kl "m1kl (1 commits)")

---

Tags

laraveloracleoci8laravel-13

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jfelder-oracledb/health.svg)

```
[![Health](https://phpackages.com/badges/jfelder-oracledb/health.svg)](https://phpackages.com/packages/jfelder-oracledb)
```

###  Alternatives

[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8723.3M27](/packages/yajra-laravel-oci8)[illuminate/database

The Illuminate Database package.

2.8k55.8M12.7k](/packages/illuminate-database)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k57.2M661](/packages/laravel-scout)[illuminate/queue

The Illuminate Queue package.

20433.0M1.7k](/packages/illuminate-queue)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M352](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58174.6k18](/packages/api-platform-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
