PHPackages                             ledtest/oracle - 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. ledtest/oracle

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

ledtest/oracle
==============

Oracle DB driver for Laravel

8.0.0(5y ago)010MITPHPPHP ^7.3.0

Since Jan 14Pushed 4y agoCompare

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

READMEChangelogDependencies (5)Versions (52)Used By (0)

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

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

### OracleDB (updated for Laravel 8.x)

[](#oracledb-updated-for-laravel-8x)

[![Latest Stable Version](https://camo.githubusercontent.com/2907f1f28a33ceedd1892ea8bdc47e98de97b41154545f41d47314cd5fc819ea/68747470733a2f2f706f7365722e707567782e6f72672f6a66656c6465722f6f7261636c6564622f762f737461626c652e706e67)](https://packagist.org/packages/jfelder/oracledb) [![Total Downloads](https://camo.githubusercontent.com/4a28b7b882a5766992346ee3a56e30ea7a2a3c8c2f365ec58a32a5e141d946ff/68747470733a2f2f706f7365722e707567782e6f72672f6a66656c6465722f6f7261636c6564622f646f776e6c6f6164732e706e67)](https://packagist.org/packages/jfelder/oracledb) [![Build Status](https://camo.githubusercontent.com/68315a9f7d79ed47797c04fe1b956a62ffd8318e3a13206115e2db8068cdec4a/68747470733a2f2f7472617669732d63692e6f72672f6a66656c6465722f4c61726176656c2d4f7261636c6544422e706e67)](https://travis-ci.org/jfelder/Laravel-OracleDB)

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 either the [PDO\_OCI](https://www.php.net/manual/en/ref.pdo-oci.php) extension or the [OCI8 Functions](https://www.php.net/manual/en/ref.oci8.php) wrapped into the PDO namespace.

*NOTE: This package has not been tested in PHP 8.*

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

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

### 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.

Additionally, it may be necessary for your app to configure the NLS\_DATE\_FORMAT of the database connection session, before any queries are executed. One way to accomplish this is to run a statement in your `AppServiceProvider`'s `boot`method, for example:

```
if (config('database.default') === 'oracle') {
	DB::statement("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
}
```

### 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: OCI8 is the default driver. If you want to use the PDO\_OCI driver, change the `driver` value to `'pdo'` in the `config/oracledb.php` file for whichever connections you wish to have utilize PDO\_OCI. Setting the driver to `'pdo'` will make OracleDB use the [PDO\_OCI](https://www.php.net/manual/en/ref.pdo-oci.php) extension. Given any other `driver` value, OracleDB will use the [OCI8 Functions](https://www.php.net/manual/en/ref.oci8.php).*

```
$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 [Laravel Database Basic Docs](https://laravel.com/docs/8.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. Pull requests are welcome for implementing any of these features, or for expanding this list if you find any unimplemented features not already listed.

#### Query Builder

[](#query-builder)

- insertOrIgnore `DB::from('users')->insertOrIgnore(['email' => 'foo']);`
- 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();`

#### Schema Builder

[](#schema-builder)

- drop a table if it exists `Schema::dropIfExists('some_table');`
- drop all tables, views, or types `Schema::dropAllTables()`, `Schema::dropAllViews()`, and `Schema::dropAllTypes()`
- set collation on a table `$blueprint->collation('BINARY_CI')`
- set collation on a column `$blueprint->string('some_column')->collation('BINARY_CI')`
- set comments on a table `$blueprint->comment("This table is great.")`
- set comments on a column `$blueprint->string('foo')->comment("Some helpful info about the foo column")`
- set the starting value of an auto-incrementing column `$blueprint->increments('id')->startingValue(1000)`
- 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 json column `$blueprint->json('foo')` or jsonb column `$blueprint->jsonb('foo')` (oracle recommends storing json in VARCHAR2, CLOB, or BLOB columns)
- create a datetime with timezone column without precision `$blueprint->dateTimeTz('created_at')`, or with precision `$blueprint->timestampTz('created_at', 1)`
- create Laravel-style timestamp columns having a timezone component `$blueprint->timestampsTz()`
- create a uuid column `$blueprint->uuid('foo')` (oracle recommends a column of data type 16 byte raw for storing uuids)
- create a foreign uuid column `$blueprint->foreignUuid('foo')`
- create a column to hold IP addresses `$blueprint->ipAddress('foo')` (would be implemented as varchar2 45)
- create a column to hold MAC addresses `$blueprint->macAddress('foo')` (would be implemented as varchar2 17)
- create a geometry column `$blueprint->geometry('coordinates')`
- create a geometric point column `$blueprint->point('coordinates')`
- create a geometric point column specifying srid `$blueprint->point('coordinates', 4326)`
- create a linestring column `$blueprint->linestring('coordinates')`
- create a polygon column `$blueprint->polygon('coordinates')`
- create a geometry collection column `$blueprint->geometrycollection('coordinates')`
- create a multipoint column `$blueprint->multipoint('coordinates')`
- create a multilinestring column `$blueprint->multilinestring('coordinates')`
- create a multipolygon column `$blueprint->multipolygon('coordinates')`
- create a double column without specifying second or third parameters `$blueprint->double('foo')` (but `$blueprint->double('foo', 5, 2)` is supported)
- create a timestamp column with `useCurrent` modifier `$blueprint->timestamp('created_at')->useCurrent()`

### License

[](#license)

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

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 90.6% 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 ~53 days

Recently: every ~1 days

Total

50

Last Release

1921d ago

Major Versions

5.8.0 → 6.0.02020-05-12

6.0.1 → 7.0.02020-06-08

5.6.3 → 6.0.22020-12-07

6.0.2 → 8.0.02021-02-10

5.8.x-dev → 7.0.32021-02-12

PHP version history (9 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.0.0PHP ^7.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/46535225d90a3d40d5e288d633d9c1a94f0885cf9e968195a2bafad67b3d4197?d=identicon)[ledtest](/maintainers/ledtest)

---

Top Contributors

[![jfelder](https://avatars.githubusercontent.com/u/4504343?v=4)](https://github.com/jfelder "jfelder (87 commits)")[![ledtest](https://avatars.githubusercontent.com/u/16185810?v=4)](https://github.com/ledtest "ledtest (3 commits)")[![yajra](https://avatars.githubusercontent.com/u/2687997?v=4)](https://github.com/yajra "yajra (3 commits)")[![efcor](https://avatars.githubusercontent.com/u/7902985?v=4)](https://github.com/efcor "efcor (2 commits)")[![m1kl](https://avatars.githubusercontent.com/u/2827671?v=4)](https://github.com/m1kl "m1kl (1 commits)")

---

Tags

laravellaravel 8oracleoci8pdo\_oci

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ledtest-oracle/health.svg)

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

###  Alternatives

[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8703.0M17](/packages/yajra-laravel-oci8)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[mehdi-fathi/eloquent-filter

Eloquent Filter adds custom filters automatically to your Eloquent Models in Laravel.It's easy to use and fully dynamic, just with sending the Query Strings to it.

450191.6k1](/packages/mehdi-fathi-eloquent-filter)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)

PHPackages © 2026

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