PHPackages                             masoud5070/laravel-oci8 - 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. masoud5070/laravel-oci8

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

masoud5070/laravel-oci8
=======================

Oracle DB driver for Laravel 4|5|6|7 via OCI8

v9.3.3(3y ago)01.4kMITPHPPHP ^8.0.2

Since Jan 15Pushed 3y agoCompare

[ Source](https://github.com/Masoud5070/laravel-oci8)[ Packagist](https://packagist.org/packages/masoud5070/laravel-oci8)[ Fund](https://www.paypal.me/yajra)[ GitHub Sponsors](https://github.com/yajra)[ RSS](/packages/masoud5070-laravel-oci8/feed)WikiDiscussions 9.x Synced today

READMEChangelog (10)Dependencies (9)Versions (294)Used By (0)

Oracle DB driver for Laravel 4|5|6|7|8|9 via OCI8
=================================================

[](#oracle-db-driver-for-laravel-456789-via-oci8)

[![Build Status](https://github.com/yajra/laravel-oci8/workflows/tests/badge.svg)](https://github.com/yajra/laravel-oci8/actions)[![Total Downloads](https://camo.githubusercontent.com/15c34a8d821e05fc9e12c5a707412bf6b00c696020bf540929f0e1d4f7e3a42d/68747470733a2f2f706f7365722e707567782e6f72672f79616a72612f6c61726176656c2d6f6369382f642f746f74616c2e737667)](https://packagist.org/packages/yajra/laravel-oci8)[![Latest Stable Version](https://camo.githubusercontent.com/52aa0351cf9a08e178356ae1734f0dfe179b854530fc6490930a13375e800935/68747470733a2f2f706f7365722e707567782e6f72672f79616a72612f6c61726176656c2d6f6369382f762f737461626c652e737667)](https://packagist.org/packages/yajra/laravel-oci8)[![License](https://camo.githubusercontent.com/b0638f84f86a85b8703803f5e66fca5a99f32dd3b02dd3950115b5014a52f111/68747470733a2f2f706f7365722e707567782e6f72672f79616a72612f6c61726176656c2d6f6369382f6c6963656e73652e737667)](https://packagist.org/packages/yajra/laravel-oci8)

Laravel-OCI8
------------

[](#laravel-oci8)

Laravel-OCI8 is an Oracle Database Driver package for [Laravel](http://laravel.com/). Laravel-OCI8 is an extension of [Illuminate/Database](https://github.com/illuminate/database) that uses [OCI8](http://php.net/oci8) extension to communicate with Oracle. Thanks to @taylorotwell.

Documentations
--------------

[](#documentations)

- You will find user-friendly and updated documentation here: [Laravel-OCI8 Docs](https://yajrabox.com/docs/laravel-oci8)
- All about oracle and php:[The Underground PHP and Oracle Manual](http://www.oracle.com/technetwork/database/database-technologies/php/201212-ug-php-oracle-1884760.pdf)

Laravel Version Compatibility
-----------------------------

[](#laravel-version-compatibility)

LaravelPackage5.1.x5.1.x5.2.x5.2.x5.3.x5.3.x5.4.x5.4.x5.5.x5.5.x5.6.x5.6.x5.7.x5.7.x5.8.x5.8.x6.x.x6.x.x7.x.x7.x.x8.x.x8.x.x9.x.x9.x.xQuick Installation
------------------

[](#quick-installation)

```
composer require yajra/laravel-oci8:^9
```

Service Provider (Optional on Laravel 5.5+)
-------------------------------------------

[](#service-provider-optional-on-laravel-55)

Once Composer has installed or updated your packages you need to register Laravel-OCI8. Open up `config/app.php` and find the providers key and add:

```
Yajra\Oci8\Oci8ServiceProvider::class,
```

Configuration (OPTIONAL)
------------------------

[](#configuration-optional)

Finally you can optionally publish a configuration file by running the following Artisan command. If config file is not publish, the package will automatically use what is declared on your `.env` file database configuration.

```
php artisan vendor:publish --tag=oracle
```

This will copy the configuration file to `config/oracle.php`.

> Note: For [Laravel Lumen configuration](http://lumen.laravel.com/docs/configuration#configuration-files), make sure you have a `config/database.php` file on your project and append the configuration below:

```
'oracle' => [
    'driver'         => 'oracle',
    'tns'            => env('DB_TNS', ''),
    'host'           => env('DB_HOST', ''),
    'port'           => env('DB_PORT', '1521'),
    'database'       => env('DB_DATABASE', ''),
    'service_name'   => env('DB_SERVICE_NAME', ''),
    'username'       => env('DB_USERNAME', ''),
    'password'       => env('DB_PASSWORD', ''),
    'charset'        => env('DB_CHARSET', 'AL32UTF8'),
    'prefix'         => env('DB_PREFIX', ''),
    'prefix_schema'  => env('DB_SCHEMA_PREFIX', ''),
    'edition'        => env('DB_EDITION', 'ora$base'),
    'server_version' => env('DB_SERVER_VERSION', '11g'),
    'load_balance'   => env('DB_LOAD_BALANCE', 'yes'),
    'dynamic'        => [],
],
```

> Then, you can set connection data in your `.env` files:

```
DB_CONNECTION=oracle
DB_HOST=oracle.host
DB_PORT=1521
DB_SERVICE_NAME=orcl
DB_DATABASE=xe
DB_USERNAME=hr
DB_PASSWORD=hr
```

> If you want to connect to a cluster containing multiple hosts, you can either set `tns` manually or set host as a comma-separated array and configure other fields as you wish:

```
DB_CONNECTION=oracle
DB_HOST=oracle1.host, oracle2.host
DB_PORT=1521
DB_SERVICE_NAME=orcl
DB_LOAD_BALANCE=no
DB_DATABASE=xe
DB_USERNAME=hr
DB_PASSWORD=hr
```

> If you need to connect with the service name instead of tns, you can use the configuration below:

```
'oracle' => [
    'driver' => 'oracle',
    'host' => 'oracle.host',
    'port' => '1521',
    'database' => 'xe',
    'service_name' => 'sid_alias',
    'username' => 'hr',
    'password' => 'hr',
    'charset' => '',
    'prefix' => '',
]
```

In some cases you may wish to set the connection parameters dynamically in your app. For instance, you may access more than one database, or your users may already have their own accounts on the Oracle database:

```
'oracle' => [
    'driver' => 'oracle',
    'host' => 'oracle.host',
    'port' => '1521',
    'service_name' => 'sid_alias',
    'prefix' => 'schemaowner',
    'dynamic' => [App\Models\Oracle\Config::class, 'dynamicConfig'],
]
```

The callback function in your app must be static and accept a reference to the `$config[]` array (which will already be populated with values set in the config file):

```
namespace App\Models\Oracle;

class Config {

    public static function dynamicConfig(&$config) {

        if (Illuminate\Support\Facades\Auth::check()) {
            $config['username'] = App\Oracle\Config::getOraUser();
            $config['password'] = App\Oracle\Config::getOraPass();
        }

    }
}
```

Then run your laravel installation...

\[Laravel 5.2++\] Oracle User Provider
--------------------------------------

[](#laravel-52-oracle-user-provider)

When using oracle, we may encounter a problem on authentication because oracle queries are case sensitive by default. By using this oracle user provider, we will now be able to avoid user issues when logging in and doing a forgot password failure because of case sensitive search.

To use, just update `auth.php` config and set the driver to `oracle`

```
'providers' => [
    'users' => [
        'driver' => 'oracle',
        'model' => App\User::class,
    ],
]
```

Credits
-------

[](#credits)

- [Arjay Angeles](https://github.com/yajra)
- [Jimmy Felder](https://github.com/jfelder/Laravel-OracleDB)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 85.7% 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 ~11 days

Recently: every ~3 days

Total

288

Last Release

1244d ago

Major Versions

v8.6.2 → v9.0.22022-05-18

v9.2.0 → 744.x-dev2022-12-14

v8.7.1 → v9.3.02023-01-23

v8.7.2 → v9.3.12023-01-24

v8.7.4 → v9.3.32023-01-24

PHP version history (12 changes)0.1.0PHP &gt;=5.3.0

v2.0.0.betaPHP &gt;=5.4.0

v2.0.0PHP &gt;=5.4

v3.0.0PHP &gt;=5.5.9

v5.3.0PHP &gt;=5.6.4

v5.5.0PHP &gt;=7.0.0

v5.6.0PHP ^7.1.3

v6.0.0PHP ^7.2

v7.0.0PHP ^7.2.5

v8.0.0PHP ^7.3

v8.3.0PHP ^7.3|^8.0

v9.0.0PHP ^8.0.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49834756?v=4)[masoudtajer](/maintainers/masoudtajer)[@masoudtajer](https://github.com/masoudtajer)

---

Top Contributors

[![yajra](https://avatars.githubusercontent.com/u/2687997?v=4)](https://github.com/yajra "yajra (827 commits)")[![ZsgsDesign](https://avatars.githubusercontent.com/u/19504567?v=4)](https://github.com/ZsgsDesign "ZsgsDesign (17 commits)")[![masoudtajer](https://avatars.githubusercontent.com/u/49834756?v=4)](https://github.com/masoudtajer "masoudtajer (16 commits)")[![forgandenny](https://avatars.githubusercontent.com/u/2554234?v=4)](https://github.com/forgandenny "forgandenny (10 commits)")[![ChaosPower](https://avatars.githubusercontent.com/u/260845?v=4)](https://github.com/ChaosPower "ChaosPower (9 commits)")[![joaorobertopb](https://avatars.githubusercontent.com/u/6556083?v=4)](https://github.com/joaorobertopb "joaorobertopb (9 commits)")[![mfrancoisbbs](https://avatars.githubusercontent.com/u/133215273?v=4)](https://github.com/mfrancoisbbs "mfrancoisbbs (9 commits)")[![Adam2Marsh](https://avatars.githubusercontent.com/u/7213334?v=4)](https://github.com/Adam2Marsh "Adam2Marsh (6 commits)")[![MohammadMehrabani](https://avatars.githubusercontent.com/u/18621426?v=4)](https://github.com/MohammadMehrabani "MohammadMehrabani (5 commits)")[![wremon-yo](https://avatars.githubusercontent.com/u/174759679?v=4)](https://github.com/wremon-yo "wremon-yo (4 commits)")[![jidago](https://avatars.githubusercontent.com/u/56063120?v=4)](https://github.com/jidago "jidago (4 commits)")[![jaydons](https://avatars.githubusercontent.com/u/44308248?v=4)](https://github.com/jaydons "jaydons (4 commits)")[![jfelder](https://avatars.githubusercontent.com/u/4504343?v=4)](https://github.com/jfelder "jfelder (4 commits)")[![mstaack](https://avatars.githubusercontent.com/u/10169509?v=4)](https://github.com/mstaack "mstaack (4 commits)")[![OmarAta](https://avatars.githubusercontent.com/u/9981596?v=4)](https://github.com/OmarAta "OmarAta (3 commits)")[![mozgovoyandrey](https://avatars.githubusercontent.com/u/2863373?v=4)](https://github.com/mozgovoyandrey "mozgovoyandrey (3 commits)")[![rhernandezOB](https://avatars.githubusercontent.com/u/135292745?v=4)](https://github.com/rhernandezOB "rhernandezOB (3 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (3 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (2 commits)")[![johnrcui](https://avatars.githubusercontent.com/u/6743129?v=4)](https://github.com/johnrcui "johnrcui (2 commits)")

---

Tags

laraveloracleoci8pdo\_oci

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/masoud5070-laravel-oci8/health.svg)

```
[![Health](https://phpackages.com/badges/masoud5070-laravel-oci8/health.svg)](https://phpackages.com/packages/masoud5070-laravel-oci8)
```

###  Alternatives

[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[watson/validating

Eloquent model validating trait.

9803.5M54](/packages/watson-validating)[glushkovds/phpclickhouse-laravel

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

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)

PHPackages © 2026

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