skip to Main Content

PHP Laravel SQLSTATE[HY000]

I have a some problem... ORM When I use php artisan tinker, use App\Models\User $u = new User(); $u->title = 'sale'; $u->content = 'auto ...'; $u->price = 2500; HERE ARE GOOD EVERYTHING, BUT... when I type command $u->save(); I see…

VIEW QUESTION

Postgresql – Foreignkey Django separator

There is a model: class Categories(models.Model): name = models.CharField(max_length=150, unique=True, verbose_name='Name') slug = models.SlugField(max_length=200, unique=True, blank=True, null=True, verbose_name='URL') class Products(models.Model): name = models.CharField(max_length=150, unique=True, verbose_name='Name') slug = models.SlugField(max_length=200, unique=True, blank=True, null=True, verbose_name='URL') category = models.ForeignKey(to=Categories, on_delete=models.PROTECT, verbose_name='Categoy') I don't understand…

VIEW QUESTION

Mongodb – Prisma @unique null fails validation

I have a schema as follows: model Player { id String @id @default(auto()) @map("_id") @db.ObjectId steam_id String @unique name String level Int @default(1) elo Float @default(1500) games Game[] @relation(fields: [game_ids], references: [id]) game_ids String[] @db.ObjectId clients Client[] user User? @relation(fields:…

VIEW QUESTION

Mysql – Error Code: 1364. Field 'userid' doesn't have a default value

This is the error: java.sql.SQLException: Field 'userid' doesn't have a default value at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:130) ~[mysql-connector-j-8.3.0.jar:8.3.0] This is my Entity class: @Entity @Table(name = "users") public class Users { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int userId; } Table: CREATE TABLE `users`…

VIEW QUESTION

Laravel successfully adding item in one to many relationship model but it is not being added to database

please help, I've been stuck here since then. I want to insert shipmentrequestitem from shipmentrequest model using update method public function update(UpdateShipmentRequestRequest $request, $id) { $shipmentRequest = ShipmentRequest::with( 'shipmentRequestItems', )->where('id',$id)->first(); $shipmentRequest->update($request->all()); $validatedData = $request->validated(); $shipmentRequestItems = $validatedData['shipmentRequestItems']; // $shipmentRequest =…

VIEW QUESTION
Back To Top
Search