A Laravel package for managing platform versions and showing "what's new" content to users based on their current version.
- Version Management: Track platform versions and user versions
- What's New Content: Store and manage feature announcements
- Smart Notifications: Show modals to users based on their version
- Version Comparison: Compare user versions with platform versions
- Admin Interface: Manage versions and content through admin panel
- Install the package via Composer:
composer require laravelplus/version-platform-manager- Publish the configuration and migrations:
php artisan vendor:publish --provider="LaravelPlus\VersionPlatformManager\Providers\VersionPlatformManagerServiceProvider"- Run the migrations:
php artisan migrateThe package automatically handles version checking and modal display. Simply include the component in your views:
<x-what-is-new></x-what-is-new>Add a new platform version:
use LaravelPlus\VersionPlatformManager\Models\PlatformVersion;
PlatformVersion::create([
'version' => '1.0.0',
'title' => 'Major Update',
'description' => 'New features and improvements',
'is_active' => true,
'released_at' => now(),
]);Add content for a specific version:
use LaravelPlus\VersionPlatformManager\Models\WhatsNew;
WhatsNew::create([
'platform_version_id' => $version->id,
'title' => 'New Feature',
'content' => 'Description of the new feature',
'type' => 'feature', // feature, improvement, bugfix, security
'is_active' => true,
]);Check if a user needs to see updates:
use LaravelPlus\VersionPlatformManager\Services\VersionService;
$versionService = app(VersionService::class);
$needsUpdate = $versionService->userNeedsUpdate($user);The package configuration file config/version-platform-manager.php contains:
- Default user version
- Modal display settings
- Version comparison logic
- Admin panel settings
The admin sidebar is fully configurable via the navbar_links array in config/version-platform-manager.php.
You can add, remove, or reorder links. Each link supports:
label: The text to displayroute: (optional) The Laravel route name to useurl: (optional) A direct URL (internal or external)icon: (optional) SVG icon markuptarget: (optional) e.g._blankto open in a new tab
Example:
'navbar_links' => [
[
'label' => 'Dashboard',
'route' => 'version-manager.dashboard',
'icon' => '<svg ...></svg>',
],
[
'label' => 'Logs',
'url' => '/admin/logs',
'icon' => '<svg ...></svg>',
'target' => '_blank', // open in new tab
],
// Add more links as needed
],- If both
routeandurlare present,routeis used. - The sidebar will highlight the active link for both route and URL types.
- You can use any SVG icon markup for the
iconfield.
Stores platform version information:
version: Version string (e.g., "1.0.0")title: Version titledescription: Version descriptionis_active: Whether the version is activereleased_at: Release date
Stores feature announcements:
platform_version_id: Reference to platform versiontitle: Feature titlecontent: Feature descriptiontype: Feature type (feature, improvement, bugfix, security)is_active: Whether the feature is active
Tracks user version information:
user_id: User referenceversion: User's current versionlast_seen_version: Last version the user has seenupdated_at: Last update timestamp
The package provides a Blade component that automatically shows the modal when needed:
<x-what-is-new></x-what-is-new>Admin components for managing versions and content:
<x-version-platform-manager::admin.versions></x-version-platform-manager::admin.versions>
<x-version-platform-manager::admin.whats-new></x-version-platform-manager::admin.whats-new>Main service for version management:
$versionService = app(VersionService::class);
// Check if user needs update
$needsUpdate = $versionService->userNeedsUpdate($user);
// Get user's current version
$version = $versionService->getUserVersion($user);
// Update user version
$versionService->updateUserVersion($user, '1.0.0');
// Get what's new for user
$whatsNew = $versionService->getWhatsNewForUser($user);The package fires several events:
UserVersionUpdated: When a user's version is updatedPlatformVersionCreated: When a new platform version is createdWhatsNewCreated: When new content is added
Please see CONTRIBUTING.md for details.
The MIT License (MIT). Please see License File for more information.