Most JS frameworks (like React, Vue, Inertia, etc.) are primarily frontend frameworks. They receive a fixed set of content from the server and are then executed in the user’s browser to provide the layout/UI the user sees and interacts with. They do not interact directly with resources on the server, including databases.
PHP frameworks (like Laravel, Symfony, even Wordpress) are always backend frameworks. They are executed on the server, where they receive an instruction from the user’s browser (in the form of an HTTP request) and, based on that, they use resources (code, files, databases) on the server to generate a response to send to the browser (in the form of an HTTP response).
There are some JavaScript frameworks that attempt to span that divide by executing JavaScript on the server as well, which can reduce code duplication (having to have code that does similar things to similar data in both frontend and backend). However you look at it, though, if you have a server with a database, you’re still going to need a backend framework of some sort to be executed on the server, and most backend frameworks are written in PHP, .NET, Python, Ruby, etc.
So yes, PHP and the other traditional backend languages have a future still. If the timeline on this page is reliable, the fastest-growing, most popular backend frameworks over the past five years have all been PHP and Python-based. The only JavaScript-based framework in the top, Express.js, has been in the top 5 pretty consistently for the past ten years and is hardly a ‘new thing’.
Will there be a time when JS backend frameworks become the juggernaut player? Perhaps. But that time isn’t now, and for a new developer, it absolutely does not make sense to avoid learning some of the current top frameworks in favour of upcoming ones that may or may not someday overtake them.