Skip to content

[6.x] Assets & Folders#18472

Open
riasvdv wants to merge 10 commits into6.xfrom
feature/port-assets-service
Open

[6.x] Assets & Folders#18472
riasvdv wants to merge 10 commits into6.xfrom
feature/port-assets-service

Conversation

@riasvdv
Copy link
Contributor

@riasvdv riasvdv commented Feb 24, 2026

No description provided.

# 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
@riasvdv riasvdv changed the title [6.x] Assets [6.x] Assets & Folders Feb 25, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Assets and Folders services with Laravel dependency injection and events
  • Deprecates craft\services\Assets with 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.

@riasvdv riasvdv marked this pull request as ready for review February 25, 2026 12:23
@riasvdv riasvdv requested a review from brandonkelly February 25, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants