I added two columns at the database table, also added those two columns at the model fillable attribute.
When I run a route to see the result. It’s saying unknown column. Actually it exists at the database Table.
I am working on Laravel with Vue project.
Now am facing deployment issues.
First of all, when I uploaded the entire project to Cpanel from my local machine. Everything working properly.
But, when later I changed any query or other things it’s not reflecting on the browser.
What I tried to solve this problem?
Step 1: Removed cache, views, routes
Step 2: npm run dev at the local machine and uploaded public/js/app.js from local machine project to Cpanel project public/js directory.
After upload app.js to the Cpanel public/js folder, I am running again the cache remove command. But there is no change reflection.
How I remove cache through the route below :
use IlluminateSupportFacadesArtisan;
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 response error :
"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))",
Database structure :
How to deal with this problem?
2
Answers
The npm run watch command will continue running in your terminal and watch all relevant files for changes. Webpack will then automatically recompile your assets when it detects a change:
npm run watch
You need to watch your changes with the command npm run watch if you are not able to see your changes after compiling then it means your project front end is caching, you can specify the version of your compiled file from where you include it in your application. you can do it like this.
or do this so that you don’t keep changing version very time you update