bristol-digital/qwikblog
File-based, headless-friendly blog for Laravel with no database required. Write posts as Markdown with YAML front matter in resources/posts. Includes lightweight admin with Livewire image gallery and WYSIWYG editor, plus public index and post views.
composer require bristol-digital/qwikblog
php artisan vendor:publish --tag=qwikblog-config
php artisan vendor:publish --tag=qwikblog-admin-js
npm install @toast-ui/editor
.env
ADMIN_USERNAME=admin
ADMIN_PASSWORD=securepassword
QWIKBLOG_LAYOUT=app # or your custom layout path
vite.config.js
input: [
'resources/js/app.js',
'resources/js/qwikblog-admin.js', // Add this line
],
@source directive in app.css:
@source "../../vendor/bristol-digital/qwikblog/resources/views/**/*.blade.php";
php artisan migrate
php artisan vendor:publish --tag=qwikblog-seeds
php artisan blog:examples flamenco
npm run dev
php artisan serve
/admin and log in with your .env credentials./blog/{slug}.date in front matter to schedule posts (auto-publishes when due).hero_image or body markdown./blog/{slug}.ADMIN_USERNAME/ADMIN_PASSWORD (default).QWIKBLOG_ADMIN_MIDDLEWARE=auth to reuse your existing auth system.auth,can:manage-blog for role-based access./admin/posts?status=scheduled.blog/index.blade.php, blog/show.blade.php) with your own layout.@stack('head') exists in your layout for dynamic meta tags (OG, Twitter Cards, canonical URLs)./blog by default. Customize via QWIKBLOG_ROUTE_PREFIX.resources/posts/YYYY-MM-DD-slug.mdpublic/images/blog/{slug}/1.jpg, 2.jpg, etc./blog/category/palos).QWIKBLOG_TAXONOMY_URL_STYLE=prefixed.Post model or using Laravel’s file caching.str_contains with Algolia/Meilisearch for large post volumes.app/Providers/QwikBlogServiceProvider.php.ImageUploader service to add custom logic (e.g., watermarking).resources/posts/ and public/images/blog/ are writable by the web server.php artisan cache:clear) after adding new posts or layouts.Missing @stack('head'):
@stack('head') to your layout’s <head> section.Admin JS Not Loading:
qwikblog-admin.js fails to compile or isn’t included in Vite.resources/js/qwikblog-admin.js exists (published via vendor:publish).vite.config.js under input.npm install @toast-ui/editor.Image Paths Broken:
hero_image paths start with / (e.g., /images/blog/post-slug/1.jpg).public/images/blog/{slug}/ permissions.Scheduled Posts Not Auto-Publishing:
date in front matter is in YYYY-MM-DD HH:MM:SS format.Slug Collisions:
/blog/palos category filter.QWIKBLOG_TAXONOMY_URL_STYLE=prefixed in .env to force /blog/category/palos.Tailwind Styles Not Applying:
@source in app.css includes the package’s views.npm run dev or npm run build).Multi-Line YAML Parsing:
categories: Announcements, News) or manually convert to the expected format.Alpine.js Conflicts:
x-data) stop working in public views.Alpine.start() is called in app.js after the package’s JS loads.Check File Permissions:
ls -la resources/posts/ public/images/blog/
Ensure the web server user (e.g., www-data) can write to these directories.
Verify Front Matter: Use a YAML linter (e.g., YAML Lint) to validate post files.
Inspect Livewire Polling:
Scheduled post countdowns rely on Livewire’s wire:poll. Check browser dev tools (Network tab) for 30-second requests to /admin/posts.
Clear Caches:
php artisan cache:clear
php artisan view:clear
php artisan config:clear
Log Admin Actions:
Add debug logs in app/Providers/QwikBlogServiceProvider.php to trace post creation/updates.
QWIKBLOG_LAYOUT:
@stack('head') and other requirements.QWIKBLOG_LAYOUT=layouts.app (for resources/views/layouts/app.blade.php).QWIKBLOG_TAXONOMY_URL_STYLE:
prefixed to avoid slug collisions (e.g., /blog/category/palos instead of /blog/palos).flat (no prefix).QWIKBLOG_ADMIN_MIDDLEWARE:
auth to integrate with Laravel’s auth, but ensure your users have the correct permissions.How can I help you explore Laravel packages today?