This is the documentation for v8 but the latest version is v10 . You can switch versions in the menu on the left/at the top. Check your current version with the following command:
composer show spatie/laravel-medialibrary