英文:
Target class [App\HTTP\Controllers\PropertyController] does not exist
问题
I know this question has been asked a dozen times and has a dozen answers. But none have helped me.
我知道这个问题已经被问了很多次,也有很多答案。但都没有帮助到我。
I just deployed a new Laravel 10 App to AWS running an Ubuntu Server with the latest stable release.
我刚刚部署了一个新的 Laravel 10 应用程序到运行最新稳定版的 Ubuntu 服务器上。
PHP 8.1
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2-1ubuntu2.11, Copyright (c), by Zend Technologies
PHP 8.1
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2-1ubuntu2.11, Copyright (c), by Zend Technologies
NGINX
nginx version: nginx/1.18.0 (Ubuntu)
NGINX
nginx version: nginx/1.18.0 (Ubuntu)
web.php
# Property Functions
Route::get('/claim_property/{name?}', [PropertyController::class, 'index'])
->name('claim_property');
Route::post('/claim_property', [PropertyController::class, 'save'])
->name('claim_property_store');
web.php
# Property Functions
Route::get('/claim_property/{name?}', [PropertyController::class, 'index'])
->name('claim_property');
Route::post('/claim_property', [PropertyController::class, 'save'])
->name('claim_property_store');
I have run:
composer dump-autoload
php artisan cache:clear
php artisan route:cache
我已经运行了:
composer dump-autoload
php artisan cache:clear
php artisan route:cache
https://flareapp.io/share/B5ZGqB2m#debug
https://flareapp.io/share/B5ZGqB2m#debug
Can anyone help me? What am I doing wrong?
It works locally under Sail.
有人可以帮助我吗?我做错了什么吗?
在本地使用 Sail 可以正常工作。
英文:
I know this question has been asked a dozen times and has a dozen answers. But none have helped me.
I just deployed a new Laravel 10 App to AWS running an Ubuntu Server with the latest stable release.
PHP 8.1
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2-1ubuntu2.11, Copyright (c), by Zend Technologies
NGINX
nginx version: nginx/1.18.0 (Ubuntu)
web.php
use App\HTTP\Controllers\PropertyController;
# Property Functions
Route::get('/claim_property/{name?}', [PropertyController::class, 'index'])
->name('claim_property');
Route::post('/claim_property', [PropertyController::class, 'save'])
->name('claim_property_store');
I have run:
composer dump-autoload
php artisan cache:clear
php artisan route:cache
https://flareapp.io/share/B5ZGqB2m#debug
Can anyone help me? What am I doing wrong?
It works locally under Sail.
答案1
得分: 1
在web.php中将 use App\HTTP\Controllers\PropertyController;
更改为 use App\Http\Controllers\PropertyController;
然后,如果必要,重复执行:
composer dump-autoload
php artisan cache:clear
php artisan route:cache
英文:
In web.php change use App\HTTP\Controllers\PropertyController;
with use App\Http\Controllers\PropertyController;
Then, if necessary, repeat:
composer dump-autoload
php artisan cache:clear
php artisan route:cache
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论