skip to Main Content

Laravel SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: integer

I have like this migration file: Schema::create('posts', function($table) { $table->engine = 'InnoDB'; $table->increments('id')->unsigned(); $table->string('title'); $table->text('description')->nullable(); $table->integer('sort_order')->default(0); $table->boolean('status')->default(0); }); And I have also seeder: class SeedPostsTable extends Seeder { public function run() { $posts = $this->getPosts(); foreach ($posts as $title =>…

VIEW QUESTION

Get Only children from hasmany relation laravel 8

I have two mysql table with HasMany/belongsTo relation like this : public function Products() { return $this->hasMany(Prices::class, 'product_id'); } public function Prices() { return $this->belongsTo(Products::class); } If i do the following function, i can get the latest price for every…

VIEW QUESTION
Back To Top
Search