forked from eatvio/eatvio-infra
live charts update added
This commit is contained in:
29
app/Models/UserAttachment.php
Normal file
29
app/Models/UserAttachment.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Models\Meal;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user