I'm working on Laravel project and i would like to know: how to insert data to my multiple related tables ? How can we insert author id in the author_type_id field of the Author table? How to store author_id in post? So idon't know how to insert related models usi...
Laravel 批量 insert 数据? 需求是这样的,需要一次性生成 300 个随机 6 位数并且一次性插入数据库,并且要保持不重复。 看了一下网上的资料 都是原生的 sql 不是用 laravel 实现的, 插入几条数据就是直接 DB::table('tablename')->insert(array('name'=>hello,'age'=>23)); 多了以后这种方法就不能用了...
Create user in users table and insert data into second table with one form in Laravel RelationshipsI try to create a user while adding data to a second table via one formusers table:Schema::create('users', function (Blueprint $table) { $table->id(); $table->string('email')->unique(...
// Insert array values into database in laravel Laravel 33 3,371 Level 5 jsanwo64 OP Posted 6 years ago I have 3 different questions those are coming from database randomly. Now I want to insert the question_id, user_name and user_answer into 'answers' table. Data was inserted, but...
how the code will look like in controller. I can do simple insert and creations but I am really stuck with this for a while. because I need to insert all data0 Laracasts Elite Tray2 Posted 1 year ago Simple. you create a table where you have the question_id user_id value S...