0

I've seen that this question has been made Unsupported driver in laravel 4 when using laravel-oci8 package but the answere wasn't really usefull since the thread specify on https://github.com/yajra/laravel-oci8/issues/2 was resolved by just installing Oracle instant client and I already have it istalled.

I am trying to integrate oracle DB with laravel 5 app using yajra/laravel-oci8 package, I have folow the installation process and I have verified the specified requirements but with no success. When ever I try to run php artisan route:list or php artisan migrate it tells me that [InvalidArgumentException] Unsupported driver [oracle].

My Config/database.php is the following

...
'default' => 'oracle',
...
'connections' => [
        'oracle' => array(
            'driver' => 'oracle',
            'host' => env('DB_HOST', 'localhost'),
            'port' => '1521',
            'database' => 'xe',
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'AL32UTF8',
            'prefix' => '',
        ),
        ...
]

Am I missing any other configuration?

UPDATE

For anybody crossing this question. The problem back then was that I incorrectly added the service provider (Yajra\Oci8\Oci8ServiceProvider::class,) class in the config/app.php

Community
  • 1
  • 1
ingkevin
  • 437
  • 5
  • 19

2 Answers2

0

this is my config:

'oracle' => [
        'driver' => 'oracle',
        'tns' => "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = XE) (SID = XE)))",
        'host' => env('DB_HOST', 'localhost'),
        'port' => env('DB_PORT', '1521'),
        'database' => env('DB_DATABASE', 'XE'),
        'username' => env('DB_USERNAME', 'XEUSER'),
        'password' => env('DB_PASSWORD', 'XEPASSWD'),
        'charset' => env('DB_CHARSET', 'AL32UTF8'),
        'prefix' => env('DB_PREFIX', ''),
        'prefix_schema' => env('DB_SCHEMA_PREFIX', ''),
    ],
xavierz
  • 33
  • 3
-1

change your config :

'oracle' => [
        'driver'        => 'oci8',
        'host'          => 'localhost',
        'port'          => '1521',
        'database'      => 'oracle_ID',
        'username'      => 'username',
        'password'      => 'password',
        'charset'       => 'utf8',
        'prefix'        => '',
        'prefix_schema' => '',
    ],

to check : take on your controller function

$data = DB::connection('oracle')->table('your_table')->take(1)->get();
var_dump($data);

it works for me