This commit is contained in:
yuriko 🦊 2025-05-24 17:01:54 -04:00
parent afc1fb10bc
commit 8004c8d69e
Signed by: jaiden
SSH key fingerprint: SHA256:f8tvveBoXBrKZIQDWLLcpQrKbATUCGg98x2N4YzkDM8
12 changed files with 320 additions and 5 deletions

View file

@ -5,12 +5,16 @@ namespace App\Models;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
use MongoDB\Laravel\Eloquent\Model;
use MongoDB\Laravel\Eloquent\SoftDeletes;
use MongoDB\Laravel\Relations\BelongsTo;
use MongoDB\Laravel\Relations\BelongsToMany;
use MongoDB\Laravel\Relations\HasMany;
use Symfony\Component\HttpFoundation\StreamedResponse;
class Post extends Model
{
use SoftDeletes;
protected $fillable = [ 'rating', 'extension', 'featured' ];
public function user(): BelongsTo
@ -23,6 +27,11 @@ class Post extends Model
return $this->belongsToMany(Tag::class);
}
public function comments(): HasMany
{
return $this->hasMany(Comment::class);
}
protected function toBase64(string $path): string
{
$ext = $this->extension;