https://github.com/planetscale/laravel-caching
Sample repo for Laravel caching blog post
https://github.com/planetscale/laravel-caching
Last synced: 28 days ago
JSON representation
Sample repo for Laravel caching blog post
- Host: GitHub
- URL: https://github.com/planetscale/laravel-caching
- Owner: planetscale
- License: apache-2.0
- Created: 2022-02-08T21:00:03.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-09T19:32:54.000Z (over 4 years ago)
- Last Synced: 2025-07-12T07:33:03.737Z (12 months ago)
- Language: PHP
- Homepage:
- Size: 85 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Overview
This is a sample repo for the [Introduction to Laravel caching blog post](https://planetscale.com/blog/introduction-to-laravel-caching). 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](https://planetscale.com/blog/introduction-to-laravel-caching) for the full tutorial.
## Run the application
1. Create a database on PlanetScale. Refer to [the tutorial for full instructions](https://planetscale.com/blog/introduction-to-laravel-caching#set-up-a-database).
2. Clone this repo:
```bash
git clone -b starter https://github.com/hollylawly/laravel-caching
```
Leave off the `-b starter` if you just want the final version.
3. Install the dependencies:
```bash
composer install
```
4. Copy the `.env.example` file to `.env`:
```bash
mv .env.example .env
```
5. Update the database connection with the credentials from the PlanetScale dashboard:
```
DB_CONNECTION=mysql
DB_HOST=
DB_PORT=3306
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
MYSQL_ATTR_SSL_CA=/etc/ssl/cert.pem
```
6. Run the migrations and seeder:
```bash
php artisan migrate
php artisan db:seed
```
7. Start your application:
```bash
php artisan serve
```
8. You can now view your non-cached data from the PlanetScale database in the browser at [http://localhost:8000/api/quotes](http://localhost:8000/api/quotes).