質問編集履歴

1

より詳しい情報を記述するための変更

2021/08/18 08:30

投稿

you3
you3

スコア16

test CHANGED
File without changes
test CHANGED
@@ -201,3 +201,113 @@
201
201
  多対多のリレーションについていろいろ調べましたが、解決に至らなかったため質問させていただきました。
202
202
 
203
203
  具体的な解決法だけではなく、参考になりそうな記事でもよいので解決に導いていただければ幸いです。よろしくお願いします。
204
+
205
+
206
+
207
+ ### 追記
208
+
209
+ migrationです。
210
+
211
+
212
+
213
+ categoriesテーブル
214
+
215
+ ```php
216
+
217
+ class CreateCategoriesTable extends Migration
218
+
219
+ {
220
+
221
+ public function up()
222
+
223
+ {
224
+
225
+ Schema::create('categories', function (Blueprint $table) {
226
+
227
+ $table->increments('id');
228
+
229
+ $table->integer('folder_id');
230
+
231
+ $table->string('name');
232
+
233
+ $table->timestamps();
234
+
235
+ });
236
+
237
+ }
238
+
239
+
240
+
241
+ ```
242
+
243
+
244
+
245
+ listsテーブル
246
+
247
+ ```php
248
+
249
+ class CreateListsTable extends Migration
250
+
251
+ {
252
+
253
+ public function up()
254
+
255
+ {
256
+
257
+ Schema::create('lists', function (Blueprint $table) {
258
+
259
+ $table->increments('id');
260
+
261
+ $table->string('name');
262
+
263
+ $table->integer('point');
264
+
265
+ $table->text('description');
266
+
267
+ $table->text('relation');
268
+
269
+ $table->text('checklist');
270
+
271
+ $table->integer('status');
272
+
273
+ $table->timestamps();
274
+
275
+ });
276
+
277
+ }
278
+
279
+
280
+
281
+ ```
282
+
283
+
284
+
285
+ categories_listsテーブル
286
+
287
+ ```php
288
+
289
+ class CreateCategoriesListsTable extends Migration
290
+
291
+ {
292
+
293
+ public function up()
294
+
295
+ {
296
+
297
+ Schema::create('categories_lists', function (Blueprint $table) {
298
+
299
+ $table->increments('id');
300
+
301
+ $table->integer('category_id');
302
+
303
+ $table->integer('list_id');
304
+
305
+ $table->timestamps();
306
+
307
+ });
308
+
309
+ }
310
+
311
+
312
+
313
+ ```