Upstart for Laravel

Developer Mode & Testing

This package provides features to help you test your application without having to install it on the upcoach app.

Enabling Developer Mode

  • To enable developer mode, you can set the UPCOACH_DEVELOPER_MODE environment variable. When developer mode is enabled, the Client class is replaced with FakeClient, and API calls are mocked. For more information, refer to the Upcoach\UpstartForLaravel\Mocks\FakeClient class.

UPCOACH_DEVELOPER_MODE=true

Simulating upcoach Requests

  • You can use the upstart:simulate artisan command to simulate upcoach requests. This command supports interactive mode, where you can answer the questions directly in the console. Run the following command to start the interactive mode:

php artisan upstart:simulate

Alternatively, you can simulate a request directly by providing the required options. Here's an example:

php artisan upstart:simulate --type=block --url=your-block-connector-path

You can also provide a payload for overriding the default payload parameters:

php artisan upstart:simulate --type=block --url=your-block-connector-path --payload='{"o": "custom-organization-id"}'

This command is also useful for testing settings pages:

php artisan upstart:simulate --type=settings --url=your-settings-page

After running the upstart:simulate command, it will display the URL that you can open in your browser to simulate the request. Additionally, it will output the full command, including all payload parameters, which you can use directly from the console for subsequent requests without having to answer the questions and obtain the same URL.

Previous
Usage