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.*"
},