目标类 [App\HTTP\Controllers\PropertyController] 不存在。

huangapple go评论97阅读模式
英文:

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');

File Structure:
目标类 [App\HTTP\Controllers\PropertyController] 不存在。

文件结构:
目标类 [App\HTTP\Controllers\PropertyController] 不存在。

NGINX Config:
目标类 [App\HTTP\Controllers\PropertyController] 不存在。

NGINX 配置:
目标类 [App\HTTP\Controllers\PropertyController] 不存在。

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');

File Structure:
目标类 [App\HTTP\Controllers\PropertyController] 不存在。

NGINX Config:
目标类 [App\HTTP\Controllers\PropertyController] 不存在。

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

huangapple
  • 本文由 发表于 2023年6月13日 05:58:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76460572.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定