質問編集履歴

2

初心者マーク忘れ

2019/12/16 01:01

投稿

jiro-
jiro-

スコア28

test CHANGED
File without changes
test CHANGED
File without changes

1

追記

2019/12/16 01:01

投稿

jiro-
jiro-

スコア28

test CHANGED
File without changes
test CHANGED
@@ -222,6 +222,66 @@
222
222
 
223
223
  ```
224
224
 
225
+ ```databease\seeds\UsersTableSeeder
226
+
227
+ <?php
228
+
229
+
230
+
231
+ use Illuminate\Database\Seeder;
232
+
233
+ use App\Models\User;
234
+
235
+
236
+
237
+ class UsersTableSeeder extends Seeder
238
+
239
+ {
240
+
241
+ /**
242
+
243
+ * Run the database seeds.
244
+
245
+ *
246
+
247
+ * @return void
248
+
249
+ */
250
+
251
+ public function run()
252
+
253
+ {
254
+
255
+ for ($i = 1; $i <= 10; $i++) {
256
+
257
+ User::create([
258
+
259
+ 'screen_name' => 'test_user' .$i,
260
+
261
+ 'name' => 'TEST' .$i,
262
+
263
+ 'profile_image' => 'https://placehold.jp/50x50.png',
264
+
265
+ 'email' => 'test' .$i .'@test.com',
266
+
267
+ 'password' => Hash::make('12345678'),
268
+
269
+ 'remember_token' => str_random(10),
270
+
271
+ 'created_at' => now(),
272
+
273
+ 'updated_at' => now()
274
+
275
+ ]);
276
+
277
+ }
278
+
279
+ }
280
+
281
+ }
282
+
283
+ ```
284
+
225
285
 
226
286
 
227
287
  ```config\auth.php