yajra / laravel-oci8

Oracle DB driver for Laravel via OCI8
https://yajrabox.com/docs/laravel-oci8
MIT License
834 stars 237 forks source link

Undefined index: options #372

Closed celorodovalho closed 7 years ago

celorodovalho commented 7 years ago

Summary of problem or feature request

Every error in my query, I'm always getting the same exception:

ErrorException: Undefined index: options in /vendor/yajra/laravel-oci8/src/Oci8/Oci8Connection.php:475

Code snippet of problem

$testeModel = new TesteModel();
$teste->content = 500; //Content is a UNIQUE INDEX an already have a 'content=500' in my data
$teste->save();

System details

Here is my composer.json:

{
    "name" : "Pres",
    "description" : "FREQ",
    "keywords" : [
        "framework",
        "laravel",
        "lumen"
    ],
    "license" : "MIT",
    "type" : "project",
    "config" : {
        "secure-http" : false
    },
    "require" : {
        "php" : ">=7.1",
        "laravel/lumen-framework" : "5.4.*",
        "vlucas/phpdotenv" : "~2.2",
        "dingo/api" : "1.0.*@dev",
        "yajra/laravel-oci8" : "^5.4",
        "guzzlehttp/guzzle" : "^6.3",
        "darkaonline/swagger-lume" : "~2.0",
        "willdurand/hateoas" : "^2.10",
        "owen-it/laravel-auditing" : ">=4",
        "laravelista/lumen-vendor-publish" : "^2.0",
        "vluzrmos/lumen-cors" : "2.1.*",
        "barryvdh/laravel-cors" : "^0.9.2",
        "codedge/laravel-fpdf" : "^1.2",
        "phpmailer/phpmailer": "^6.0",
        "illuminate/mail": "5.4"
    },
    "require-dev" : {
        "fzaninotto/faker" : "~1.4",
        "phpunit/phpunit" : "~5.0",
        "mockery/mockery" : "~0.9",
        "friendsofphp/php-cs-fixer" : "^2.7",
        "refinery29/php-cs-fixer-config": "^0.10.1"
    },
    "autoload" : {
        "psr-4" : {
            "App\\" : "app/"
        }
    },
    "autoload-dev" : {
        "classmap" : [
            "tests/",
            "database/"
        ]
    },
    "scripts" : {
        "post-root-package-install" : "php -r \"copy('.env.example', '.env');\"",
        "cs" : "vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no ."
    },
    "minimum-stability" : "dev",
    "prefer-stable" : true
}
Jon4t4n commented 7 years ago

Hello

I am getting the same exception too when a query generates an error.

laravel/framework: 5.5.20 yajra/laravel-oci8: 5.5.4

yajra commented 7 years ago

Thanks for reporting. My colleague is now working on a fix for this. This issue was introduced by PR https://github.com/yajra/laravel-oci8/pull/368. Will release a patch within the day.

yajra commented 7 years ago

Patch released on v5.5.5, thanks!

celorodovalho commented 7 years ago

Ok, thanks!! I'll test my code again and edit this answer later.

mstaack commented 7 years ago

@yajra oh sry... ;)

baseerx commented 6 years ago

how to reinstall the patch? i run the below mentioned query and it excutes and creates table but also shows and error of "undefined index" $query='CREATE TABLE firsttable1 (id VARCHAR(2))'; $check=DB::unprepared($query);

baseerx commented 6 years ago

how can i create table in DB from model as there is no any such query mentioned for creating table on laravel official website.