techenby/docify
Docify is a simple Markdown documentation viewer for Laravel TALL apps. Install via Artisan to generate a docs folder, optionally publish config and views, and control which environments can access it. Supports an Edit link using DOCIFY_EDITOR (or Debugbar/Ignition) defaults.
Installation:
composer require techenby/docify
php artisan docify:install
This creates a docs/ directory in your project root with a default index.md file.
First Use Case:
/docs in your Laravel app (only in local environment by default).docs/index.md to add your own Markdown content./docs page to see your changes rendered.docs/ folder in your project root.php artisan vendor:publish (config, Livewire component, and layout).config/docify.php for allowed environments.Documentation Management:
docs/ directory.docs/api/endpoints.md).[API Endpoints](./api/endpoints.md)).Livewire Integration:
Docify) for rendering docs.php artisan vendor:publish --tag=docify-layout
resources/views/vendor/docify.blade.php.Environment-Specific Access:
local, staging) via config/docify.php:
'environments' => ['local', 'staging'],
Editor Integration:
.env:
DOCIFY_EDITOR=cursor # or 'vscode', 'phpstorm', etc.
DEBUGBAR_EDITOR or IGNITION_EDITOR if DOCIFY_EDITOR is unset.Theming:
php artisan vendor:publish --tag=docify-css
resources/css/docify.css file.Route Guarding:
Add middleware to protect the /docs route in production:
Route::middleware(['web', 'auth'])->get('/docs', [Docify::class, 'index']);
API Documentation:
Use the docs/ folder to document API endpoints. Example structure:
docs/
├── api/
│ ├── endpoints.md
│ └── models.md
└── index.md
CI/CD Pipelines:
Exclude the docs/ folder from Git if it’s auto-generated (e.g., via php artisan docify:install in CI). Use .gitignore:
/docs/
Local Development:
Use the "Edit" link to open Markdown files in your preferred editor (e.g., VS Code, Cursor). Requires DOCIFY_EDITOR to be set.
Environment Restrictions:
/docs is only accessible in the local environment. Forgetting to update config/docify.php can lock you out of the docs in other environments (e.g., staging).environments array:
'environments' => ['local', 'staging', 'production'], // Example for broader access
Editor Link Failures:
DOCIFY_EDITOR, DEBUGBAR_EDITOR, or IGNITION_EDITOR being set. If none are configured, the link will break.DOCIFY_EDITOR in .env:
DOCIFY_EDITOR=vscode
docs/ folder in your editor if the link fails.Markdown Rendering Quirks:
docs/index.md before relying on it for critical documentation.Livewire Component Caching:
php artisan view:clear
File Permissions:
php artisan docify:install command creates the docs/ folder with default permissions. If your web server (e.g., Nginx, Apache) lacks write access, you may encounter issues when editing files via the "Edit" link.docs/ folder is writable:
chmod -R 755 docs/
Check the Config:
config/docify.php for correct settings, especially environments and editor.php artisan config:clear if changes aren’t applying.Livewire Logs:
'log' => env('APP_DEBUG', false),
in config/livewire.php.Markdown Parsing:
.md files. Use a tool like Markdown Live Preview to validate.Route Debugging:
/docs route is registered. Run:
php artisan route:list
to verify the route exists.Custom Layouts:
resources/views/vendor/docify.blade.php.Custom Markdown Processing:
docify.markdown tag:
$this->app->bind('docify.markdown', function () {
return new CustomMarkdownParser();
});
Dynamic Documentation:
Docify Livewire component. Override the getDocs() method to return custom content.Search Functionality:
Versioning:
docs/v1/, docs/v2/, etc., and adding a version selector to the layout. Use route parameters to switch versions:
Route::get('/docs/{version?}', [Docify::class, 'index'])->where('version', 'v[0-9]+');
How can I help you explore Laravel packages today?