Featured image of post [monday-shop] Issues and Solutions Encountered During Dependency Updates

[monday-shop] Issues and Solutions Encountered During Dependency Updates

This weekend, I took the time to update the monday-shop e-commerce system. Here's a summary of the various issues encountered during the process.

  • This weekend, I updated the monday-shop system.
    The most significant challenges came from upgrading laravel-admin to the latest version. This backend framework is particularly valuable as it allows developers to focus on core backend logic.

  • First Issue: Composer Dependency Errors
    Initial composer install failed due to locked mirror sources. Solved by switching to Alibaba Cloud Composer Mirror.

  • Laravel-admin Upgrade Challenges


    Key functionality affected:

    • Soft Delete (下架)
    • Restore (上架)
  • Version-Specific Problems:

    1. Soft-deleted items couldn’t be processed by actions (throwing “model not found” errors)
    2. Force delete functionality failed (delete action only performed soft delete)

Problem Solving Process

  • Controller Analysis
    The controller’s destroy method contained force delete logic, but requests weren’t reaching it:

  • Routing Investigation
    All actions routed through HandleController::handleAction:

  • Model Retrieval Issue
    The critical line: $model = $action->retrieveModel($request);
    Default implementation used Model::findOrFail(), incompatible with soft-deleted items:

  • Solution: Override retrieveModel in custom Action class to include soft-deleted records:


Force Delete Implementation

  • Default Action Analysis
    DropdownActions contained basic delete action:

  • Custom Force Delete Action
    Removed default delete, added force delete implementation:


    Core logic using Laravel’s force delete:


Final Outcome: Both soft delete management and force delete functionality now work as intended.