refactor: Modernize service provider using Laravel Package Tools features#52
Merged
refactor: Modernize service provider using Laravel Package Tools features#52
Conversation
…d and improved route handling - Added interactive setup command for easier installation and configuration. - Updated route handling to support both web and API routes. - Consolidated asset and migration publishing into the setup process.
…ublishing options - Revamped installation section with a quick installation command and interactive installer details. - Added comprehensive setup command for file publishing and migrations. - Introduced granular publishing options for individual components. - Included a new "Getting Started" section to guide users post-installation.
- Deleted the RequestAnalyticsCommand and SetupCommand classes as they are no longer needed. - Updated the RequestAnalyticsServiceProvider to remove references to the deleted commands.
…licity - Updated installation section to emphasize a two-command setup process. - Removed the alternative setup command to streamline user experience. - Clarified post-installation steps for accessing the analytics dashboard.
- Deleted the SetupCommandTest file, which is no longer needed following the removal of the SetupCommand class. - This change streamlines the test suite by eliminating tests for commands that have been deprecated.
- Enhanced the RequestAnalyticsServiceProvider to include migration publishing as part of the setup process. - This addition allows users to easily manage database migrations alongside other configuration tasks.
…dependency conflicts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactors the
RequestAnalyticsServiceProviderto fully leverage Laravel Package Tools capabilities, providing a cleaner and more maintainable package structure.Changes Made
Service Provider Refactoring
publishes()calls - Now handled automatically by Laravel Package ToolshasRoutes(['web', 'api'])instead of multiplehasRoute()callshasCommands()array instead of manual registrationInstall Command Enhancement
php artisan request-analytics:installArchitecture Improvements
packageRegistered()andpackageBooted()for proper timingBenefits
Better Developer Experience - One-command installation
Cleaner Codebase - Reduced manual publishing configuration
Standardized Approach - Follows Laravel Package Tools conventions
Enhanced Maintainability - Less boilerplate code
Improved User Onboarding - Interactive installation process
Testing
The refactored service provider maintains full backward compatibility while providing these enhancements:
request-analytics-config,request-analytics-assets, etc.)Installation Experience
Users now get this improved installation flow: