Download the PHP package smurfworks/model-finder without Composer
On this page you can find all versions of the php package smurfworks/model-finder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smurfworks/model-finder
More information about smurfworks/model-finder
Files in smurfworks/model-finder
Package model-finder
Short Description Laravel package for finding models and building a utility index in existing Laravel projects.
License MIT
Informations about the package model-finder
SmurfWorks / Model Finder
Laravel package for finding models and building a utility index in existing Laravel projects.
- Author: Glyn Simpson / @SmurfWorks
- Change Log
- License
Key features
- Configure discovery of one or more namespaces to scan for Model classes
- Ignore discovery of specific models
- Discover available scopes and relations
- Discover information about attributes
- Apply custom meta to individual scopes, relations and models via PHP8 attributes
About
This utility repository was created as a provided service for common functionality that I needed between multiple projects, both open source and proprietary - so it made sense to open source and release it so it can be used as a dependency in both contexts.
An example of model finder being used as a dependency an open source package: https://www.github.com/SmurfWorks/Sieve
Install
Laravel should automatically discover the service provider and add an alias. The provider will only scan models once per request as it's a singleton service that will cache the result.
Usage
Testing
The testing namespace contains schema migrations to setup some simple tables, and respective sample models. Because a part of the model finding queries the schema for table data, the unit tests will run these migrations to test model discovery.
Contributions
Contributions and issue reporting are welcome but this project is mostly the foundation for other projects I work on, so be warned there may be a significant amount of arbitrary decision making when proceeding.