Category relationship in laravel Undefined property: stdClass::
问题 Hi i'm working on a laravel training project . i'm having an issue with models and relationships when i'm trying to get the each product category name . Here is my Product Model <?php namespace App; use Illuminate\Database\Eloquent\Model; class Product extends Model { public function category() { return $this->belongsTo('App\Category'); } } and my Category model <?php namespace App; use Illuminate\Database\Eloquent\Model; class Category extends Model { protected $table = 'categories'; public