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)2534.3k↓73.6%1[2 issues](https://github.com/tomschlick/laravel-linkable/issues)[1 PRs](https://github.com/tomschlick/laravel-linkable/pulls)MITPHPPHP &gt;=7.3CI failing

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 2d 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 79% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity36

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

1814d 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://avatars.githubusercontent.com/u/70184?v=4)[Tom Schlick](/maintainers/tomschlick)[@tomschlick](https://github.com/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

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

592.7k1](/packages/crumbls-layup)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1320.9k4](/packages/team-nifty-gmbh-tall-datatables)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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