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(3mo ago)11518.4k↓11.1%45MITPHPPHP ^8.3CI passing

Since Jan 14Pushed 3mo ago15 watchersCompare

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

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

Laravel Oracle Database Package
-------------------------------

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

### OracleDB (updated for Laravel 13)

[](#oracledb-updated-for-laravel-13)

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

OracleDB is an Oracle Database Driver package for [Laravel Framework](https://laravel.com) - thanks [@taylorotwell](https://github.com/taylorotwell). OracleDB is an extension of [Illuminate/Database](https://github.com/illuminate/database) that uses the [OCI8 Functions](https://www.php.net/manual/en/ref.oci8.php) wrapped into the PDO namespace.

**Please report any bugs you may find.**

- [Installation](#installation)
- [Basic Usage](#basic-usage)
- [Unimplemented Features](#unimplemented-features)
- [License](#license)

> **IMPORTANT** This version removes the [PDO\_OCI](https://www.php.net/manual/en/ref.pdo-oci.php) driver option and only uses the [OCI8 Functions](https://www.php.net/manual/en/ref.oci8.php) under the hood.

### Installation

[](#installation)

With [Composer](https://getcomposer.org):

```
composer require jfelder/oracledb
```

During this command, Laravel's "Auto-Discovery" feature should automatically register OracleDB's service provider.

Next, publish OracleDB's configuration file using the vendor:publish Artisan command. This will copy OracleDB's configuration file to `config/oracledb.php` in your project.

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

To finish the installation, set your environment variables (typically in your .env file) to the corresponding env variables used in `config/oracledb.php`: such as `DB_HOST`, `DB_USERNAME`, etc.

**Date Format Config**The `date_format` config has been removed in favor of using the NLS\_\* session parameters. The default values are defined by the package and can be overridden in `config/oracledb.php` via the `session_parameters` config array or through the corresponding environment variables such as `NLS_DATE_FORMAT`. This affects all read/write operations of any Eloquent model with date fields and any Query Builder queries that utilize a Carbon instance and brings the handling of dates in line with the framework.

#### Default NLS session parameters

[](#default-nls-session-parameters)

ParameterDefault valueNLS\_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)

The configuration file for this package is located at `config/oracledb.php`. In this file, you define all of your oracle database connections. If you need to make more than one connection, just copy the example one. If you want to make one of these connections the default connection, enter the name you gave the connection into the "Default Database Connection Name" section in `config/database.php`.

Once you have configured the OracleDB database connection(s), you may run queries using the `DB` facade as normal.

> **Note:** This driver makes OracleDB use the [OCI8 Functions](https://www.php.net/manual/en/ref.oci8.php) under the hood.

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

The above statement assumes you have set the default connection to be the oracle connection you setup in config/database.php file and will always return an `array` of results.

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

Just like the built-in database drivers, you can use the connection method to access the oracle database(s) you setup in config/oracledb.php file.

#### Inserting Records Into A Table With An Auto-Incrementing ID

[](#inserting-records-into-a-table-with-an-auto-incrementing-id)

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

> **Note:** When using the insertGetId method, you can specify the auto-incrementing column name as the second parameter in insertGetId function. It will default to "id" if not specified.

See the [Laravel database documentation](https://laravel.com/docs/13.x/database) for more information.

### Unimplemented Features

[](#unimplemented-features)

Some of the features available in the first-party Laravel database drivers are not implemented in this package. The list below separates features that are currently unsupported from features whose fluent modifiers are currently accepted but have no effect on the generated SQL. Pull requests are welcome for implementing any of these features, or for expanding this list if you find any gaps not already listed.

#### Unsupported: Query Builder

[](#unsupported-query-builder)

- group limiting via a groupLimit clause `$query->groupLimit($value, $column);` note: this was only added to Laravel so Eloquent can limit the number of eagerly loaded results per parent
- case-insensitive `LIKE` operations such as `DB::table('users')->whereLike('email', '%foo%', caseSensitive: false)->get();` use `UPPER(column) LIKE ?` style expressions instead
- insertOrIgnore `DB::from('users')->insertOrIgnore(['email' => 'foo']);`
- insertOrIgnoreReturning `DB::from('users')->insertOrIgnoreReturning([['email' => 'foo']], ['id']);`
- insertOrIgnoreUsing `DB::from('users')->insertOrIgnoreUsing(['email'], DB::table('staging_users')->select('email'));`
- insertGetId with empty values `DB::from('users')->insertGetId([]);` (but calling with non-empty values is supported)
- upserts `DB::from('users')->upsert([['email' => 'foo', 'name' => 'bar'], ['name' => 'bar2', 'email' => 'foo2']], 'email');`
- deleting with a join `DB::from('users')->join('contacts', 'users.id', '=', 'contacts.id')->where('users.email', '=', 'foo')->delete();`
- deleting with a limit `DB::from('users')->where('email', '=', 'foo')->orderBy('id')->take(1)->delete();`
- json operations `DB::from('users')->where('items->sku', '=', 'foo-bar')->get();`
- JSON overlap operations such as `DB::from('users')->whereJsonOverlaps('options->languages', ['en', 'fr'])->get();`
- JSON key existence operations such as `DB::from('users')->whereJsonContainsKey('options->languages')->get();`
- whereFulltext `DB::table('users')->whereFulltext('description', 'Hello World');`

#### Unsupported: Eloquent

[](#unsupported-eloquent)

- setting `$guarded` on an Eloquent model as anything other than an empty array, for example `protected $guarded = ['id'];`. Models must either not define `$guarded` at all, or set it to an empty array. If not, Eloquent may attempt to run a column listing SQL query resulting in an exception.
- limiting the number of eagerly loaded results per parent, ie get only 3 posts per user `User::with(['posts' => fn ($query) => $query->limit(3)])->paginate();`

#### Unsupported: Schema Builder

[](#unsupported-schema-builder)

- schema dumping such as `php artisan schema:dump` or `php artisan schema:dump --prune`
- creating databases `Schema::createDatabase('example')`
- dropping databases `Schema::dropDatabaseIfExists('example')`
- column listing operations such as `Schema::getColumnListing('users')`
- set collation on a table `$blueprint->collation('BINARY_CI')`
- set collation on a column `$blueprint->string('some_column')->collation('BINARY_CI')`
- create a private temporary table `$blueprint->temporary()`
- rename an index `$blueprint->renameIndex('foo', 'bar')`
- specify an algorithm when creating an index via the third argument `$blueprint->index(['foo', 'bar'], 'baz', 'hash')`
- create a spatial index `$blueprint->spatialIndex('coordinates')`
- create a spatial index fluently `$blueprint->point('coordinates')->spatialIndex()`
- create a generated column, like the mysql driver has `virtualAs` and `storedAs` and postgres has `generatedAs`; ie, assuming an integer type column named price exists on the table, `$blueprint->integer('discounted_virtual')->virtualAs('price - 5')`
- create a geometry column `$blueprint->geometry('coordinates')`
- create a geography column `$blueprint->geography('coordinates')`
- create a vector column `$blueprint->vector('embedding', dimensions: 1536)`
- create a vector index `$blueprint->vectorIndex('embedding')`
- ensure the vector extension exists `Schema::ensureVectorExtensionExists()`

#### Accepted But Currently No-Op

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

- starting values on identity columns via `$blueprint->increments('id')->startingValue(1000)`

#### Supported With Limitations

[](#supported-with-limitations)

- `json()` and `jsonb()` schema columns are stored as `CLOB`, for example `$blueprint->json('payload')` or `$blueprint->jsonb('payload')`. Query Builder JSON operators remain unsupported.

### Testing

[](#testing)

If OCI8 is not installed locally, you can still 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
```

### License

[](#license)

Licensed under the [MIT License](https://cheeaun.mit-license.org).

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance82

Actively maintained with recent releases

Popularity42

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity93

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 82.9% 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

97d 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 (141 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.1M23](/packages/yajra-laravel-oci8)[illuminate/database

The Illuminate Database package.

2.8k54.1M11.1k](/packages/illuminate-database)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k29.9M42](/packages/kirschbaum-development-eloquent-power-joins)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.4M2](/packages/glushkovds-phpclickhouse-laravel)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)

PHPackages © 2026

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