Download the PHP package weeklify/ez-knowledge-base without Composer

On this page you can find all versions of the php package weeklify/ez-knowledge-base. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ez-knowledge-base

EzKnowledgeBase

A self-contained Laravel package that provides a fully themed knowledge base with categorised articles, full-text search, support tickets, and a REST API — all configurable via a single config file.

Features

Requirements

Installation

1. Install via Composer

The service provider is auto-discovered via Laravel's package discovery. If you need to register it manually, add to config/app.php providers array:

2. Publish config and assets

3. Run migrations

This creates the kb_categories, kb_articles, kb_tags, kb_article_tag, kb_tickets, and kb_ticket_replies tables, along with a user_id foreign key on kb_tickets.

4. Seed sample data (optional)

5. Set up search (optional but recommended)

Add to .env:

The host app should extend the package's base KbArticle model and add the Searchable trait:

Import existing articles into the search index:

6. Set up user integration

Add the KB traits to your User model depending on the roles you need:

Configure admin email addresses in config/kb.php:

7. Set up email ticket replies (optional)

When enabled, admin/staff replies to support tickets automatically email the customer. Customers can reply directly to those emails, which are processed via Brevo's inbound parse webhook and stored as ticket replies.

Add to your .env:

Brevo inbound parse setup:

  1. In your Brevo account, go to Transactional → Settings → Inbound Parse
  2. Add a new inbound rule for your reply domain (e.g. parse.yourdomain.com)
  3. Set the webhook URL to https://yourdomain.com/webhook/kb/inbound
  4. Ensure your DNS MX record for the reply domain points to Brevo's inbound servers

Webhook authentication: The webhook is secured via the X-Brevo-Secret header. You must set KB_REPLY_WEBHOOK_SECRET — the webhook will return 403 if no secret is configured. The secret is only accepted via the X-Brevo-Secret header (query parameters are not supported).

Brevo dependency: The getbrevo/brevo-php package is suggested but not required. Install it if you need Brevo API integration beyond inbound webhooks:

CSRF exemption: The webhook route is registered outside the web middleware group, but you should also add webhook/kb/inbound to your VerifyCsrfToken middleware's $except array if your app applies CSRF globally.

How it works:

  1. Admin/staff replies to a ticket in the admin panel
  2. The KbTicketReplied event fires, triggering the SendTicketReplyNotification queued listener
  3. An email is sent to the customer with a Reply-To address containing an HMAC-signed token (e.g. ticket+{token}@parse.yourdomain.com)
  4. When the customer replies, Brevo's inbound parse POSTs the email to your webhook
  5. The webhook verifies the token (valid for 30 days by default), validates the sender email matches the ticket, checks spam score, sanitizes the HTML body, and stores the reply

The feature degrades gracefully — when KB_REPLY_ENABLED=false (the default), admin replies work normally with no emails sent.

8. Set up Cloudflare Turnstile (optional but recommended)

The ticket submission form supports Cloudflare Turnstile for spam protection. Add your Turnstile keys to config/services.php:

And in your .env:

When configured, the Turnstile widget is automatically rendered on the ticket form and verified server-side on submission. When not configured, the form works without it.

User Traits

The package provides three traits for integrating the ticket system with your User model:

CanKbTicket (Customer)

Method Description
kbTickets() HasMany relationship to the user's tickets
createKbTicket(array $data) Create a ticket, auto-fills name/email from user
replyToKbTicket(KbTicket $ticket, string $body) Reply to own ticket (guards ownership)
ownsKbTicket(KbTicket $ticket) Check if user owns the ticket

ManageKbTicket (Staff/Agent)

Method Description
replyToKbTicketAsStaff(KbTicket $ticket, string $body) Reply as staff, auto-transitions open → in_progress, fires KbTicketReplied event

AdminKbTicket (Admin)

Method Description
replyToKbTicketAsAdmin(KbTicket $ticket, string $body) Reply as admin, auto-transitions open → in_progress
changeKbTicketStatus(KbTicket $ticket, string $status) Validate and update ticket status
resolveKbTicket(KbTicket $ticket) Convenience wrapper to set status to resolved
isKbAdmin() Check if user's email is in config('kb.users.admins')

Ticket Submission (Guests & Authenticated Users)

The ticket form supports both guest and authenticated submissions:

Web Routes

All web routes are prefixed with /help-center and use the web middleware group.

