Skip to content

beniyke/scribe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scribe

Scribe is a professional blogging and content management package for the Anchor Framework. It provides a robust foundation for building feature-rich blogs with categories, tags, comments, and built-in SEO controls.

Features

  • Fluent Post Building: Expressive API for creating, updating, and scheduling posts.
  • Taxonomies: Nested Categories and flat Tags for organized content.
  • SEO & Social Metadata: Built-in support for Meta Titles, Descriptions, and Open Graph tags.
  • Publishing Workflows: Drafts, Scheduled, and Published statuses.
  • Analytics: Track post views and engagement trends.
  • Defensive Integration: Gracefully works with or without optional packages like Audit and Media.

Installation

Scribe is a package that requires installation before use.

Install the Package

php dock package:install Scribe --packages

This command will:

  • Publish the scribe.php configuration file.
  • Run the migration for Scribe tables.
  • Register the ScribeServiceProvider.

Basic Usage

Creating a Post

Use the Scribe facade to build a new post programmatically.

use Scribe\Scribe;

$post = Scribe::post()
    ->title('The Future of Agentic Coding')
    ->content('Content goes here...')
    ->excerpt('A brief summary of the post.')
    ->category(5)
    ->tags([1, 2, 8])
    ->seo([
        'title' => 'Agentic Coding | Anchor Framework',
        'description' => 'Learn how AI agents are transforming software development.',
    ])
    ->status('published')
    ->create();

Fetching Posts

// Find by slug
$post = Scribe::findPost('the-future-of-agentic-coding');

// Find by refid
$post = Scribe::findPostByRefId('pst_abc123');

Scheduling a Post

You can schedule posts for future publication using the schedule method.

use Scribe\Scribe;
use Helpers\DateTimeHelper;

$post = Scribe::post()
    ->title('Upcoming Feature Announcement')
    ->content('Stay tuned...')
    ->status('scheduled')
    ->publishedAt(DateTimeHelper::now()->addDays(7))
    ->create();

Category Management

Scribe supports hierarchical categories. Use the CategoryBuilder for fluent creation.

use Scribe\Scribe;

$category = Scribe::category()
    ->name('Technology')
    ->description('Latest in tech.')
    ->create();

// Create a sub-category
$subCategory = Scribe::category()
    ->name('AI')
    ->parent($category)
    ->create();

Fetching Categories

// Find by slug
$category = Scribe::findCategory('technology');

// Find by refid
$category = Scribe::findCategoryByRefId('cat_xyz789');

Advanced Usage

Handling Comments

Scribe includes a simple comment system that can be moderated.

use Scribe\Scribe;

$comment = Scribe::addComment($post, [
    'content' => 'Great article!'
], userId: 1);

SEO Metadata Generation

If you don't manually set SEO meta, Scribe can generate it for you.

use Scribe\Scribe;

$meta = Scribe::generateSeoMeta($post);

Analytics Trends

Track engagement over time for specific posts.

use Scribe\Scribe;

// Record a view
Scribe::recordView($post, $userId, $sessionId);

// Get view counts for the last 30 days
// Returns: [['date' => '2026-01-01', 'count' => 10], ...]
$trends = Scribe::analytics()->getPostTrends($post, days: 30);

// Get popular posts
// Returns: [[Post Model], [Post Model], ...]
$topPosts = Scribe::analytics()->getTopPosts(limit: 5);

Integration

  • Media: Use the Media facade to handle featured images and post assets via attachMedia().
  • Audit: Automatically logs publishing and scheduling events if installed.
  • Link: Generate signed URLs for private or early-access post previews.

About

Professional blogging and SEO-optimized CMS with scheduled publishing and engagement analytics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages