change file type using Laravel-medialibrary code example
Example: laravel-medialibrary change name of file
$yourModel->addMedia($pathToFile)->usingName('new name')->toMediaCollection();
$yourModel->addMedia($pathToFile)->usingName('new name')->toMediaCollection();