Push Local Changes

Page last updated:

Page last updated:

In this step you’ll learn how to propagate a local change to the application through to Cloud Foundry. As a simple change, we’ll have the app expose the framework version on an endpoint.

Add the /version route to the app/Http/routes.php file to show the framework version. Your final added route should look something like this:

$app->get('/version', function () use ($app) {
  return response()->json([ 'version' => $app->version()]);
});

Now test locally:

$ php -S localhost:3000 -t public

Visiting your application at /version, you should see the framework version.

Now deploy. All you need to do is cf push again:

$ cf push my-php-app

Finally, check that everything is working by visiting your app’s URL from your web browser.

I can push local changes
View the source for this page in GitHub