Laravel’s documentation site is excellent, and I could usually find what I needed without much trouble.

The problem was that the documentation changed very frequently. Once I started caring about what changed between updates, keeping track of those edits directly on the website became tedious.

So I started building the Laravel documentation locally and using Git to inspect the differences between my local copy and the upstream repository.

The basic idea

The Laravel documentation lives in the official docs repository.

The branches in that repository match Laravel versions such as 8.x, 7.x, and 6.x. The documentation pages themselves are plain Markdown files like artisan.md and blade.md.

The initial idea was simple:

  1. Clone the branch I wanted to track locally.
  2. Pull the latest changes from GitHub.
  3. Use Git diff to see what changed.

A simple workflow

Create a folder for the documentation and move into it:

mkdir laravel-docs
cd laravel-docs

Clone the branch you want to track:

git clone https://github.com/laravel/docs.git -b 8.x --single-branch 8.x

Later, when you want to inspect recent changes, pull the latest updates:

git pull

Then compare the new state with the previous HEAD:

git diff HEAD@{1}

That gives you a clear view of what changed in the documentation since the last pull.

Why this helped

This worked well when I only cared about one branch. I could quickly see the latest changes and keep up with the parts of the documentation that mattered to me.

After a while, though, I realized I wanted the same workflow for multiple Laravel versions. Doing that branch by branch was possible, but not especially convenient.

Taking it further

To make the process easier, I created a small script that fetches all relevant branches and added a basic HTML page to view the Markdown files locally.

That turned the workflow into something much more practical: I could track changes across versions and browse the docs on my machine without depending entirely on the live site.

If you want to see the script and the local documentation viewer, you can check the repository here:


This post was also published on Medium: Building Laravel Documentation Locally