Skip to content

planetscale/laravel-caching

Repository files navigation

Overview

This is a sample repo for the Introduction to Laravel caching blog post. It has two branches:

  • starter — What you should work off of if you're going through the tutorial from scratch
  • main — The final version of the app with caching

Check out the PlanetScale blog for the full tutorial.

Run the application

  1. Create a database on PlanetScale. Refer to the tutorial for full instructions.
  2. Clone this repo:
git clone -b starter https://github.com/hollylawly/laravel-caching

Leave off the -b starter if you just want the final version.

  1. Install the dependencies:
composer install
  1. Copy the .env.example file to .env:
mv .env.example .env
  1. Update the database connection with the credentials from the PlanetScale dashboard:
DB_CONNECTION=mysql
DB_HOST=<ACCESS HOST URL> 
DB_PORT=3306
DB_DATABASE=<DATABASE_NAME> 
DB_USERNAME=<USERNAME>
DB_PASSWORD=<PASSWORD>
MYSQL_ATTR_SSL_CA=/etc/ssl/cert.pem
  1. Run the migrations and seeder:
php artisan migrate
php artisan db:seed
  1. Start your application:
php artisan serve
  1. You can now view your non-cached data from the PlanetScale database in the browser at http://localhost:8000/api/quotes.

About

Sample repo for Laravel caching blog post

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •