Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c94d6a1
Add guest help article index and show pages with pagination improvements
Nov 19, 2025
08a4b85
Fix tests: add is_hidden migration and remove Filament directives fro…
Nov 19, 2025
52a73d4
Use TappNetwork organization test workflow instead of local implement…
Nov 19, 2025
817ac5e
Simplify config: remove unused options and rename theme CSS
Nov 19, 2025
276c8a2
Simplify config to essentials: route_prefix, css, theme
Nov 20, 2025
a8e629b
Remove unnecessary AllowPublicHelpAccess middleware
Nov 20, 2025
fd4032a
Improve naming clarity in PublicHelpArticleController
Nov 20, 2025
0a50733
Combine public view files - remove unnecessary content separation
Nov 20, 2025
0cec40a
Remove dark mode support and switch to Laravel default pagination
Nov 20, 2025
626ef87
Reduce pagination to 4 items per page for testing
Nov 20, 2025
163de5e
Restore custom pagination and dark mode support
Nov 20, 2025
92b51fd
Update pagination and controller changes
Nov 20, 2025
4fb1c33
Match help layout background to welcome page
Nov 20, 2025
90c0b89
Restore simpler, cleaner help layout design
Nov 20, 2025
87de591
Remove theme config option - not needed for guest pages
Nov 20, 2025
743044d
Move help-specific CSS from project to package
Nov 20, 2025
46fb4b6
Publish CSS as public asset instead of inline
Nov 20, 2025
ea1db54
Change 'Back to Login' to 'Back to Homepage'
Nov 20, 2025
b8bfb46
Fix failing public route tests
Nov 20, 2025
e761271
Refactor: Remove unused code from old controller/view implementation
Dec 3, 2025
8c3652d
docs: Update README with current config structure and features
Dec 3, 2025
ad8737c
refactor: Remove config file slug options and make defaults explicit
Dec 3, 2025
181d0ae
docs: Remove config file section from README
Dec 3, 2025
9c2d02a
refactor: Enforce non-empty slugs and change guest plugin default
Dec 3, 2025
fb156b6
Update guest panel resource to support nullable slug and fix logout r…
Dec 4, 2025
3940133
Add workflow_dispatch to all workflows for manual triggering
Dec 4, 2025
0f4beac
Fix test workflow: remove non-existent reusable workflow and run test…
Dec 4, 2025
a007ccb
Clear Pest cache before running tests to fix stale test directory ref…
Dec 4, 2025
cd86cbc
Fix duplicate workflows and ensure test directories exist before runn…
Dec 4, 2025
fcae1a9
Fix duplicate workflow runs by using branch name in concurrency group
Dec 4, 2025
d6a3114
Only run workflows on pull_request and main branch push to avoid dupl…
Dec 4, 2025
edff996
Prevent breadcrumb generation that references non-existent index route
Dec 4, 2025
db73d0e
Override getResourceBreadcrumbs to prevent index route reference
Dec 4, 2025
292407c
Fix getResourceBreadcrumbs visibility to public
Dec 4, 2025
13308d8
Remove static page slugs to use resource slug for route generation
Dec 4, 2025
bfd34ed
Set page slugs to null to use resource slug
Dec 4, 2025
4c002ca
Set navigation sort to 999 to make Help appear last in guest panel
Dec 4, 2025
09fe23a
Remove extra newlines from view-help-article.blade.php
Dec 4, 2025
6a74a5e
Delete vendor/composer/autoload_static.php
scottgrayson Dec 4, 2025
b24887d
remove vendor from version tracking
swilla Dec 5, 2025
ec615fe
do not track lock file
swilla Dec 5, 2025
ff303e8
do not track lock
swilla Dec 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
11 changes: 7 additions & 4 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
name: PHPStan

on:
push:
pull_request:
paths:
- '**.php'
- 'phpstan.neon.dist'
- '.github/workflows/phpstan.yml'
pull_request:
push:
branches:
- main
paths:
- '**.php'
- 'phpstan.neon.dist'
- '.github/workflows/phpstan.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: false

jobs:
phpstan:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- 'pint.json'
branches-ignore:
- 'dependabot/npm_and_yarn/*'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
26 changes: 15 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
name: Test

on:
push:
pull_request:
paths:
- '**.php'
- '.github/workflows/test.yml'
- 'phpunit.xml.dist'
- 'composer.json'
- 'composer.lock'
pull_request:
push:
branches:
- main
paths:
- '**.php'
- '.github/workflows/test.yml'
- 'phpunit.xml.dist'
- 'composer.json'
- 'composer.lock'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: false

jobs:
test:
Expand All @@ -33,27 +36,28 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: bcmath, ctype, fileinfo, json, mbstring, openssl, pdo, tokenizer, xml
coverage: none

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Setup composer cache
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install composer dependencies
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

run: |
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Clear Pest cache
run: rm -rf vendor/pestphp/pest/.temp/test-results || true
- name: Ensure test directories exist
run: |
mkdir -p tests/Feature tests/Unit
- name: Run tests
run: composer test
run: composer test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.pest/

