質問編集履歴

1

Modelクラス追加しました。

2019/05/01 15:46

投稿

Lab-art_Yamada
Lab-art_Yamada

スコア14

test CHANGED
File without changes
test CHANGED
@@ -230,6 +230,190 @@
230
230
 
231
231
 
232
232
 
233
+ ```User
234
+
235
+ <?php
236
+
237
+
238
+
239
+ namespace App;
240
+
241
+
242
+
243
+ use Illuminate\Notifications\Notifiable;
244
+
245
+ use Illuminate\Contracts\Auth\MustVerifyEmail;
246
+
247
+ use Illuminate\Foundation\Auth\User as Authenticatable;
248
+
249
+ use App\Notifications\JaPasswordReset;
250
+
251
+ use App\Http\Model\Chapter;
252
+
253
+ use App\Http\Model\Visitor;
254
+
255
+
256
+
257
+ class User extends Authenticatable
258
+
259
+ {
260
+
261
+ use Notifiable;
262
+
263
+
264
+
265
+ /**
266
+
267
+ * The attributes that are mass assignable.
268
+
269
+ *
270
+
271
+ * @var array
272
+
273
+ */
274
+
275
+ protected $fillable = [
276
+
277
+ 'chapter_id','name01','name02','kana01','kana02','company','category','base_comment', 'email', 'password','role'
278
+
279
+ ];
280
+
281
+
282
+
283
+ /**
284
+
285
+ * The attributes that should be hidden for arrays.
286
+
287
+ *
288
+
289
+ * @var array
290
+
291
+ */
292
+
293
+ protected $hidden = [
294
+
295
+ 'password', 'remember_token',
296
+
297
+ ];
298
+
299
+
300
+
301
+
302
+
303
+ public function visitor()
304
+
305
+ {
306
+
307
+ return $this->hasMany('App\Model\Visitor' , 'member_id' , 'id');
308
+
309
+ }
310
+
311
+
312
+
313
+ public function sendPasswordResetNotification($token)
314
+
315
+ {
316
+
317
+ $this->notify(new JaPasswordReset($token));
318
+
319
+ }
320
+
321
+ }
322
+
323
+ ```
324
+
325
+ ```Visitor
326
+
327
+ <?php
328
+
329
+
330
+
331
+ namespace App\Http\Model;
332
+
333
+
334
+
335
+ use Illuminate\Database\Eloquent\Model;
336
+
337
+ use Illuminate\Notifications\Notifiable;
338
+
339
+
340
+
341
+ class Visitor extends Model
342
+
343
+ {
344
+
345
+
346
+
347
+ use Notifiable;
348
+
349
+
350
+
351
+
352
+
353
+ protected $table = 'visitors';
354
+
355
+
356
+
357
+ /**
358
+
359
+ * The attributes that are mass assignable.
360
+
361
+ *
362
+
363
+ * @var array
364
+
365
+ */
366
+
367
+ protected $fillable = [
368
+
369
+ 'visit','company','name01','name02','kana01','kana02','category','member_id','member_name','comment', 'status'
370
+
371
+ ];
372
+
373
+
374
+
375
+ /**
376
+
377
+ * The attributes that should be hidden for arrays.
378
+
379
+ *
380
+
381
+ * @var array
382
+
383
+ */
384
+
385
+ protected $hidden = [
386
+
387
+ 'password', 'remember_token',
388
+
389
+ ];
390
+
391
+
392
+
393
+
394
+
395
+ public function user()
396
+
397
+ {
398
+
399
+ return $this->belongsTo('App\User','member_id');
400
+
401
+ }
402
+
403
+
404
+
405
+
406
+
407
+ }
408
+
409
+
410
+
411
+ ```
412
+
413
+
414
+
415
+
416
+
233
417
  どの辺りに問題がありそうでしょうか?
234
418
 
235
419
  その他、確認が必要なクラスがあれば追記させて頂きます。