Fly.toml used to be generated from fly-template.blade.php, so the attributes bag could be used to fill in the app name and php/node versions; like this: {{ $appName }}. I can see how it's convenient, but I've found it very confusing to use blade views for this.
Here's how it's done now: In the templates folder there's a fly.toml file. In there, I've added placeholders for the variables that look like this: $APP_NAME$ . When I get the contents of the file, I can do a string_replace for each of the placeholders. They're defined like this: $placeholderVariables = [ 'APP_NAME'=>$this->appName, 'NODE_VERSION'=>$this->nodeVersion, 'PHP_VERSION'=>$this->phpVersion ];
Here's a comparison for the app name in fly.toml:
Before: app = "{{$appName}}"
Now: app = "$APP_NAME$"
Fly.toml used to be generated from fly-template.blade.php, so the attributes bag could be used to fill in the app name and php/node versions; like this:
{{ $appName }}
. I can see how it's convenient, but I've found it very confusing to use blade views for this. Here's how it's done now: In thetemplates
folder there's a fly.toml file. In there, I've added placeholders for the variables that look like this:$APP_NAME$
. When I get the contents of the file, I can do astring_replace
for each of the placeholders. They're defined like this:$placeholderVariables = [ 'APP_NAME'=>$this->appName, 'NODE_VERSION'=>$this->nodeVersion, 'PHP_VERSION'=>$this->phpVersion ];
Here's a comparison for the app name in
fly.toml
: Before:app = "{{$appName}}"
Now:app = "$APP_NAME$"