laravelplus / version-platform-manager
A Laravel package for managing platform versions and showing what's new to users
Installs: 50
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:Blade
Requires
- php: ^8.4
- laravel/framework: ^12.0
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^8.0|^9.0|^10.0
- pestphp/pest: ^2.0
- phpunit/phpunit: ^10.0
This package is not auto-updated.
Last update: 2025-07-29 07:10:42 UTC
README
A Laravel package for managing platform versions and showing "what's new" content to users based on their current version.
Features
- 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
Installation
- 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 migrate
Usage
Basic Usage
The package automatically handles version checking and modal display. Simply include the component in your views:
<x-what-is-new></x-what-is-new>
Managing Platform Versions
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(), ]);
Managing What's New Content
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, ]);
Checking User Versions
Check if a user needs to see updates:
use LaravelPlus\VersionPlatformManager\Services\VersionService; $versionService = app(VersionService::class); $needsUpdate = $versionService->userNeedsUpdate($user);
Configuration
The package configuration file config/version-platform-manager.php
contains:
- Default user version
- Modal display settings
- Version comparison logic
- Admin panel settings
Admin Sidebar (Dynamic Navbar)
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._blank
to 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
route
andurl
are present,route
is used. - The sidebar will highlight the active link for both route and URL types.
- You can use any SVG icon markup for the
icon
field.
Database Structure
Platform Versions Table
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
What's New Table
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
User Versions Table
Tracks user version information:
user_id
: User referenceversion
: User's current versionlast_seen_version
: Last version the user has seenupdated_at
: Last update timestamp
Components
What's New Modal
The package provides a Blade component that automatically shows the modal when needed:
<x-what-is-new></x-what-is-new>
Admin Components
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>
API
VersionService
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);
Events
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
Contributing
Please see CONTRIBUTING.md for details.
License
The MIT License (MIT). Please see License File for more information.