This is the final repo for the Laravel MySQL Mood Tracker project showing PlanetScale integration. You can find the full tutorial on the PlanetScale blog.
- Clone the repo:
git clone git@github.com:planetscale/laravel-crud-mysql.git
- Install the dependencies (
npm install
for Tailwind):
cd laravel-crud-mysql
composer install
npm install
-
Create your PlanetScale database. For complete instructions, see this section of the tutorial.
-
Copy the
.env
file:
mv .env.example .env
- Update the
.env
database section with your PlanetScale credentials. It should look similar to this:
DB_CONNECTION=mysql
DB_HOST=xxxxxxxxxx.us-east-3.psdb.cloud
DB_PORT=3306
DB_DATABASE=laravel-mood-tracker
DB_USERNAME=xxxxxxxxxxx
DB_PASSWORD=pscale_pw_xxxxxx-xx-xxxxxxxxxxxxxxxxxxxxxxxx
MYSQL_ATTR_SSL_CA=/etc/ssl/cert.pem
Note: The value for MYSQL_ATTR_SSL_CA
will depend on your system. You can find more information on our Secure Connections page.
- Run the migrations:
php artisan migrate
- Seed the database:
php artisan db:seed
- Start the build process (for Tailwind):
npm run watch
- Start the server:
php artisan serve
- View the application at http://localhost:8080