<?php
namespace App;
use App\Mail\BareMail;
use App\Notifications\PasswordResetNotification;
use Illuminate\Contracts\Auth\MustVerifyEmail;
//==========ここから追加==========
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
//==========ここまで追加==========
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
// 略
public function sendPasswordResetNotification($token)
{
$this->notify(new PasswordResetNotification($token, new BareMail()));
}
//==========ここから追加==========
public function followers(): BelongsToMany
{
return $this->belongsToMany('App\User', 'follows', 'followee_id', 'follower_id')->withTimestamps();
}
//==========ここまで追加==========
}