laravel - Laravel Vue js项目更改不起作用
问题描述
我在数据库表中添加了两列,还在模型可填充属性中添加了这两列。
当我运行一条路线以查看结果时。它说未知列。实际上它存在于数据库表中。
我正在使用 Vue 项目开发 Laravel。现在面临部署问题。首先,当我将整个项目从本地机器上传到 Cpanel 时。一切正常。
但是,当后来我更改任何查询或其他内容时,它并没有反映在浏览器上。
我试图解决这个问题是什么?步骤一:移除缓存、视图、路由步骤二:在本地机器上 npm run dev 并将本地机器项目中的 public/js/app.js 上传到 Cpanel 项目的 public/js 目录。
将 app.js 上传到 Cpanel public/js 文件夹后,我再次运行缓存删除命令。但是没有变化反映。
我如何通过以下路线删除缓存:
use Illuminate\Support\Facades\Artisan;
Route::get("reboot",function (){
Artisan::call('config:cache');
Artisan::call('route:clear');
Artisan::call('view:clear');
Artisan::call('cache:clear');
dd("Ready to Re-start");
});
API 响应错误:
"message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'start_timestamp' in 'where clause' (SQL: select count(*) as aggregate from `vehicle_prices` where `rental_duration_id` = 5 and `rate` between 0 and 55 and exists (select * from `vehicles` where `vehicle_prices`.`vehicle_id` = `vehicles`.`id` and exists (select * from `users` where `vehicles`.`partner_id` = `users`.`id` and `is_vehicle_release` = 1 and `status` = 1) and `service_id` = 1 and `status` = 1 and `passenger` >= 1 and `bag` >= 1 and exists (select * from `vehicle_cities` where `vehicles`.`id` = `vehicle_cities`.`vehicle_id` and (`country` = BD and `locality` = Dhaka or `additional_locality_1` = Dhaka or `additional_locality_2` = Dhaka or `additional_locality_3` = Dhaka or `additional_locality_4` = Dhaka) and `vehicle_cities`.`deleted_at` is null) and not exists (select * from `reservations` where `vehicles`.`id` = `reservations`.`vehicle_id` and ((`start_timestamp` between 2020-09-11 04:00:00 and 2020-09-11 08:43:00 or `end_timestamp` between 2020-09-11 04:00:00 and 2020-09-11 08:43:00) or (`start_timestamp` <= 2020-09-11 08:43:00 and `end_timestamp` >= 2020-09-11 04:00:00))) and `vehicles`.`deleted_at` is null) and exists (select * from `vehicles` where `vehicle_prices`.`vehicle_id` = `vehicles`.`id` and `vehicles`.`deleted_at` is null))",
数据库结构:
如何处理这个问题?
解决方案
npm run watch 命令将继续在您的终端中运行并监视所有相关文件的更改。然后,Webpack 将在检测到更改时自动重新编译您的资产:
npm 运行观察
推荐阅读
- c# - C++ 中的 C# SecureCode 等价物是什么?
- android - 资源“attr/pivotX”的重复值与配置“”
- typescript - Vue Cli 3 -typescript 如何使用@Prop() 进行双向绑定?
- oauth-2.0 - 如何使用邮递员 GET 请求从 keycloack 获取访问令牌
- windows - Tomcat 9 需要 1 分钟才能停止
- javascript - 如何添加输入验证
- angular - 标头['transformRequest'] = angular.identity
- android - 如何允许用户在 Edittext 中使用 Firebase 使用手机号码或电子邮件 ID 登录
- spring-boot - 是否可以使用 Spring Cloud Stream 进行一次处理?
- c - snprintf 用于组成格式化字符串的用法