Shift now offers an API for users subscribing to a Shifty Plan. The Shift API allows you to trigger Shifts to run against your Laravel applications by using a traditional HTTP API or webhooks.
Each Shifty Plan provides access to the /api/run
endpoint. Using this endpoint you can trigger Shifts to run as part of your build, a weekly audit, or on-demand.
Currently the Shift API allows you to run the follow Shifts:
To run a Shift, send a POST
request to https://laravelshift.com/api/run with the following data:
api_token
Your Shifty Plan API tokencode
The code of the Shift you wish to run. For example:
80
for the Laravel 8.x ShiftLL
for the Laravel LinterLF
for the Laravel FixerDU
for the Dependency UpdaterCF
for the Code Formatterscs
The Git service, repository, and branch name as a colon (:
) delimited connection string. For example:
github:laravel-shift/bot:master
bitbucket:pureconcepts/workshops:develop
gitlab:jasonmccreary/blog:feature-branch
The following is an example API request using curl
to run the Laravel Fixer against the master
branch of the jasonmccreary/confidentlaravel.com
repository on GitHub. You may use this example by substituting the request data with your own API Key and values.
curl -X POST -H 'Accept: application/json' \
-d "api_token=1234567890" \
-d "code=60" \
-d "scs=github:jasonmccreary/gettinggit.com:master" \
https://laravelshift.com/api/run
Each Shifty Plan allows you to set up webhooks to perform an automated code review of your changes by running a customizable version of the Laravel Fixer anytime you open a Pull Request.
To do so, you may register a webhook for any repository included under your plan with the following details:
https://laravelshift.com/api/webhook/1234567890
application/json
For additional details on registering a webhook for your repository, review the specific documentation for GitHub, Bitbucket, or GitLab.
Sign in with any of the following services to connect Shift with your Laravel project.
Don't use one of these services?
Temporarily push your project to a free, private repository on one of these cloud-based services or upgrade your project locally with Shift for Docker.