Can't get column data from pivot table these are my models
Products
public function users()
{
return $this->belongsToMany('App\User')->withTimestamps()->withPivot('auth_product');
}
User
public function subjects()
{
return $this->belongsToMany('App\Products')->withTimestamps()->withPivot('auth_teacher');
}
controller
$authorized_users = Products::find($id)->pivot->auth_user;
it gives "Trying to get property of non-object". I'm trying to get boolean value
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2gdAt60
via IFTTT
Aucun commentaire:
Enregistrer un commentaire