skip to Main Content

Attempt to read property "id" on integer – Laravel

I am new in laravel and working on E-Commerce Project. Plz Help me! I am trying to get data from the database but I can't. My function public function add_product_attributes($id) { $attributes = Product::where(['id' => $id])->with('attributes')->first(); $attributes_data = $attributes->toArray(); dd($attributes_data);…

VIEW QUESTION

Sorting data based on JSON content with Laravel

I have a table in my database that stores a student's progress in a course. Schema::create('course_student', function (Blueprint $table) { $table->primary(['course_id', 'user_id']); $table->char('user_id'); $table->char('course_id'); $table->timestamp('lesson_timestamp')->nullable(); $table->text('course_progress')->nullable(); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); $table->foreign('course_id')->references('id')->on('courses')->onDelete('cascade'); $table->timestamps(); }); Course progress is stored as a JSON object and consists…

VIEW QUESTION

Issues connecting to postgres – Postgresql

ConnectionRefusedError [SequelizeConnectionRefusedError]: connect ECONNREFUSED 127.0.0.1:5432 at Client._connectionCallback (/home/gene/capital_greek_project/api/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:131:24) at Client._handleErrorWhileConnecting (/home/gene/capital_greek_project/api/node_modules/pg/lib/client.js:305:19) at Client._handleErrorEvent (/home/gene/capital_greek_project/api/node_modules/pg/lib/client.js:315:19) at Connection.emit (node:events:527:28) at Socket.reportStreamError (/home/gene/capital_greek_project/api/node_modules/pg/lib/connection.js:52:12) at Socket.emit (node:events:527:28) at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at processTicksAndRejections (node:internal/process/task_queues:83:21) { parent: Error: connect ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect…

VIEW QUESTION

Firebase conditions in where – Flutter

QuerySnapshot querySnapshot = await FirebaseFirestore.instance .collection('stations') .where('norequest', isGreaterThan: 9) .get(); Here i want get if 'norequest' is a whole number like 10 , 20 , 30 , 40 something like this and greater than 5 ? How can i get…

VIEW QUESTION

Why do I get the Exception SqlException IDENTITY_INSERT is set to OFF – Asp.net

HeuteDb heute = new HeuteDb(); string filePath = @"C:UsersEliasDesktopASPlearningDATAData.csv"; using (StreamReader reader = new StreamReader(filePath)) { string line; while ((line = reader.ReadLine()) != null) { List<string> items = line.Split(';').ToList(); heute.Uhrzeit = items[0]; heute.Energie = items[1]; _context.HeutesDb.Add(heute); _context.SaveChanges(); } } I…

VIEW QUESTION
Back To Top
Search