Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Godsonic14's avatar

Insert manually date into database

How to insert manually date into database?

0 likes
2 replies
TiborBesze's avatar
DB::insert('insert into table_name (column_1, column_2) values (?, ?)', ['value 1', 'value 2']);
lostdreamer_nl's avatar

This should do:

DB::table('your_table_name')->insert([
    'field1' => 'value',
    'field2' => 'value',
    'field3' => 'value',
]);

Please or to participate in this conversation.