I am working on an application with laravel 8, whenever I run composer update 5000+ vendor files are tracked by GitHub however /vendor is added into the .gitignore file. here is a snap of my .gitignore file:

I am working on an application with laravel 8, whenever I run composer update 5000+ vendor files are tracked by GitHub however /vendor is added into the .gitignore file. here is a snap of my .gitignore file:

Might be possible that you have already staged/added the vendor folder before putting in the .gitignore file. Or you have manually staged/added the folder to git through command.
In any case, one solution for you is to unstage the files by using
git reset /vendor/*
and if this doesn't solve your problem, then it might be possible that you already have committed older files into git; so, /vendor files are getting tracked by git.
Solution steps:
/vendor folder./vendor (if there are any)composer install again to get back /vendor folder.After these steps, vendor will not be tracked. (Considering /vendor/ is still present in the .gitignore file)