Method URI Name Description
GET /help-center kb.landing Landing page with categories + featured articles
GET /help-center/categories kb.categories All categories with top articles
GET /help-center/category/{slug} kb.category Single category with paginated articles
GET /help-center/{category}/{article} kb.article Single article (tracks views)
GET /help-center/search kb.search Search results page
GET /help-center/ticket kb.ticket.create Support ticket form
POST /help-center/ticket kb.ticket.store Submit support ticket
POST /help-center/article/{id}/feedback kb.article.feedback Article helpfulness vote
POST /webhook/kb/inbound kb.webhook.inbound Brevo inbound email webhook

API Endpoints

All API routes are prefixed with /api/kb, rate-limited, and require authentication.

Method URI Name Description
GET /api/kb kb.api.home Categories with counts + featured articles
GET /api/kb/categories/{slug} kb.api.category Category detail + paginated articles
GET /api/kb/categories/{slug}/{article} kb.api.article Full article with HTML body + TOC
GET /api/kb/search?q=&category= kb.api.search Full-text search with optional category filter

API Authentication

The API accepts either of these authentication methods:

Option 1 — Static API Key (simplest)

Set a key in .env:

Then pass it via header:

Option 2 — Sanctum Bearer Token

Use a standard Sanctum personal access token:

Example API Responses

GET /api/kb

GET /api/kb/categories/{slug}/{article}

Configuration

After publishing (php artisan vendor:publish --tag=kb-config), edit config/kb.php to customise your knowledge base.

Environment Variables

Variable Default Description
KB_BRAND_NAME Weeklify Brand name in header, footer, page titles
KB_BRAND_TAGLINE Helping you make the most... Footer tagline
KB_BRAND_COPYRIGHT Weeklify Inc. Copyright holder
KB_LOGO_URL null Custom logo URL (null = bundled logo)
KB_LOGO_ALT Knowledge Base Logo alt text
KB_COLOR_PRIMARY #0EA5E9 Primary brand colour
KB_COLOR_BG_LIGHT #f6f6f8 Light mode background
KB_COLOR_BG_DARK #101622 Dark mode background
KB_FONT_FAMILY Inter Google Font family name
KB_FONT_URL Google Fonts URL Font stylesheet URL
KB_SUPPORT_EMAIL [email protected] Support contact email
KB_SUPPORT_WEBSITE weeklify.cloud Support website
KB_API_KEY null Static API key (null = disabled)
KB_API_RATE_LIMIT 60 API requests per minute
KB_USER_MODEL App\Models\User Fully-qualified User model class
KB_REPLY_ENABLED false Enable outbound ticket reply emails
KB_REPLY_DOMAIN (empty) Domain for reply-to addresses (e.g. parse.yourdomain.com)
KB_REPLY_FROM_ADDRESS [email protected] From address for ticket reply emails
KB_REPLY_FROM_NAME Weeklify Support From name for ticket reply emails
KB_REPLY_TOKEN_SECRET null HMAC secret for reply tokens (falls back to APP_KEY)
KB_REPLY_WEBHOOK_SECRET null Secret for Brevo inbound webhook verification (required — webhook returns 403 if unset)
KB_REPLY_TOKEN_TTL 2592000 Reply token expiry in seconds (default 30 days)
KB_BRAND_ADDRESS (empty) Physical address shown in email footer (hidden when empty)
TURNSTILE_SITE_KEY null Cloudflare Turnstile site key
TURNSTILE_SECRET_KEY null Cloudflare Turnstile secret key

Config Sections

The config/kb.php file is organised into these sections:

Package Structure

Models

The package provides five Eloquent models in the EzKnowledgeBase\Models namespace:

Caching

The package caches expensive queries with automatic invalidation:

Cache Key TTL Invalidated On
kb_categories_with_counts 1 hour Category or article save/delete
kb_all_categories_with_top_articles 1 hour Category or article save/delete
kb_featured_articles 1 hour Category or article save/delete
kb_article_{slug} 30 min That article's save/delete

Cache invalidation is handled via Eloquent model event listeners registered in the service provider.

Customising Views

To override any Blade view, publish them to your app:

Views will be copied to resources/views/vendor/kb/ where you can edit them freely. The package will use your custom views over its built-in ones.

Adding Articles

Articles are stored in database/seeders/data/kb/ as PHP arrays with markdown bodies using nowdoc syntax:

After adding articles to the seeder data files, run:

Articles can also be managed through the Filament admin panel.


All versions of ez-knowledge-base with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package weeklify/ez-knowledge-base contains the following files

Loading the files please wait ...