spatie/sheets
Spatie Sheets lets Laravel apps store and retrieve static content from plain text files. Markdown and front matter work out of the box, with flexible parsing, multiple content collections, indexing, and Eloquent-like casting—ideal for docs sites and blogs.
Storage facade) and service container, requiring minimal configuration.Parser contract, enabling reuse for non-Markdown content (e.g., configuration files).posts, docs) map cleanly to Laravel’s module patterns or even separate directories, aiding organization.cache()->remember()) for performance, though the package itself doesn’t enforce this.storage:link or cloud storage adapters).Storage::lock()) or queue delayed writes.spatie/array-to-object or symfony/yaml with constraints)./:id) may conflict with existing Laravel routes or require manual slug generation.Sheet facade or middleware to resolve IDs to files.Sheets::all() or indexing.title, updated_at in a sheets_metadata table).sheets table via a SheetsObserver).sheets/en/posts/, sheets/es/posts/)? Custom parsers may be needed.storage/app/sheets in Laravel Forge/Envoyer backups).Sheets facade or use a temporary filesystem (e.g., Storage::fake()).spatie/laravel-markdown or parsedown/parsedown for advanced rendering.spatie/laravel-frontmatter for shared parsing logic.spatie/laravel-caching or Redis for high-traffic sites.docs) to validate the workflow.resources/markdown directory) and migrate them to the package’s storage path.Sheets::get() calls for non-dynamic content.SheetsService to abstract file/database access:
class ContentService {
public function get(string $id, bool $fromFiles = true) {
return $fromFiles ? Sheets::get($id) : Post::findOrFail($id);
}
}
.md files as templates (e.g., Blade syntax highlighting).laravel-markdown-validator).Parser interface to support non-Markdown formats (e.g., JSON for configs):
class JsonParser implements Parser {
public function parse(string $contents): array {
return json_decode($contents, true);
}
}
sheets.web) avoid collisions with existing routes.composer require spatie/sheets.php artisan vendor:publish --tag=sheets-config.storage/app/sheets).sheets directory structure (e.g., sheets/posts/, sheets/docs/).Route::get('/docs/{id}', [SheetController::class, 'show'])).php artisan route:cache) for production.Sheets::get() calls:
$sheet = Cache::remember("sheet:{$id}", now()->addHours(1), fn() => Sheets::get($id));
Sheets::get() calls) to track performance.git add storage/app/sheets/).storage directory (or cloud bucket) instead of a database.spatie/laravel-medialibrary could inspire a file manager).chmod -R 755 storage/app/sheets).Sheets::get() calls.laravel-permission) have active communities.How can I help you explore Laravel packages today?