forked from eatvio/eatvio-infra
29 lines
514 B
PHP
29 lines
514 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class UserAttachment extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $guarded = [];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function scopeCerts($query)
|
|
{
|
|
return $query->where('user_attachments.group', 'user_certs');
|
|
}
|
|
|
|
public function meals()
|
|
{
|
|
return $this->belongsToMany(Meal::class);
|
|
}
|
|
}
|