Voyager: Force Page Reload after creating or updating an entry.

Created on 5 Jul 2018  路  12Comments  路  Source: the-control-group/voyager

Version information

  • Laravel: v5.5.40
  • Voyager: v1.1.3
  • PHP: 7.2
  • Database: MySQL 5.7.22

Description


Needed to reload page after creating or updating an entry. So for example I enter a new content onto pages form. Then when i save it, Its suppose to flash a success box on the upper right corner of the page.. however that does not happen.. i needed to press reload or f5 then thats the only time it executes the process.

Steps To Reproduce

Steps to reproduce the behavior:

  1. No actual steps so after setting up laravel and voyager on the server which has no errors. Just a simple entry creation on one of the interfaces, either page, a category etc..

Expected behavior

In my local setup it fires the success notification right away but on the server it does not.. Anybody has had the same experience? Thanks.

Screenshots

N/A

Additional context

N/A

Most helpful comment

Had the same issue. Fixed it by issuing php artisan vendor:publish --tag=voyager_assets --force and php artisan view:clear. Don't forget to clear the cache.

All 12 comments

Any errors in the browser console? Does it show the POST request being made in the devtools network tab?

Hi thanks for the reply,

Upon checking the network tab.. it does post the value but its returning 302 code found on the preview saying failed to load response data. but when i reload the page the success notice just pops out and the data has been updated.. other than that theres no console errors or what so ever..

Thanks

Can you share a screenshot of the network tab?

here is a screenshot of the network tab

image

is that ok? or do you need additional images? thanks.

302 looks alright. Looks like you're on /admin/categories/3/edit, it POSTed to /admin/categories/3, which redirected(302) to /admin/categories once done. Does this match what you're seeing?

yes it does.. however id does not seem to reflect what i have entered.. somehow it still displaying the old data.. but once i hit f5 and refresh the page thats the only time the green success notice pops up and my changes has taken effect..

Had the same issue. Fixed it by issuing php artisan vendor:publish --tag=voyager_assets --force and php artisan view:clear. Don't forget to clear the cache.

Thank you very much @vivekraj

i will let you know how it goes on my end.

I've done all the steps that @vivekraj has said, however the problem is still the same.. had to press reload just to see my changes on the next page..

so I ran

php artisan vendor:publish --tag=voyager_assets --force
php artisan view:clear
php artisan cache:clear

the vendor folder was created on my public folder so i had to move it to my public_html folder
cleared my browser cache

tried updating an entry and its still doing the same..

Hi this issue has been solved.. it was not a Voyager or Laravel issue from the get go.. but a server cache issue which I have asked the admin to remove and it was working as expected now..

Thank you!

Closing as issue is resolved.

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wislem picture wislem  路  3Comments

popica80 picture popica80  路  3Comments

IvanBohonosiuk picture IvanBohonosiuk  路  4Comments

TXRRNT picture TXRRNT  路  3Comments

duongsieu picture duongsieu  路  3Comments