質問編集履歴
3
ソースコードを修正しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
```該当エラー
|
26
26
|
|
27
|
-
Class "
|
27
|
+
Class "app\Models\Task" not found
|
28
28
|
|
29
29
|
|
30
30
|
|
@@ -38,7 +38,7 @@
|
|
38
38
|
|
39
39
|
17▕ for ($i = 1; $i <= 10; $i++){
|
40
40
|
|
41
|
-
➜ 18▕
|
41
|
+
➜ 18▕ Task::create([
|
42
42
|
|
43
43
|
19▕ 'title' => 'title' . $i,
|
44
44
|
|
@@ -110,7 +110,7 @@
|
|
110
110
|
|
111
111
|
|
112
112
|
|
113
|
-
use
|
113
|
+
use app\Models\Task;
|
114
114
|
|
115
115
|
use Illuminate\Database\Seeder;
|
116
116
|
|
@@ -168,7 +168,7 @@
|
|
168
168
|
|
169
169
|
|
170
170
|
|
171
|
-
use
|
171
|
+
use app\Models\Task;
|
172
172
|
|
173
173
|
use Illuminate\Database\Seeder;
|
174
174
|
|
@@ -310,7 +310,7 @@
|
|
310
310
|
|
311
311
|
|
312
312
|
|
313
|
-
namespace
|
313
|
+
namespace app\Models\Task;
|
314
314
|
|
315
315
|
|
316
316
|
|
2
エラー文を修正しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
```該当エラー
|
26
26
|
|
27
|
-
Class "App\Task" not found
|
27
|
+
Class "Database\Seeders\App\Models\Task" not found
|
28
28
|
|
29
29
|
|
30
30
|
|
@@ -38,32 +38,16 @@
|
|
38
38
|
|
39
39
|
17▕ for ($i = 1; $i <= 10; $i++){
|
40
40
|
|
41
|
-
➜ 18▕ Task::create([
|
41
|
+
➜ 18▕ App\Models\Task::create([
|
42
|
-
|
42
|
+
|
43
|
-
19▕ 'title' => 'title'
|
43
|
+
19▕ 'title' => 'title' . $i,
|
44
|
-
|
44
|
+
|
45
|
-
20▕ 'content'=> 'content'
|
45
|
+
20▕ 'content'=> 'content' . $i,
|
46
|
-
|
46
|
+
|
47
|
-
21▕ 'person_in_charge'=>'person_in_charge'
|
47
|
+
21▕ 'person_in_charge'=>'person_in_charge' . $i,
|
48
48
|
|
49
49
|
22▕ ]);
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
+7 vendor frames
|
54
|
-
|
55
|
-
8 database/seeders/DatabaseSeeder.php:19
|
56
|
-
|
57
|
-
Illuminate\Database\Seeder::call()
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
+35 vendor frames
|
62
|
-
|
63
|
-
44 artisan:37
|
64
|
-
|
65
|
-
Illuminate\Foundation\Console\Kernel::handle()
|
66
|
-
|
67
51
|
```
|
68
52
|
|
69
53
|
|
1
ソースコードを大幅に変更しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -126,7 +126,7 @@
|
|
126
126
|
|
127
127
|
|
128
128
|
|
129
|
-
use App\Task;
|
129
|
+
use App\Models\Task;
|
130
130
|
|
131
131
|
use Illuminate\Database\Seeder;
|
132
132
|
|
@@ -154,11 +154,11 @@
|
|
154
154
|
|
155
155
|
Task::create([
|
156
156
|
|
157
|
-
'title' => 'title'
|
157
|
+
'title' => 'title' . $i,
|
158
|
-
|
158
|
+
|
159
|
-
'content'=> 'content'
|
159
|
+
'content'=> 'content' . $i,
|
160
|
-
|
160
|
+
|
161
|
-
'person_in_charge'=>'person_in_charge'
|
161
|
+
'person_in_charge'=>'person_in_charge' . $i,
|
162
162
|
|
163
163
|
]);
|
164
164
|
|
@@ -170,6 +170,8 @@
|
|
170
170
|
|
171
171
|
|
172
172
|
|
173
|
+
|
174
|
+
|
173
175
|
```
|
174
176
|
|
175
177
|
```DatabaseSeeder.php
|
@@ -182,6 +184,8 @@
|
|
182
184
|
|
183
185
|
|
184
186
|
|
187
|
+
use App\Models\Task;
|
188
|
+
|
185
189
|
use Illuminate\Database\Seeder;
|
186
190
|
|
187
191
|
use Illuminate\Support\Facades\DB;
|
@@ -238,6 +242,8 @@
|
|
238
242
|
|
239
243
|
{
|
240
244
|
|
245
|
+
protected $connection = 'mysql';
|
246
|
+
|
241
247
|
/**
|
242
248
|
|
243
249
|
* Run the migrations.
|
@@ -252,7 +258,7 @@
|
|
252
258
|
|
253
259
|
{
|
254
260
|
|
255
|
-
Schema::create('tasks', function (Blueprint $table) {
|
261
|
+
Schema::connection('mysql')->create('tasks', function (Blueprint $table) {
|
256
262
|
|
257
263
|
$table->bigIncrements('id');
|
258
264
|
|
@@ -266,6 +272,24 @@
|
|
266
272
|
|
267
273
|
});
|
268
274
|
|
275
|
+
|
276
|
+
|
277
|
+
Schema::create('tasks', function(Blueprint $table){
|
278
|
+
|
279
|
+
$table->engine = 'InnoDB';
|
280
|
+
|
281
|
+
});
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
Schema::create('tasks', function(Blueprint $table){
|
286
|
+
|
287
|
+
$table->charset = 'utf8mb4';
|
288
|
+
|
289
|
+
$table->collation = 'utf8mb4_unicode_ci';
|
290
|
+
|
291
|
+
});
|
292
|
+
|
269
293
|
}
|
270
294
|
|
271
295
|
|
@@ -302,7 +326,7 @@
|
|
302
326
|
|
303
327
|
|
304
328
|
|
305
|
-
namespace App;
|
329
|
+
namespace App\Models\Task;
|
306
330
|
|
307
331
|
|
308
332
|
|
@@ -318,6 +342,8 @@
|
|
318
342
|
|
319
343
|
{
|
320
344
|
|
345
|
+
protected $connection ='mysql';
|
346
|
+
|
321
347
|
protected $fillable = [
|
322
348
|
|
323
349
|
'title',
|