Laravel Version
13.7.0
PHP Version
8.4.20
Database Driver & Version
0.0.35
Description
Since I decided to migrate my projects from Laravel 12.58 to Laravel 13.7, I’ve been facing a few issues with clean Laravel installations. I used the Laravel installer and also by composer create-project --prefer-dist laravel/laravel project-13. After over 10 attempts to create a project, I got one working.
This sounds weird, as I come from Laravel 3 and beyond and have never had such a painful time getting a project up and running, which, until Laravel 12, was up and running in seconds, including MySQL databases, migrations, etc. Everything worked.
Yet... the working Laravel 13 project started throwing a frontend error related to tempnam(). Since my first goal was to migrate data, I created a migration controller and started creating models and migrations, then migrated the data without any issues, using dd("Migrates n rows...").
When I went back to the frontend, the hell fell over my desk. I kept 2 days trying to solve the views issue with AI assistants, and we made numerous changes, tests, and nothing, until. I found that the views in the storage/framework/views/ had a different naming from what I was used to in other Laravel versions. They did not end with the .php extension. As an example, I had the views named like bc53c4eee5ad355c55277ab9b4eb0d48.phpedkjn07m9cq93UgY85C.
Looking closely, I mentioned this to the AI agent, and he explained that Laravel 13 views processing is quite different:
- Laravel creates a temporary file with a random suffix (e.g., ...phpABC123).
- It writes the compiled PHP code into that file.
- It then renames that file to the final name (e.g., .hashedfilename12345679389267863277832.php).
The "bug" is that my Homestead shared folder allowed steps 1 and 2 but **blocked step 3 (Renaming) **.
AI found a solution to fix the "Rename" permission by:
# 1. Remove the "garbage" temporary files `
rm /var/www/project-name/storage/views`
# 2. Force the web server to own the directory so it can "Rename" files
sudo chown -R vagrant:www-data /var/www/project-name/storage
sudo chmod -R 775 /var/www/project-name/storage
# 3. Clear the cache
php artisan config:clear
and by forcing Homestead to perform some mount_options:
folders:
- map: ~/code/project-name
to: /var/www/project-name
options:
mount_options: ["dmode=777", "fmode=777"] # This forces everything to be writable
In this newly created Homestead machine, I migrated my projects, and I have those Laravel projects running fine with different PHP versions, from PHP 7.4 to PHP 8.4.
I'm only struggling with Laravel 13.7, and I’m not sure that the view compiling process has any bug, but as a summary, the Renaming process does not always work, leaving the files with a hash string glued to the .phpview file extension.
Steps To Reproduce
As mentioned above, create a fresh Laravel 13 project and check if you get the tempnam() error on the front end.

Laravel Version
13.7.0
PHP Version
8.4.20
Database Driver & Version
0.0.35
Description
Since I decided to migrate my projects from Laravel 12.58 to Laravel 13.7, I’ve been facing a few issues with clean Laravel installations. I used the Laravel installer and also by
composer create-project --prefer-dist laravel/laravel project-13. After over 10 attempts to create a project, I got one working.This sounds weird, as I come from Laravel 3 and beyond and have never had such a painful time getting a project up and running, which, until Laravel 12, was up and running in seconds, including MySQL databases, migrations, etc. Everything worked.
Yet... the working Laravel 13 project started throwing a frontend error related to
tempnam(). Since my first goal was to migrate data, I created a migration controller and started creating models and migrations, then migrated the data without any issues, usingdd("Migrates n rows...").When I went back to the frontend, the hell fell over my desk. I kept 2 days trying to solve the views issue with AI assistants, and we made numerous changes, tests, and nothing, until. I found that the views in the
storage/framework/views/had a different naming from what I was used to in other Laravel versions. They did not end with the.phpextension. As an example, I had the views named likebc53c4eee5ad355c55277ab9b4eb0d48.phpedkjn07m9cq93UgY85C.Looking closely, I mentioned this to the AI agent, and he explained that Laravel 13 views processing is quite different:
The "bug" is that my Homestead shared folder allowed steps 1 and 2 but **blocked step 3 (Renaming) **.
AI found a solution to fix the "Rename" permission by:
and by forcing Homestead to perform some mount_options:
folders: - map: ~/code/project-name to: /var/www/project-name options: mount_options: ["dmode=777", "fmode=777"] # This forces everything to be writableIn this newly created Homestead machine, I migrated my projects, and I have those Laravel projects running fine with different PHP versions, from PHP 7.4 to PHP 8.4.
I'm only struggling with Laravel 13.7, and I’m not sure that the view compiling process has any bug, but as a summary, the Renaming process does not always work, leaving the files with a hash string glued to the
.phpview file extension.Steps To Reproduce
As mentioned above, create a fresh Laravel 13 project and check if you get the
tempnam()error on the front end.