PHPackages                             tomschlick/laravel-linkable - 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. tomschlick/laravel-linkable

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

tomschlick/laravel-linkable
===========================

URL binding for Laravel models

v4.0(4y ago)2532.0k↓21.2%1[2 issues](https://github.com/tomschlick/laravel-linkable/issues)[1 PRs](https://github.com/tomschlick/laravel-linkable/pulls)MITPHPPHP &gt;=7.3

Since Sep 18Pushed 4y ago2 watchersCompare

[ Source](https://github.com/tomschlick/laravel-linkable)[ Packagist](https://packagist.org/packages/tomschlick/laravel-linkable)[ RSS](/packages/tomschlick-laravel-linkable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (7)Used By (0)

Laravel Linkable
================

[](#laravel-linkable)

[![StyleCI](https://camo.githubusercontent.com/9551d27894a973ca325ecab5e4738d89b39ed943702b90aad580caae3fc8bdb7/68747470733a2f2f7374796c6563692e696f2f7265706f732f36383439323930352f736869656c64)](https://styleci.io/repos/68492905) [![Build Status](https://camo.githubusercontent.com/afeb0d97d4dbe4748ddf780e1bdeff2811c8d9a142ee12cff88aaba859d30a2e/68747470733a2f2f7472617669732d63692e6f72672f746f6d7363686c69636b2f6c61726176656c2d6c696e6b61626c652e737667)](https://travis-ci.org/tomschlick/laravel-linkable) [![Latest Stable Version](https://camo.githubusercontent.com/230553ec21994b50f12c2511472020538dfde1b58ef003b43bdfb14550c9f83e/68747470733a2f2f706f7365722e707567782e6f72672f746f6d7363686c69636b2f6c61726176656c2d6c696e6b61626c652f762f737461626c65)](https://packagist.org/packages/tomschlick/laravel-linkable) [![Total Downloads](https://camo.githubusercontent.com/4605a042a9d9e628a0aabcdd6e2b0c92c709a67d38da0c352801dc81492d4293/68747470733a2f2f706f7365722e707567782e6f72672f746f6d7363686c69636b2f6c61726176656c2d6c696e6b61626c652f646f776e6c6f616473)](https://packagist.org/packages/tomschlick/laravel-linkable) [![License](https://camo.githubusercontent.com/4778f2d733b451b297e974c2799cfd8b63750a71b7c30f794633b3386446197c/68747470733a2f2f706f7365722e707567782e6f72672f746f6d7363686c69636b2f6c61726176656c2d6c696e6b61626c652f6c6963656e7365)](https://packagist.org/packages/tomschlick/laravel-linkable)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#----)

Linkable allows you to bind named routes directly to your Eloquent models. It has been tested with Laravel 5.0 and above (although it may work on older versions as well).

Making calls to `route()` each time you need to generate a url can be cumbersome and makes your Blade files unreadable. Instead with Linkable, you can use this syntax to generate a url:

```
    $model->link()
```

That's it! Check out the full usage below.

Install via Composer
--------------------

[](#install-via-composer)

```
  composer require tomschlick/laravel-linkable
```

Add to your model(s) and implement the interface
------------------------------------------------

[](#add-to-your-models-and-implement-the-interface)

```
class User extends Model
{
    use TomSchlick\Linkable\Linkable;

    public function sublink(string $key, array $attr = []) : string
    {
        return route("users.$key", [
                'user_id' => $this->id, // 'user_id' is the name of the parameter in the users.* route group
                ] + $attr);
    }
}
```

Usage
-----

[](#usage)

```
$model->link(); // Link for the resource (example: https://your-site.com/user/7)

$model->sublink('edit'); // SubLink for the resource (example: https://your-site.com/user/7/edit)

$model->sublink('photos.show', ['photo_id' => 1234]); // SubLink for the resource (example: https://your-site.com/user/7/photos/1234)

$model->redirect(); // Generates a redirect response to the resource to use in a controller return statement.

$model->sublinkRedirect('edit'); // Generates a redirect response to the resource's edit page to use in a controller return statement.
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 85.2% 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 ~440 days

Total

5

Last Release

1768d ago

Major Versions

v1.0.0 → v2.0.02019-04-06

v2.0.1 → v3.02020-03-22

v3.0 → v4.02021-07-15

PHP version history (4 changes)v1.0.0PHP ^7.0

v2.0.0PHP ^7.1

v3.0PHP ^7.3

v4.0PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/b116525a1bd1456044dc2edc80dd04a09806549a38945eb9b905b143a642c4bd?d=identicon)[tomschlick](/maintainers/tomschlick)

---

Top Contributors

[![tomschlick](https://avatars.githubusercontent.com/u/70184?v=4)](https://github.com/tomschlick "tomschlick (23 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

httplaravellinksphpurl

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tomschlick-laravel-linkable/health.svg)

```
[![Health](https://phpackages.com/badges/tomschlick-laravel-linkable/health.svg)](https://phpackages.com/packages/tomschlick-laravel-linkable)
```

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4205.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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