Why do you need whole package to enforce a simple rule/strategy?
May 24, 2020
6
Level 3
Cannot Construct an instance of Status using the value (NULL)
I am using the Laravel Enum package and its working fine for most places. but for below code from product model I am facing below error. I have checked the db and all records have one category.
public function getCategoryAttribute () {
return $this->category()->select('title')->get();
}
public function category() {
return $this->belongsTo(Category::class, 'category_id');
}
"message": "Cannot construct an instance of Status using the value (NULL) ``. Possible values are [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].",
"exception": "BenSampo\Enum\Exceptions\InvalidEnumMemberException",
Please or to participate in this conversation.