Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php artisan down --refresh=5 does not work in combination with --render="maintenance.index" #42208

Closed
lordisp opened this issue May 1, 2022 · 2 comments · Fixed by #42217
Closed
Labels

Comments

@lordisp
Copy link

lordisp commented May 1, 2022

  • Laravel Version: 9.9.0
  • PHP Version: 8.1.5
  • Database Driver & Version:

Description:

php artisan down --refresh=5 does not work in combination with --render="maintenance.index"

Steps To Reproduce:

create a custom maintenance.index view

run php artisan down --refresh=5 --render="maintenance.index"

Expected behavior:

maintenance.index view will be rendered and refreshed every 5 seconds

Actual behavior:

maintenance.index view will be rendered but NOT refreshed every 5 seconds

I found this issue on stackoverflow and proposed the below workaround

current workaround:

Parsing the --refresh=5 argument from $_SERVER['argv'] if available and conditionally add a refresh meta tag in the blade

$result = array_values(preg_grep('/(--refresh)/', array_values( $_SERVER['argv'] ) ));
if(!empty($result)){
  $refresh = substr($result[0], strpos($result[0], "=") + 1);
}
@if(isset($refresh))
   <meta http-equiv="refresh" content="{{$refresh}}">
@endif
@driesvints
Copy link
Member

Thank you for reporting this. I've sent in a fix for this here: #42217

@driesvints driesvints linked a pull request May 2, 2022 that will close this issue
@driesvints
Copy link
Member

Will be in next release. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants