You User and Enrollment relationships seems to be wrong ?
class enrollments extends Model{
public function user() {
return $this->belongsTo('App\User','email_column_of_enrollments_model', 'email_column_of_user_model');
}}
}
class User extends Authenticatable{
public function enrollments() {
return $this->hasMany('App\enrollments','email_column_of_user_model','email_column_of_enrollments_model');
}}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community