PHPackages                             laragear/meta - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. laragear/meta

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

laragear/meta
=============

A Laravel Package helper for Laravel Packages

v5.2.0(2mo ago)7809.3k—6.5%5MITPHPCI passing

Since Mar 22Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Laragear/Meta)[ Packagist](https://packagist.org/packages/laragear/meta)[ Fund](https://github.com/sponsors/DarkGhostHunter)[ Fund](https://paypal.me/darkghosthunter)[ RSS](/packages/laragear-meta/feed)WikiDiscussions 5.x Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (33)Used By (5)

Meta
====

[](#meta)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3d44ddc9106dd29d8430c932246da0fe9e2bf73bff02a54a10981ea66c55feac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c617261676561722f6d6574612e737667)](https://packagist.org/packages/laragear/meta)[![Latest stable test run](https://github.com/Laragear/Meta/workflows/Tests/badge.svg)](https://github.com/Laragear/Meta/actions)[![Codecov Coverage](https://camo.githubusercontent.com/9fde1188b08e19598e7d38e03f043ecbc2881b1a6f3337a23e9e9ea5c6b09a97/68747470733a2f2f636f6465636f762e696f2f67682f4c617261676561722f4d6574612f67726170682f62616467652e7376673f746f6b656e3d626f6758617037526a6e)](https://codecov.io/gh/Laragear/Meta)[![Maintainability](https://camo.githubusercontent.com/b92c4a2e17a37eca2af3eb2c215457908e9be8f27e7a2c5aa00decb5017d0350/68747470733a2f2f716c74792e73682f6261646765732f36393533383534372d326532372d343964312d396333332d6664633363376633356633332f6d61696e7461696e6162696c6974792e737667)](https://qlty.sh/gh/Laragear/projects/Meta)[![Sonarcloud Status](https://camo.githubusercontent.com/b8fa9cde0ade2c823dfdf2a9674a063beb62ef27ec787cd89c9119a695135fec/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d4c617261676561725f4d657461266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard?id=Laragear_Meta)[![Laravel Octane Compatibility](https://camo.githubusercontent.com/70359a356da237cd29561bc5d0bb80baae775b5ff62f288ed324755382858342/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2532304f6374616e652d436f6d70617469626c652d737563636573733f7374796c653d666c6174266c6f676f3d6c61726176656c)](https://laravel.com/docs/13.x/octane#introduction)

A Laravel Package helper for Laravel Packages.

```
public function boot()
{
    $this->withPublishableMigrations(__DIR__.'/../migrations');

    $this->withSchedule(fn($schedule) => $schedule->command('inspire')->hourly());
}
```

Become a sponsor
----------------

[](#become-a-sponsor)

[![](.github/assets/support.png)](https://github.com/sponsors/DarkGhostHunter)

Your support allows me to keep this package free, up-to-date and maintainable. Alternatively, you can **spread the word in social media**.

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

[](#requirements)

- PHP 8.3 or later
- Laravel 12 or later.

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

[](#installation)

Require this package into your project using Composer:

```
composer require laragear/meta
```

### Package testers

[](#package-testers)

You may additionally install testing helpers for your package. These should be installed in your `require-dev` arm of your composer so these are not shipped in the production version of your package.

```
composer require --dev laragear/meta-testing
```

### Discoverer

[](#discoverer)

The `Discover` class is a builder that allows discovering classes under a given path. It contains various fluent methods to filter the classes to discover, like methods, properties, interfaces and traits, among others.

```
composer require laragear/discover
```

Middleware declaration
----------------------

[](#middleware-declaration)

When using `withMiddleware()` you will receive a `MiddlewareDeclaration` object with convenient methods to register the middleware globally or inside a group, set it as first/last in the global priority stack, and register an alias for it.

```
public function boot()
{
    $declaration = $this->withMiddleware(OnlyAdults::class);

    // Make it a shared instance.
    $declaration->shared();

    // Set an alias
    $declaration->as('adults');

    // Puts it inside a middleware group.
    $declaration->inGroup('web');

    // Sets the middleware in the global stack.
    $declaration->globally();

    // Makes the middleware run first or last in the priority stack.
    $declaration->first();
    $declaration->last();
}
```

Builder extender
----------------

[](#builder-extender)

The `ExtendsBuilder` trait allows a [Global Scope](https://laravel.com/docs/eloquent#global-scopes) to extend the instance of the Eloquent Builder with new methods. Simply start your builder methods `extend`, no matter wich visibility scope or if the method is static or not.

```
use Illuminate\Database\Eloquent\Scope;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Laragear\Meta\Database\Eloquent\ExtendsBuilder;

class Cars implements Scope
{
    use ExtendsBuilder;

    public function apply(Builder $builder, Model $model)
    {
        // ...
    }

    private function extendWhereAvailable($builder)
    {
        return $builder->where('available_at', '>', now());
    }

    protected static function extendWhereColor($builder, string $color)
    {
        return $builder->where('base_color', $color);
    }
}
```

Tip

If you need the model being queried, you can always use `getModel()` over the Eloquent Builder instance.

Command Helpers
---------------

[](#command-helpers)

This meta-package includes the `WithEnvironmentFile` helper trait to modify the environment file keys and values.

```
use Illuminate\Console\Command;
use Laragear\Meta\Console\Commands\WithEnvironmentFile;

class AddServiceKey extends Command
{
    use WithEnvironmentFile;

    public function handle()
    {
        // ...

        $this->putEnvKey('AWESOME_SERVICE', $this->argument('service_key'))
    }
}
```

Attribute extractor
-------------------

[](#attribute-extractor)

The package contains the `Attr` helper that receives a target class, object, function, and allows to retrieve all or one attribute. Better yet, you can directly call a method or retrieve an attribute property.

```
use Laragear\Meta\Attr;use Vendor\Package\Attributes\MyCustomAttribute;

#[MyCustomAttribute(color: 'blue')]
class Car
{
    //
}

$car = new Car;

echo Attr::of($car)->get(MyCustomAttribute::class, 'color'); // "blue"
```

Laravel Octane compatibility
----------------------------

[](#laravel-octane-compatibility)

- There are no singletons using a stale application instance.
- There are no singletons using a stale config instance.
- There are no singletons using a stale request instance.
- `ExtendsBuilder` only initializes its static property once per Scope.

There should be no problems using this package with Laravel Octane.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
=======

[](#license)

This specific package version is licensed under the terms of the [MIT License](LICENSE.md), at time of publishing.

[Laravel](https://laravel.com) is a Trademark of [Taylor Otwell](https://github.com/TaylorOtwell/). Copyright © 2011-2025 Laravel LLC.

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance87

Actively maintained with recent releases

Popularity43

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 84% 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

Every ~56 days

Recently: every ~98 days

Total

27

Last Release

62d ago

Major Versions

v1.6.2 → v2.0.02023-02-18

2.x-dev → v3.0.02024-03-04

3.x-dev → 4.x-dev2025-02-16

v4.0.0 → v5.0.02026-03-03

PHP version history (3 changes)v1.0.0PHP &gt;=8.0.2

v2.0.0PHP ^8.1

v2.0.2PHP 8.\*

### 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 (121 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (22 commits)")[![it-can](https://avatars.githubusercontent.com/u/644288?v=4)](https://github.com/it-can "it-can (1 commits)")

---

Tags

laravelpackage

### Embed Badge

![Health badge](/badges/laragear-meta/health.svg)

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

###  Alternatives

[yajra/laravel-datatables-oracle

jQuery DataTables API for Laravel

4.9k33.8M339](/packages/yajra-laravel-datatables-oracle)[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[spatie/laravel-enum

Laravel Enum support

3655.4M31](/packages/spatie-laravel-enum)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[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)
