Categories
Laravel SqLite

SQLITE – Auto-increment a column with Laravel

Example : for SQLITE the double quote is critical to make it work

Polls::updateOrInsert(['business_id'=> $business_id],
    [
        "$vote_value" => DB::raw('"$vote_value" + 1'),
        'polls_name' => $theBusiness->BUSINESSNAME,
        'source' => env('APP_CODE'),
        'updated_at' => $lastupdated
    ]);

Leave a Reply