PHPackages                             darkghosthunter/larafind - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. darkghosthunter/larafind

AbandonedArchivedLibrary[PSR &amp; Standards](/categories/psr-standards)

darkghosthunter/larafind
========================

Small utility to find PSR-4 classes from the project path.

v1.0.0(4y ago)03MITPHPPHP ^8.0

Since Jul 31Pushed 4y agoCompare

[ Source](https://github.com/DarkGhostHunter/Larafind)[ Packagist](https://packagist.org/packages/darkghosthunter/larafind)[ Docs](https://github.com/darkghosthunter/larafind)[ Fund](https://paypal.me/darkghosthunter)[ Fund](https://ko-fi.com/DarkGhostHunter)[ RSS](/packages/darkghosthunter-larafind/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

Superseded by [Laragear\\Meta](https://github.com/Laragear/Meta).
-----------------------------------------------------------------

[](#superseded-by-laragearmeta)

---

[![Agence Olloweb - Unslash (UL) #d9ILr-dbEdg](https://camo.githubusercontent.com/d81a24e15a49560481983532a207ee4acbc3091c9c80d842ba860e22cd6697c2/68747470733a2f2f696d616765732e756e73706c6173682e636f6d2f70686f746f2d313531363338323739393234372d3837646639356437393062373f69786c69623d72622d312e322e31266175746f3d666f726d6174266669743d63726f7026773d3133353026713d383026713d383026773d3132383026683d343030)](https://camo.githubusercontent.com/d81a24e15a49560481983532a207ee4acbc3091c9c80d842ba860e22cd6697c2/68747470733a2f2f696d616765732e756e73706c6173682e636f6d2f70686f746f2d313531363338323739393234372d3837646639356437393062373f69786c69623d72622d312e322e31266175746f3d666f726d6174266669743d63726f7026773d3133353026713d383026713d383026773d3132383026683d343030)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2b50c1b939ee83bd8f7153fe3913ea4fbc71493e9a96f58529a69c2a7eaaa239/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6461726b67686f737468756e7465722f6c61726166696e642e737667)](https://packagist.org/packages/darkghosthunter/larafind) [![License](https://camo.githubusercontent.com/6bd3c8bfb0d7626033b9191ae18ac1e5c100765a3fd36fd630023786a3802f6b/68747470733a2f2f706f7365722e707567782e6f72672f6461726b67686f737468756e7465722f6c61726166696e642f6c6963656e7365)](https://packagist.org/packages/darkghosthunter/larafind) [![](https://camo.githubusercontent.com/6d5feecb08e17f25c3d1a877e7eed1511e2c813c347e1d3bb22a30fac0a06863/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6461726b67686f737468756e7465722f6c61726166696e642e737667)](https://camo.githubusercontent.com/6d5feecb08e17f25c3d1a877e7eed1511e2c813c347e1d3bb22a30fac0a06863/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6461726b67686f737468756e7465722f6c61726166696e642e737667) [![](https://github.com/DarkGhostHunter/Larafind/workflows/Tests/badge.svg)](https://github.com/DarkGhostHunter/Larafind/workflows/Tests/badge.svg) [![Coverage Status](https://camo.githubusercontent.com/65d7f12bfd0cf59b5753207797e65b362b7365b60e5cd0631ac5676a81b12f68/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4461726b47686f737448756e7465722f4c61726166696e642f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/DarkGhostHunter/Larafind?branch=master)

Larafind
========

[](#larafind)

Small utility to find PSR-4 classes from the base application path or project root.

```
use DarkGhostHunter\Larafind\Facades\Find;
use Illuminate\Database\Eloquent\Scope;

$classes = Find::path('Scopes')->implementing(Scope::class)->get();
```

You can use this as a way to "auto-discover" classes a developer (or you) may have under a given directory.

Requirements
------------

[](#requirements)

- PHP 8.0
- Laravel 8.x

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require darkghosthunter/larafind
```

Usage
-----

[](#usage)

Use the `Find` facade to easy your development pain. The facade creates a "builder" of sorts that will return a list of all discovered PSR-4 compliant classes as a `ReflectionClass`.

By default, the Finder will use the default `app` directory, but you can use the `path()` method to look for a specific folder in your application path.

```
use DarkGhostHunter\Larafind\Facades\Find;

$classes = Find::path('Scopes')->get();
```

To look for other paths inside your project root, use the `basePath()` method. Note that Finder ensures the path you're using is autoloaded.

```
use DarkGhostHunter\Larafind\Facades\Find;

$classes = Find::basePath('app_foo/Scopes')->get();
```

### Recursive

[](#recursive)

The discovery is recursive, meaning, it will expand into child directories. You can make it non-recursive using `nonRecursive()`:

```
use DarkGhostHunter\Larafind\Facades\Find;

$classes = Find::path('Scopes')->nonRecursive()->get();
```

### Filtering

[](#filtering)

The `Find` returns a Collection of items, so you can use the [`filter()`](https://laravel.com/docs/collections#method-filter) method to get only those classes that pass a truth test.

```
use DarkGhostHunter\Larafind\Facades\Find;

$classes = Find::path('Scopes')->nonRecursive()->get()
    ->filter(fn($class) => str_starts_with($class->name, 'Foo'));
```

To make things simpler, you can use some pre-filtering methods to avoid calling a filter manually after you get the collection:

MethodDescription`implementing()`Filter by implementing interfaces.`extends()`Filter by extending class.`uses()`Filter by used all traits.`methods()`Filter by public methods.`properties()`Filter by public properties.```
use DarkGhostHunter\Larafind\Facades\Find;
use Illuminate\Database\Eloquent\Model;

$arrayAccessible = Find::implementing(ArrayAccess::class)->get();

$eloquentModels = Find::extending(Model::class)->get();

$usesTraits = Find::using('App\MyCustomTrait')->get();

$hasMethod = Find::methods('handle', 'terminate')->get();

$hasProperties = Find::properties('service', 'model')->get();
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1751d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5141911?v=4)[Italo](/maintainers/DarkGhostHunter)[@DarkGhostHunter](https://github.com/DarkGhostHunter)

---

Top Contributors

[![DarkGhostHunter](https://avatars.githubusercontent.com/u/5141911?v=4)](https://github.com/DarkGhostHunter "DarkGhostHunter (7 commits)")

---

Tags

psrlaravelfilesPSR-4darkghosthunter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/darkghosthunter-larafind/health.svg)

```
[![Health](https://phpackages.com/badges/darkghosthunter-larafind/health.svg)](https://phpackages.com/packages/darkghosthunter-larafind)
```

###  Alternatives

[laravel/pennant

A simple, lightweight library for managing feature flags.

57311.1M53](/packages/laravel-pennant)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[evilfreelancer/routeros-api-php

Modern Mikrotik RouterOS API PHP client for your applications (with Laravel support)

491206.1k4](/packages/evilfreelancer-routeros-api-php)[genert/bbcode

BBCode parser from or to HTML.

81324.0k1](/packages/genert-bbcode)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
