$photos * @property-read int|null $photos_count * @property-read \Illuminate\Database\Eloquent\Collection $portions * @property-read int|null $portions_count * @property-read \App\Models\User|null $user * * @method static \Illuminate\Database\Eloquent\Builder|Meal newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Meal newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Meal query() * @method static \Illuminate\Database\Eloquent\Builder|Meal whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Meal whereDiaryId($value) * @method static \Illuminate\Database\Eloquent\Builder|Meal whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|Meal whereMood($value) * @method static \Illuminate\Database\Eloquent\Builder|Meal whereSatiety($value) * @method static \Illuminate\Database\Eloquent\Builder|Meal whereTime($value) * @method static \Illuminate\Database\Eloquent\Builder|Meal whereType($value) * @method static \Illuminate\Database\Eloquent\Builder|Meal whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Meal whereUserId($value) * * @mixin \Eloquent */ class Meal extends Model { use HasFactory; protected $fillable = ['*']; public function user() { return $this->belongsTo(User::class)->withDefault([ 'name' => 'Guest Author', ]); } public function diary() { return $this->belongsTo(Diary::class); } public function portions() { return $this->hasMany(Portion::class); } public function photos() { return $this->belongsToMany(UserAttachment::class); } }