Error connecting oracle

1

I'm trying to perform insert operation on oracle by Laravel (5.6), but it's giving error:

The method I make the insert is this:

public function salvar( Request $request ){
        $agenda = new Agenda();
        $agenda->dt_agenda = $request->input('data');
        $agenda->hr_agenda = $request->input('hora');
        $agenda->nm_pessoa = $request->input('nome');
        $agenda->save();
        $data = date('d/m/Y');
        return view('escala')->with( 'data', $data );
    }

In the config / database.php file it looks like this:

 'default' => env('DB_CONNECTION', 'oracle'),
    ...
    'oracle' => [
                'driver'         => 'oracle',
                'host'           => env('DB_HOST', ''),
                'port'           => env('DB_PORT', '1521'),
                'database'       => env('DB_DATABASE', ''),
                'username'       => env('DB_USERNAME', ''),
                'password'       => env('DB_PASSWORD', ''),
                'charset'        => env('DB_CHARSET', 'AL32UTF8'),
                'prefix'         => ''
            ],

The .env file is properly configured

DB_CONNECTION=oracle
DB_HOST=ipdoservidor
DB_PORT=1521
DB_DATABASE=banco
DB_USERNAME=login
DB_PASSWORD=senha

The error you are giving is:

  

ErrorException (E_WARNING) Declaration of   Yajra \ Oci8 \ Oci8Connection :: causedByLostConnection (Exception $ e) should   be compatible with   Illuminate \ Database \ Connection :: causedByLostConnection (Throwable $ e)

My composer.json looks like this:

"require": {
        "php": ">=7.1.3",
        "barryvdh/laravel-ide-helper": "^2.4",
        "fideloper/proxy": "~4.0",
        "laravel/framework": "5.6.*",
        "laravel/tinker": "~1.0",
        "yajra/laravel-oci8": "5.6.*"
    },

    
asked by anonymous 14.02.2018 / 15:36

1 answer

1

Do you have the latest version of this package?

Since the update of Laravel 5.6 is recent, it is normal for incompatibilities to occur with some packages and this is corrected according to the open issues in Github related to it.

In the Issues tab of the Oracle DB driver for Laravel 4 | 5 via OCI8 we can see something about your issue in this issue .

As we can see, the commit # 407 made 8 days ago (14 Feb. 2018) corrects the problem.

    
22.02.2018 / 15:18