Answer the question
In order to leave comments, you need to log in
Strange laravel error?
The model has a non-existent comma_tags property. These are tags separated by commas. It looks like this:
class Article extends Model
{
protected $appends = ['comma_tags'];
public function tags()
{
return $this->belongsToMany('App\Models\Tag');
}
public function getCommaTagsAttribute()
{
return $this->tags->implode('name', ', ');
}
}
Column not found: 1054 Unknown column 'comma_tags' in 'field list'
Article::create([
'name' => $name,
'text' => $text
]);
Answer the question
In order to leave comments, you need to log in
This is not a laravel error, but a SQL one.
Do It
dd(Article::create([
'name' => $name,
'text' => $text
]));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question