PHPackages                             touhidurabir/laravel-multi-key-route-binding - 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. [API Development](/categories/api)
4. /
5. touhidurabir/laravel-multi-key-route-binding

ActiveLibrary[API Development](/categories/api)

touhidurabir/laravel-multi-key-route-binding
============================================

A simple laravel package to handle multiple key based model route binding

1.0.1(4y ago)132.0k↓50%MITPHP

Since Aug 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/touhidurabir/laravel-multi-key-route-binding)[ Packagist](https://packagist.org/packages/touhidurabir/laravel-multi-key-route-binding)[ RSS](/packages/touhidurabir-laravel-multi-key-route-binding/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Laravel Multi Key Route Binding
===============================

[](#laravel-multi-key-route-binding)

A simple package to handle the multiple key/column based route model binding for laravel package

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

[](#installation)

Require the package using composer:

```
composer require touhidurabir/laravel-multi-key-route-binding
```

Usage
-----

[](#usage)

Use the trait **HasMultipleRouteBindingKeys** in model where uuid needed to attach

```
use Touhidurabir\MultiKyeRouteBinding\HasMultipleRouteBindingKeys;
use Illuminate\Database\Eloquent\Model;

class User extends Model {

    use HasMultipleRouteBindingKeys;
}
```

And then add the protected property **$routeBindingKeys** which will contails the list of other route binding keys.

```
/**
 * The attributes that will be used for multiple key binding on route models
 *
 * @var array
 */
protected $routeBindingKeys = [
    'email',
    'username'
];
```

By default column **id** is considered as the primary key for route model binding . But it is always possible to override/customize the primary key for route binding [as per laravel doc](https://laravel.com/docs/8.x/routing#customizing-the-default-key-name)

```
/**
 * Get the route key for the model.
 *
 * @return string
 */
public function getRouteKeyName()
{
    return 'slug';
}
```

> The package also provide a bit of safe guard by checking if the model table has the given binding key column .
>
> If the binding key column not found for model table schema, it will skip that binding key.

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License
-------

[](#license)

[MIT](./LICENSE.md)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Every ~74 days

Total

2

Last Release

1657d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6c6009d764c48df4a55a8645c349f90a99c7e6e694b06c60b580e1da278d1db5?d=identicon)[touhidurabir](/maintainers/touhidurabir)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/touhidurabir-laravel-multi-key-route-binding/health.svg)

```
[![Health](https://phpackages.com/badges/touhidurabir-laravel-multi-key-route-binding/health.svg)](https://phpackages.com/packages/touhidurabir-laravel-multi-key-route-binding)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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