PHPackages                             alucard17th/blogavel-pk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. alucard17th/blogavel-pk

ActiveLibrary[Framework](/categories/framework)

alucard17th/blogavel-pk
=======================

Blogavel - a blog/CMS package for Laravel.

v0.1.11(1mo ago)042MITPHPPHP ^8.2

Since Jan 24Pushed 1mo agoCompare

[ Source](https://github.com/Alucard17th/blogavel-pk)[ Packagist](https://packagist.org/packages/alucard17th/blogavel-pk)[ RSS](/packages/alucard17th-blogavel-pk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (20)Versions (12)Used By (0)

Blogavel
========

[](#blogavel)

Blogavel is a blog/CMS package for Laravel.

It ships:

- Web pages for public posts and a Blade-based admin UI.
- JSON API endpoints (public + admin).
- Database migrations and Eloquent models.
- Optional admin authorization gate.
- Optional API admin authentication via Laravel Sanctum or a simple API key.

Requirements
------------

[](#requirements)

- PHP ^8.2
- Laravel / Illuminate ^12.0

Installation
------------

[](#installation)

Install via Composer:

```
composer require alucard17th/blogavel-pk
```

### Publish configuration (recommended)

[](#publish-configuration-recommended)

```
php artisan vendor:publish --tag=blogavel-config
```

This will publish `config/blogavel.php`.

### Run migrations

[](#run-migrations)

```
php artisan migrate
```

Blogavel registers its migrations automatically via the service provider.

### (Optional) Publish views and translations

[](#optional-publish-views-and-translations)

If you want to customize the Blade templates or translations:

```
php artisan vendor:publish --tag=blogavel-views
php artisan vendor:publish --tag=blogavel-lang
```

Configuration
-------------

[](#configuration)

All configuration lives under `config/blogavel.php`.

### Route prefixes

[](#route-prefixes)

- `blogavel.route_prefix` (default: `blogavel`)
- `blogavel.public_posts_prefix` (default: `posts`)
- `blogavel.admin_prefix` (default: `admin`)

### Admin web middleware

[](#admin-web-middleware)

`blogavel.admin_middleware` (default: `['web', 'blogavel.admin']`)

This middleware is applied to the admin web UI routes.

By default, Blogavel uses a package middleware that redirects unauthenticated users to the Blogavel admin login page.

If you have previously published `config/blogavel.php`, make sure your published config matches this new default (or update it), otherwise you may still be using `auth` and be redirected to your app’s default login route.

### Manage Blog gate (optional)

[](#manage-blog-gate-optional)

Blogavel can register a `manage-blog` Gate and apply it to admin routes.

- `blogavel.manage_blog_gate` (default: `false`)
- `blogavel.manage_blog_allow_local` (default: `true`)
- `blogavel.manage_blog_admin_emails` (default: `[]`)
- `blogavel.manage_blog_admin_ids` (default: `[]`)

Environment variables:

```
BLOGAVEL_MANAGE_BLOG_GATE=false
BLOGAVEL_MANAGE_BLOG_ALLOW_LOCAL=true
BLOGAVEL_MANAGE_BLOG_ADMIN_EMAILS=
BLOGAVEL_MANAGE_BLOG_ADMIN_IDS=
```

When enabled:

- Web admin routes add `can:manage-blog` to the middleware stack.
- API admin routes (Sanctum mode) add `can:manage-blog` to the middleware stack.

### Media storage

[](#media-storage)

- `blogavel.media_disk` (default: `public`)
- `blogavel.media_directory` (default: `blogavel`)

### API admin authentication

[](#api-admin-authentication)

`blogavel.api_admin_auth` controls authentication for API admin endpoints.

Supported modes:

- `sanctum` (default)
- `api_key`

#### Sanctum mode

[](#sanctum-mode)

Set:

```
BLOGAVEL_API_ADMIN_AUTH=sanctum
```

You must have `laravel/sanctum` installed in your app:

```
composer require laravel/sanctum
```

Notes:

- Blogavel uses `auth:sanctum` middleware for admin API endpoints.
- Blogavel also provides simple auth endpoints under `/api//v1/auth/*` (login/me/logout).
- If Sanctum is not installed and you configured `sanctum`, Blogavel will throw a runtime exception when routes are loaded.

#### API key mode

[](#api-key-mode)

Set:

```
BLOGAVEL_API_ADMIN_AUTH=api_key
BLOGAVEL_API_KEY_HEADER=X-API-KEY
BLOGAVEL_API_KEYS=key1,key2
```

- Requests to admin API endpoints must include the configured header.
- The value must match one of the configured keys.

Routes
------

[](#routes)

Blogavel registers routes automatically.

### Web routes

[](#web-routes)

All web routes are under the `web` middleware group.

Default URLs:

- Public home: `/`
- Public posts index: `//`
- Public post page: `///{post}`
- Public comment submit: `POST ///{post}/comments`

Admin web UI:

- `///posts`
- `///categories`
- `///tags`
- `///media`
- `///comments`

Blogavel admin auth:

- `GET ///login`
- `POST ///login`
- `POST ///logout`

Admin profile:

- `GET ///profile`
- `PUT ///profile`

### API routes

[](#api-routes)

All API routes are under `api` middleware group and prefixed with `/api`.

Health:

- `GET /api//health`

Public API v1:

- `GET /api//v1/posts`
- `GET /api//v1/posts/{post}`
- `GET /api//v1/categories`
- `GET /api//v1/categories/{category}`
- `GET /api//v1/tags`
- `GET /api//v1/tags/{tag}`
- `GET /api//v1/posts/{post}/comments`
- `POST /api//v1/posts/{post}/comments`

Admin API v1:

- `POST /api//v1/admin/posts`
- `PUT /api//v1/admin/posts/{post:id}`
- `DELETE /api//v1/admin/posts/{post:id}`
- `POST /api//v1/admin/categories`
- `PUT /api//v1/admin/categories/{category:id}`
- `DELETE /api//v1/admin/categories/{category:id}`
- `POST /api//v1/admin/tags`
- `PUT /api//v1/admin/tags/{tag:id}`
- `DELETE /api//v1/admin/tags/{tag:id}`
- `POST /api//v1/admin/media`
- `DELETE /api//v1/admin/media/{medium}`
- `GET /api//v1/admin/comments`
- `POST /api//v1/admin/comments/{comment}/approve`
- `POST /api//v1/admin/comments/{comment}/spam`
- `DELETE /api//v1/admin/comments/{comment}`

Auth endpoints (Sanctum mode only):

- `POST /api//v1/auth/login`
- `GET /api//v1/auth/me`
- `POST /api//v1/auth/logout`

Models / Database tables
------------------------

[](#models--database-tables)

Blogavel uses Eloquent models and ships migrations that create (at least) the following tables:

- `blogavel_posts`
- `blogavel_categories`
- `blogavel_tags`
- `blogavel_comments`
- `blogavel_media`
- `blogavel_post_tag` (pivot)

Fetching posts in your app
--------------------------

[](#fetching-posts-in-your-app)

Blogavel ships Eloquent models you can use directly.

Example: fetch a published post (by slug) with its featured image URL:

```
use Blogavel\Blogavel\Models\Post;

$post = Post::query()
    ->published()
    ->with('featuredMedia')
    ->where('slug', $slug)
    ->firstOrFail();

$featuredImageUrl = $post->featured_image_url;
```

### Content whitespace normalization

[](#content-whitespace-normalization)

Rich-text editors and copy/paste from sources like Google Docs/Word can introduce non-breaking spaces (NBSP, `&nbsp;` / `\u00A0`) into HTML.

To prevent long unbreakable lines (horizontal overflow) and to improve excerpt/SEO text generation, Blogavel normalizes post `content` by converting NBSP whitespace into regular spaces.

Posts: author + views
---------------------

[](#posts-author--views)

Blogavel posts support:

- `author_id` (nullable)
- `views_count` (unsigned integer, default `0`)

Behavior:

- Creating a post from Blogavel admin (web + API) auto-sets `author_id` to the authenticated user, when available.
- Viewing a published post (web show + public API show) automatically increments `views_count`.

The API `PostResource` includes `views_count`, and includes an `author` object when the relationship is loaded.

Commands
--------

[](#commands)

### Create a Blogavel admin user

[](#create-a-blogavel-admin-user)

Use the interactive command:

```
php artisan blogavel:make-admin
```

This command:

- Creates a user using your app’s configured `auth.providers.users.model`.
- Adds the created user to `BLOGAVEL_MANAGE_BLOG_ADMIN_EMAILS` (or `BLOGAVEL_MANAGE_BLOG_ADMIN_IDS` when using `--use-id`).
- Enables the `manage-blog` gate via environment configuration.

If you are using config caching, run:

```
php artisan config:clear
```

Development
-----------

[](#development)

### Running the package test suite

[](#running-the-package-test-suite)

From the package root:

```
composer install
vendor/bin/phpunit -c phpunit.xml
```

### Notes on dependencies

[](#notes-on-dependencies)

- Runtime dependencies are declared under `require`.
- Test/dev dependencies are declared under `require-dev`.
- `orchestra/testbench` pulls in `laravel/framework` for testing purposes.

Contributing
------------

[](#contributing)

- Fork the repo
- Create a feature branch
- Add/adjust tests under `tests/`
- Run the test suite
- Open a PR

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance90

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Recently: every ~0 days

Total

11

Last Release

50d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6daadfc16407d1ca51d8ef0931204081db16df8e27c7d53a07937961282cecf8?d=identicon)[Alucard17th](/maintainers/Alucard17th)

---

Top Contributors

[![Alucard17th](https://avatars.githubusercontent.com/u/71114390?v=4)](https://github.com/Alucard17th "Alucard17th (14 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alucard17th-blogavel-pk/health.svg)

```
[![Health](https://phpackages.com/badges/alucard17th-blogavel-pk/health.svg)](https://phpackages.com/packages/alucard17th-blogavel-pk)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)[laravel/folio

Page based routing for Laravel.

608453.9k27](/packages/laravel-folio)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
