Category : sqlite

I’m seeding the test database with fake users, posts and categories but for some reason when I seed the database with more than 15 records Laravel throws this error: IlluminateDatabaseQueryException SQLSTATE[23000]: Integrity constraint violation: 19 UNIQUE constraint failed: categories.name (SQL: insert into "categories" ("name", "slug", "updated_at", "created_at") values (id, quibusdam-nihil-dignissimos-vitae-sint-minus-est-nostrum, 2021-06-22 17:52:02, 2021-06-22 17:52:02)) If ..

Read more

I am using sqlite to process the laravel queues and my case did not work due to the sqlite is in different Dyno. The documentation has this information https://devcenter.heroku.com/articles/sqlite3#disk-backed-storage. If you have another alternative using sqllite, I am grateful. The configuration I made is in accordance with this response from the configuration with database: Laravel ..

Read more

I’m trying to create a create page where in a form an user text a caption and choose an image but whene i click a button to Add a New Post i get this error: SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: posts.user_id (SQL: insert into "posts" ("caption", "image", "updated_at", "created_at") values (asd, ..

Read more

As described in the laravel docs in my env I have DB_CONNECTION=sqlite DB_DATABASE=:memory: DB_FOREIGN_KEYS=true My Dockerfile installs sqlite, RUN apt-get update && apt-get install -y curl zip unzip git supervisor sqlite3 software-properties-common && add-apt-repository -y ppa:ondrej/php && apt-get update && apt-get install -y nginx php8.0-fpm php8.0-cli php8.0-mcrypt php8.0-gd php8.0-mysql php8.0-mbstring php8.0-xml php8.0-curl php8.0-sqlite3 php-redis I ..

Read more

I’m trying the new laravel/breeze. I’m using Ubuntu and created the project with the following commands: composer create-project –prefer-dist laravel/laravel:^8.0 composer require laravel/breeze –dev php artisan breeze:install npm install && npm run dev php artisan serve Then, i created a database.sqlite in database folder, made the php artisan migrate and then php artisan serve. But ..

Read more

I am working on a pet registration platform, but when I click on the submit button to save the info to my database, I seem to get this error: SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: pets.user_id (SQL: insert into "pets" ("nickname", "species", "date_of_birth", "user_id", "updated_at", "created_at") values (Tom, Male, 2009-07-30, ?, 2020-12-13 ..

Read more

i want to use sqlite in my laravel project. i change .env information of database like this: DB_CONNECTION=sqlite IlluminateDatabaseQueryException : could not find driver (SQL: PRAGMA foreign_keys = ON;) Exception trace: 1 PDOException::("could not find driver") /home/mcmptr/chat_app/blog/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70 2 PDO::__construct() /home/mcmptr/chat_app/blog/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70 please help me Sourc..

Read more

I am just a beginner so this problem might be stupid. I was using sqlite while developing and when I uploaded my project on AWS I got this error:- SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ‘f2bbac78-d85f-42fd-ba4c-276c2d9ee2b6’ for column ‘confessedTo’ at row 1 (SQL: insert into confessions (confession, confessedTo, confessionFrom, updated_at, created_at) values (AFCASCASCa, f2bbac78-d85f-42fd-ba4c-276c2d9ee2b6, ..

Read more

I want to use Sqlite driver for both test database and as actual database. My .env file is: DB_CONNECTION=sqlite It’s okay, i can use sqlite for actual database and for testing i defined something like this under my connections array in config/database.php: ‘testing’ => [ ‘driver’ => ‘sqlite’, ‘url’ => env(‘DATABASE_URL’), ‘database’ => env(‘DB_DATABASE’, database_path(‘test.sqlite’)), ..

Read more

I want to add 1 to my previous karma value in my database. Here’s what I am doing in my controller:- public function response(Request $request, $id) { $globalPost = PublicAnswer::find($id); if($request->resp == "normal") { $answered_by = DB::table(‘users’) ->where(‘id’, $globalPost->answered_by) ->increment(‘karma’, +1); } } Here’s my database:- public function up() { Schema::create(‘users’, function (Blueprint $table) { ..

Read more