I read this https://laravel.com/docs/5.4/eloquent-relationships#many-to-many and I found out that
php artisan migrate
doesn't create the pivot table automatically, I checked how should I create it but I couldn't find out how to create it with extra columns. for example , these are my related models :
class User extends Authenticatable {
public function courses()
{
return $this->belongsToMany('App\Course')
->withPivot('attendance', 'grade');
->withTimestamps();
}
}
the other model
class Course extends Model
{
//
}
which I didn't need an inverse relation to instantiate here.
The issue is when I go to mysql I can't find the pivot table. So how do I create it manually with those pivot columns.