Skip to content

[Bug]: ModelTree trait autoloading fails on PHP 8.4 + Laravel 11 + FilamentPHP v4 #90

@spokospace

Description

@spokospace

What happened?

Environment:

  • solution-forest/filament-tree: 3.1.2 (latest)
  • PHP: 8.4.12
  • Laravel: 11.46.0
  • FilamentPHP: v4.0

Issue:
The SolutionForest\FilamentTree\Concern\ModelTree trait cannot be autoloaded despite being present in
vendor/solution-forest/filament-tree/src/Concern/ModelTree.php. The error occurs when adding use ModelTree; to any model class:

PHP Fatal error: Trait "SolutionForest\FilamentTree\Concern\ModelTree" not found

How to reproduce the bug

Steps to reproduce:

  1. Install latest filament-tree package via composer
  2. Add use SolutionForest\FilamentTree\Concern\ModelTree; to model
  3. Add use ModelTree; inside class
  4. Run any artisan command

Expected: Trait should be autoloaded successfully
Actual: Fatal error occurs

Additional notes: Commands like make:filament-tree-page are also not being registered, suggesting a broader service provider autoloading issue
specific to this PHP/Laravel/Filament combination.

Package Version

3.1.2

PHP Version

8.4.12

Laravel Version

11.46.0

Which operating systems does with happen with?

Windows

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions