Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Paper Laravel Package

jacobjoergensen/laravel-paper

Laravel Paper adds flat-file drivers to Eloquent for Laravel 12+ (PHP 8.4+). Point a model to a content directory and query Markdown or JSON files with familiar Eloquent APIs—no database, schema, or custom connection. Uses attributes + a trait.

View on GitHub
Deep Wiki
Context7

Laravel Paper

Latest Version Documentation Tests License

Laravel Paper is a Laravel package that adds flat-file driver support for Eloquent. It supports Markdown and JSON files and works with Laravel 12+ on PHP 8.4+.

Why Laravel Paper?

Two PHP 8 attributes and a trait. No custom database connection, no schema, your flat files use Eloquent's familiar query API.

Get Started

composer require jacobjoergensen/laravel-paper

Write a file in a content directory:

---
title: Building a Blog with Flat Files
published: true
date: "2024-03-15"
---

Your Markdown content goes here...

Point a model at that directory:

use Illuminate\Database\Eloquent\Model;
use JacobJoergensen\LaravelPaper\Attributes\ContentPath;
use JacobJoergensen\LaravelPaper\Attributes\Driver;
use JacobJoergensen\LaravelPaper\Paper;

#[Driver('markdown')]
#[ContentPath('content/posts')]
class Post extends Model
{
    use Paper;
}

The filename without extension becomes the slug, which is the primary key. From there it is Eloquent:

$posts = Post::where('published', true)
    ->orderBy('date', 'desc')
    ->get();

$post = Post::find('hello-world');

Documentation

Find the full documentation at laravel-paper.com.

AI-Assisted Development

Paper ships a Laravel Boost skill. If your project uses Boost, php artisan boost:install offers to install it, giving your AI agent Paper-specific guidance for writing and querying flat-file models.

Contributing

See CONTRIBUTING.md for filing bugs and submitting PRs.

License

MIT. See LICENSE.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle