<?php

declare(strict_types=1);

namespace App\Filament\Resources\Auth\User\RelationManagers;

use App\Filament\RelationManagers\List\PlaylistRelationManager;
use App\Models\Auth\User;
use App\Models\List\Playlist;
use Filament\Tables\Table;

class PlaylistUserRelationManager extends PlaylistRelationManager
{
    /**
     * The relationship the relation manager corresponds to.
     */
    protected static string $relationship = User::RELATION_PLAYLISTS;

    public function table(Table $table): Table
    {
        return parent::table(
            $table
                ->inverseRelationship(Playlist::RELATION_USER)
        );
    }
}
