Set up a basic app with Laravel
In this tutorial you set up a basic app and add it to the App Store. You’ll learn how to set up the app and its widgets, authenticate, communicate with the API and receive webhooks.
We use Laravel with PHP 8.1 in this example.
Prerequisites
Section titled “Prerequisites”- A basic knowledge of Git. We work with the GitHub CLI.
- Composer, to install the dependencies. Install Composer
- MySQL, which we use to store tokens and logs.
Install
Section titled “Install”Clone the basic app Git repository to your local machine:
git clone https://github.com/CampingCare/basic-app-laravel.git
cd basic-app-laravel/Install the dependencies with Composer:
composer installYou’re only using this repository as a starting point, so remove the .git directory and start your own Git repository:
rm -rf .gitCopy the example .env file, where you’ll set up your MySQL database, and generate a Laravel app key:
cp .env.example .envphp artisan key:generateChange the database settings in the .env file:
DB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_PORT=3306DB_DATABASE=laravelDB_USERNAME=rootDB_PASSWORD=passwordNow set up the models in your MySQL database by running a migration:
php artisan migrateStart the development server
Section titled “Start the development server”Start your server to check that everything works:
php artisan serveThe application now runs on your machine, at something like http://localhost:8000/. You’ll see the default app URL page, which looks like this:

Create the app in the App Store
Section titled “Create the app in the App Store”Go to the App Store and create a new app. Open the App Store

Widgets
Section titled “Widgets”This app supports a default app URL and several widgets. We’ve added a reservation tab widget as an example. Learn more about App Store widgets
Webhooks
Section titled “Webhooks”In this example we’ve set up a webhook receiver at http://localhost:8000/api/webhooks (for POST requests only).
This example uses the rates.update_prices webhook trigger, so you get a notification whenever a price changes. You can add multiple triggers to a single webhook.
Install the app
Section titled “Install the app”To test the app, install it after you’ve saved it. Read more about the install process
After installing the app you’ll see this screen:

That’s it: your basic app works.
Go live
Section titled “Go live”The last step is to upload your application to a public host. This can be any hosting company or cloud platform you prefer, as long as it runs an up-to-date version of PHP and MySQL.