analysators added

This commit is contained in:
Anatoliy Poloz
2023-12-18 14:36:32 +03:00
parent e9c4647f26
commit 92a54106ef
166 changed files with 32767 additions and 1222 deletions

View File

@@ -2,12 +2,12 @@
namespace App\Models;
use CyrildeWit\EloquentViewable\Contracts\Viewable;
use CyrildeWit\EloquentViewable\InteractsWithViews;
use Illuminate\Database\Eloquent\Casts\AsCollection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Casts\AsCollection;
use CyrildeWit\EloquentViewable\InteractsWithViews;
use CyrildeWit\EloquentViewable\Contracts\Viewable;
class Recipe extends Model implements Viewable
{
@@ -20,7 +20,7 @@ class Recipe extends Model implements Viewable
protected $withCount = [
'likes',
'comments'
'comments',
];
public function tags()
@@ -41,7 +41,7 @@ class Recipe extends Model implements Viewable
[
'name' => 'Guest Author',
'id' => 0,
'profile_photo_url' => 'https://dev2.eatvio.com/storage/profile-photos/mW87tqy9P8O31Dauyvg8f7GowMNMsgt9J6u47T7S.jpg'
'profile_photo_url' => 'https://dev2.eatvio.com/storage/profile-photos/mW87tqy9P8O31Dauyvg8f7GowMNMsgt9J6u47T7S.jpg',
]
);
}
@@ -79,7 +79,7 @@ class Recipe extends Model implements Viewable
public function scopeContainsTag($query, $tagString): Builder
{
$tagId = Str::of($tagString)->split('/-/')->first();
return Tag::find($tagId)->recipes();
}
}