\n\n无需安装、更新或删除\n生成优化的自动加载文件\n位于 C:/wamp64/www/vuexylaravel/app\\Helpers\\helpers.php 的类 App\\Helpers\\Helper 不符合\npsr-4 自动加载标准。跳过。\n> Illuminate\\Foundation\\ComposerScripts::postAutoloadDump\n> @php artisan package:discover --ansi
\n
Error \n\n Undefined constant Illuminate\\Http\\Request::HEADER_X_FORWARDED_ALL\n at C:\\wamp64\\www\\vuexylaravel\\vendor\\fideloper\\proxy\\config\\trustedproxy.php:48\n 44\xe2\x96\x95 * - 'HEADER_X_FORWARDED_AWS_ELB' (If you are using AWS Elastic Load Balancer)\n 45\xe2\x96\x95 *\n 46\xe2\x96\x95 * @link https://symfony.com/doc/current/deployment/proxies.html\n 47\xe2\x96\x95 */\n \xe2\x9e\x9c 48\xe2\x96\x95 'headers' => Illuminate\\Http\\Request::HEADER_X_FORWARDED_ALL,\n 49\xe2\x96\x95\n 50\xe2\x96\x95 ];\n 51\xe2\x96\x95\n\n 1 C:\\wamp64\\www\\vuexylaravel\\vendor\\laravel\\framework\\src\\Illuminate\\Support\\ServiceProvider.php:138\n require()\n\n 2 C:\\wamp64\\www\\vuexylaravel\\vendor\\fideloper\\proxy\\src\\TrustedProxyServiceProvider.php:28\n Illuminate\\Support\\ServiceProvider::mergeConfigFrom("C:\\wamp64\\www\\vuexylaravel\\vendor\\fideloper\\proxy\\config\\trustedproxy.php", "trustedproxy")\nScript @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1\nRun Code Online (Sandbox Code Playgroud)\n laravel 9我正在从事与和Vite合作 的项目laravel-vite,
在开发环境中一切正常,但在生产 cPanel 服务器中我遇到了这个问题
Vite manifest not found at: /home/???????/cart_shop/public/build/manifest.json
# With
Missing Vite Manifest File
Did you forget to run `npm install && npm run dev`?
Run Code Online (Sandbox Code Playgroud)
我尝试解决问题,但没有任何效果,我需要从 vite.config.js 更改 public 文件夹和 sep 文件夹构建文件位置,但我找不到方法。
请注意:cPanel 共享服务器中的文件顺序已更改为
- home
- public_html
- cart_shop
- Root
- public
- etc
Run Code Online (Sandbox Code Playgroud)
到
- home
- public_html
- public files and folders // I changed the index URLs too.
- cart_shop
- Root
- etc
Run Code Online (Sandbox Code Playgroud)
我的vite.config.js …
users-iMac-2:backend NEHAL$ npm run dev
> dev
> vite
file:///Users/user/Desktop/backend/node_modules/vite/bin/vite.js:7
await import('source-map-support').then((r) => r.default.install())
^^^^^
SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:122:18)
at async link (internal/modules/esm/module_job.js:42:21)
users-iMac-2:backend NEHAL$
Run Code Online (Sandbox Code Playgroud) 没有命令起作用,我也尝试更新 Composer,但情况是一样的。我找到了一个指南,说忽略url()andasset()方法,但它没有解决问题。
Illuminate\Routing\UrlGenerator::__construct(): 参数 #2 ($request) 必须是 Illumina te\Http\Request 类型,给定 null,在 D:\artyir\xampp8\htdocs\boilerplate\core\vendor\laravel 中调用\
framework\src\Illuminate\Routing\RoutingServiceProvider.php 第 65 行
我正在尝试使用Vuejs构建一个独立的前端 Web 应用程序,并从我构建的Laravel 9 API中获取数据,当我尝试从前端访问数据(即浏览器控制台中的响应)时:
从源“http://127.0.0.1:8080”访问“http://localhost:8000/api”的 XMLHttpRequest 已被 CORS 策略阻止:“Access-Control-Allow-Origin”标头不存在请求的资源。
1-api.php 文件
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Models\User;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::get('/', function () {
$users = User::all();
return response()->json($users, 200);
});
Run Code Online (Sandbox Code Playgroud)
2- …
我已将 Laravel 8 应用程序升级到版本 9,根据文档:升级指南,该resources/lang目录现在位于根项目目录 ( lang) 中。
我已将该lang目录移至项目的根目录,但似乎不起作用。
// config/app.php
'locale' => 'pt-BR',
Run Code Online (Sandbox Code Playgroud)
和
// lang/pt-BR/messages.php
return [
'welcome' => 'Welcome to the app!',
];
Run Code Online (Sandbox Code Playgroud)
控制器
return response()->json([
'message' => Lang::get('messages.welcome') // it returns "messages.welcome"
]);
Run Code Online (Sandbox Code Playgroud)
但是当我将lang目录更改回 时/resources/lang,它可以像以前的 laravel 版本一样正常工作。所以我创建了一个新的 Laravel 9 项目,它工作了,这让我认为需要一些额外的配置,但它没有记录在升级指南中。我的composer.json依赖项与新的 laravel 项目完全相同。Laravel 是否需要进行任何额外配置才能识别该目录?
我正在使用 postgresql 15
我尝试运行这些
grant all privileges on database my_database to my_database_user;
grant all privileges on all tables in schema public to my_database_user;
grant all privileges on all sequences in schema public to my_database_user;
grant all privileges on all functions in schema public to my_database_user;
Run Code Online (Sandbox Code Playgroud)
但当我跑步时
php artisan 迁移 --seed
我有
SQLSTATE[42501]:权限不足:7 错误:字符 14 处的架构公共权限被拒绝(SQL:创建表“迁移”(“id”序列主键不为空,“迁移”varchar(255)不为空,“批处理”)整数不为空))
我缺少什么?
我确实确保 .env 具有正确的凭据
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=my_database
DB_USERNAME=my_database_user
DB_PASSWORD=password
Run Code Online (Sandbox Code Playgroud)
检查我是否做到了
postgres=# \du my_database_user
List of roles
Role name | Attributes | Member of
-------------+------------+----------- …Run Code Online (Sandbox Code Playgroud) 我有 3 个 Laravel 应用程序,一个在 Laravel 6 上运行,2 个在 Laravel 8 上运行。
它们都使用来自 的 Vue 和 JWT auth tymondesigns,我计划将它们全部升级到 Laravel 10。
但在我成功重建了我的一个应用程序以在其上安装 Laravel 10 和 Jetstream 后。我注意到与同一应用程序的旧版本相比,它使用了 x15 内存。
你可以在这里看到(我使用发条进行监控)。尽管 L10 与 Octane 一起运行,但它们都位于同一台服务器上,并且在具有 4GB 内存的 Ubuntu 中处于生产模式,
使用 Jetstream 运行 Laravel 10 的新版本- 使用 30MB 内存(即使使用 404)

我认为这是由于我自己的代码结构和应用程序设计造成的,所以我在 Laravel 8 和 Laravel 9 的裸安装之间进行了测试
composer create-project laravel/laravel:^8.0 l8
Run Code Online (Sandbox Code Playgroud)
和
composer create-project laravel/laravel:^9.0 l9
Run Code Online (Sandbox Code Playgroud)
然后将其添加到两个 api 路由上。
Route::get('/test', …Run Code Online (Sandbox Code Playgroud)