# Composer
/vendor/
/vendor

# IDE
.vscode/
Expand All @@ -25,3 +25,6 @@ storage/framework/views/

# Testing
.phpunit.result.cache

composer.lock
package-lock.json
98 changes: 62 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![GitHub Code Style Action Status](https://github.com/TappNetwork/filament-help/actions/workflows/fix-php-code-style-issues.yml/badge.svg)
[![Total Downloads](https://img.shields.io/packagist/dt/tapp/filament-help.svg?style=flat-square)](https://packagist.org/packages/tapp/filament-help)

This plugin adds help article management to Filament with both admin and frontend capabilities.
This plugin adds help article management to Filament with admin, frontend, and guest panel capabilities.

## Version Compatibility

Expand All @@ -28,38 +28,11 @@ php artisan vendor:publish --tag="filament-help-migrations"
php artisan migrate
```

You can publish the config file with:

```bash
php artisan vendor:publish --tag="filament-help-config"
```

This is the contents of the published config file:

```php
return [
'navigation' => [
'admin' => [
'register' => true,
'sort' => 1,
'icon' => 'heroicon-o-question-mark-circle',
'group' => 'Help',
],
'frontend' => [
'register' => true,
'sort' => 1,
'icon' => 'heroicon-o-question-mark-circle',
'label' => 'Help',
],
],
];
```

## Using the Plugins

### Admin Plugin
### Admin Plugin (for editing help articles)

Add this plugin to a panel on `plugins()` method.
Add this plugin to your admin panel for full CRUD operations.
E.g. in `app/Providers/Filament/AdminPanelProvider.php`:

```php
Expand All @@ -76,9 +49,13 @@ public function panel(Panel $panel): Panel
}
```

### Frontend Plugin
**Location**: Admin panel (typically `/admin/help-articles`)
**Access**: Authenticated admin users only
**Features**: Create, edit, delete, and manage all help articles

Add this plugin to a panel for frontend access:
### Frontend Plugin (for authenticated users)

Add this plugin to your authenticated user panel for read-only access:

```php
use Tapp\FilamentHelp\FilamentHelpFrontendPlugin;
Expand All @@ -89,18 +66,67 @@ public function panel(Panel $panel): Panel
// ...
->plugins([
FilamentHelpFrontendPlugin::make(),
//...
// Default slug is 'help-articles', so articles will be at {panel-path}/help-articles
// Customize with ->slug('custom-slug') if needed
]);
}
```

**Configuration Options:**
- **Plugin method**: `->slug('custom-slug')` - Set the URL slug when registering the plugin (defaults to `'help-articles'` if not specified)

**Location**: App panel (defaults to `{panel-path}/help-articles`, configurable via `->slug()`)
**Access**: Authenticated users only
**Features**: Read-only access to public help articles

### Guest Plugin (for public access)

Add this plugin to a guest panel (without authentication) for public access:

```php
use Tapp\FilamentHelp\FilamentHelpGuestPlugin;

public function panel(Panel $panel): Panel
{
return $panel
->id('guest')
->path('') // Panel path (empty = root, or set to your desired base path)
// ... other panel configuration
// Note: Do NOT add authMiddleware() for guest access
->plugins([
FilamentHelpGuestPlugin::make(),
// Default slug is 'help', so articles will be at /help (or {panel-path}/help)
// Customize with ->slug('custom-slug') if needed
]);
}
```

**Configuration Options:**
- **Plugin method**: `->slug('custom-slug')` - Set the URL slug when registering the plugin (defaults to `'help'` if not specified)
- **Slug requirement**: Slug must be a non-empty string

**Location**: Guest panel (defaults to `{panel-path}/help`, configurable via `->slug()`)
**Access**: Public (no authentication required)
**Features**: Read-only access to public help articles for guests

## Help Article Locations

Help articles are available in three different locations depending on your setup:

1. **Admin Panel** (`/admin/help-articles`): For editing and managing help articles
2. **App Panel** (configurable, default `{panel-path}/help-articles`): For authenticated users to view public help articles
3. **Guest Panel** (configurable, default `{panel-path}/help`): For public/guest users to view public help articles

The frontend and guest panel URLs can be customized using the plugin's `->slug()` method when registering the plugin (see plugin documentation above).

## Features

- **Admin Panel**: Full CRUD operations for help articles
- **Frontend**: Read-only access to public help articles
- **Frontend/Guest**: Read-only access to public help articles
- **Rich Content**: HTML content support with iframe embedding
- **Public/Private**: Control article visibility
- **Search & Filter**: Find articles by name and filter by public status
- **Public/Private**: Control article visibility with `is_public` flag
- **Hidden/Draft**: Hide articles from public view with `is_hidden` flag (useful for drafts or archived articles)
- **Search & Filter**: Find articles by name and filter by public/hidden status

## Testing

Expand Down
Loading