Source path: app/Models/Media.php
Extracted from supplied specification. Review before copying into application.

<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;

class Media extends Model
{
    protected $table = 'media';
    protected $guarded = [];

    public function url(): ?string
    {
        return $this->path ? Storage::disk(config('filesystems.default'))->url($this->path) : null;
    }
}

Add to app/Models/User.php:

php
public function posts()          { return $this->hasMany(Post::class); }
public function socialAccounts() { return $this->hasMany(SocialAccount::class); }
public function media()          { return $this->hasMany(Media::class); }
public function notificationRules() { return $this->hasMany(NotificationRule::class); }
