PHPackages                             perrotin/smart-select - 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. [Database &amp; ORM](/categories/database)
4. /
5. perrotin/smart-select

ActiveLibrary[Database &amp; ORM](/categories/database)

perrotin/smart-select
=====================

A tool that will allow you set default select to your model and create the database user with the limited grants.

0.1.2(2mo ago)0984[1 PRs](https://github.com/Perrotin/smart-select/pulls)MITPHPPHP ^8.0

Since Jun 20Pushed 2mo agoCompare

[ Source](https://github.com/Perrotin/smart-select)[ Packagist](https://packagist.org/packages/perrotin/smart-select)[ RSS](/packages/perrotin-smart-select/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (14)Versions (5)Used By (0)

Smart select
============

[](#smart-select)

Install
-------

[](#install)

Install the package

`composer require perrotin/smart-select`

followed by

`php artisan vendor:publish --provider="SmartSelect\Providers\SmartSelectServiceProvider"`

### for developement

[](#for-developement)

If you wish to update the package, a good way is to update the repository and replace it with

```
"repositories": [
    {
        "type": "path",
        "url": "./packages-folder/smartselect",
        "options": {
            "symlink": true
        }
    }
],
```

How to use
----------

[](#how-to-use)

### Set up the package

[](#set-up-the-package)

In every model you want, you must :

- use the `HasDefaultSelect` trait
- use the `HasDefaultSelectColumns` interface
- set the `getGrantColumns()`method.

For example

```
namespace App\Models;

use SmartSelect\Contracts\HasDefaultSelectColumns;
use SmartSelect\Traits\HasDefaultSelect;

class User extends Model implements HasDefaultSelectColumns
{

	use HasDefaultSelect;

	protected $table = 'users';

	public function getGrantColumns(): array
    {
        return [
			'select' => ['id','name','created_at','updated_at'],
            'insert' => ['email', 'name'] // $this->fillable
		];
    }
}
```

### Configure it

[](#configure-it)

### use commands

[](#use-commands)

TODO
----

[](#todo)

- Testing
- Config option to execute grant access depending of environment
- ...

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance86

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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

Every ~132 days

Total

3

Last Release

68d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4dc51a4f7d8232b7287cb13b731bd9ab040483ae4c3087f7d9c46aaf5051eb28?d=identicon)[Perrotin](/maintainers/Perrotin)

---

Top Contributors

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

---

Tags

laraveldatabasemysqlmodelgrantssmart-select

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/perrotin-smart-select/health.svg)

```
[![Health](https://phpackages.com/badges/perrotin-smart-select/health.svg)](https://phpackages.com/packages/perrotin-smart-select)
```

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[pdphilip/elasticsearch

An Elasticsearch implementation of Laravel's Eloquent ORM

145360.2k4](/packages/pdphilip-elasticsearch)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)

PHPackages © 2026

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