Laravel 5.8 newbie. Receiving data in json format from an api, converting in array, and trying to save it on the db. the firstOrCreate is returning a sql error cause one filed has commas into it and Eloquent is not quoting the values. So doing
$order = Connector::firstOrCreate($connector);
where the $connector array has field like:
'description' => 'bla bla, bla bla, bla. Bla bla bla, bla'
Is there a way to make Eloquent auto quoting values (i.e. in the .env file)?
php artisan tinker
and then
DB::connection()->getPdo();
returns:
PDO {#2937
inTransaction: false,
attributes: {
CASE: NATURAL,
ERRMODE: EXCEPTION,
AUTOCOMMIT: 1,
PERSISTENT: false,
DRIVER_NAME: "mysql",
SERVER_INFO: "Uptime: 453 Threads: 8 Questions: 203 Slow queries: 0 Opens: 25 Flush tables: 1 Open tables: 15 Queries per second avg: 0.448",
ORACLE_NULLS: NATURAL,
CLIENT_VERSION: "mysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $",
SERVER_VERSION: "5.5.5-10.3.15-MariaDB-1:10.3.15+maria~bionic",
STATEMENT_CLASS: [
"PDOStatement",
],
EMULATE_PREPARES: 0,
CONNECTION_STATUS: "127.0.0.1 via TCP/IP",
DEFAULT_FETCH_MODE: BOTH,
},
}