Open
Conversation
# Conflicts: # CHANGELOG-WIP.md # src/Asset/Commands/Concerns/IndexesAssets.php # src/Http/Controllers/Utilities/AssetIndexesController.php # yii2-adapter/legacy/services/Assets.php
# Conflicts: # src/Asset/Elements/Asset.php # src/User/Elements/User.php
There was a problem hiding this comment.
Pull request overview
This PR refactors the Assets service layer by splitting the monolithic legacy craft\services\Assets class into two focused services: CraftCms\Cms\Asset\Assets and CraftCms\Cms\Asset\Folders. This is part of the larger Craft 6.x modernization effort to migrate from Yii2 to Laravel patterns.
Changes:
- Introduces new
AssetsandFoldersservices with Laravel dependency injection and events - Deprecates
craft\services\Assetswith a backward-compatible delegation layer - Adds comprehensive test coverage (466 lines for Folders, 205 for Assets)
- Implements new Laravel-based asset controllers with proper authentication/authorization
- Creates event bridges to maintain compatibility with existing Yii2 event handlers
Reviewed changes
Copilot reviewed 71 out of 71 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/Asset/Assets.php |
New singleton service for asset operations (file replacement, thumbnails, preview handlers) |
src/Asset/Folders.php |
New singleton service for folder CRUD operations with caching |
src/Support/Facades/Assets.php |
Facade for Assets service |
src/Support/Facades/Folders.php |
Facade for Folders service |
yii2-adapter/legacy/services/Assets.php |
Deprecated legacy service that delegates to new services with event bridge for backward compatibility |
src/Http/Controllers/Assets/* |
New Laravel controllers for upload, transform, preview, folder operations, and image editing |
routes/cp.php |
Adds assets index route |
routes/actions.php |
Adds 15+ asset-related action routes |
tests/Feature/Asset/* |
Comprehensive test coverage for new services |
tests/Feature/Http/Controllers/Assets/* |
Controller tests covering authentication, validation, and functionality |
src/Asset/Events/* |
New Laravel event classes replacing deprecated Yii2 events |
CHANGELOG-WIP.md |
Documents deprecations and new APIs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.