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(5mo ago)01.3k[1 PRs](https://github.com/Perrotin/smart-select/pulls)MITPHPPHP ^8.0

Since Jun 20Pushed 5mo 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 2w 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

35

—

LowBetter than 77% of packages

Maintenance72

Regular maintenance activity

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

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

158d 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

[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M318](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

20433.0M1.8k](/packages/illuminate-queue)[spatie/laravel-medialibrary

Associate files with Eloquent models

6.2k45.4M704](/packages/spatie-laravel-medialibrary)[laravel/sail

Docker files for running a basic Laravel application.

1.9k212.4M1.5k](/packages/laravel-sail)[aedart/athenaeum

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

265.2k](/packages/aedart-athenaeum)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)

PHPackages © 2026

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