PHPackages                             wtfz/laravel-route-button - 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. wtfz/laravel-route-button

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

wtfz/laravel-route-button
=========================

Generate route buttons with dropdown from the model

v1.1.1(3y ago)264MITBladePHP ^8.0

Since Dec 18Pushed 3y ago1 watchersCompare

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

READMEChangelog (6)Dependencies (1)Versions (11)Used By (0)

Laravel Route Button
====================

[](#laravel-route-button)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c29a33c081c256268d4a63b312666413d818e67f0518cbdbe5827c8ac6e6c006/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7774667a2f6c61726176656c2d726f7574652d627574746f6e)](https://packagist.org/packages/wtfz/laravel-route-button)[![Total Downloads](https://camo.githubusercontent.com/6a0b3e90c6bba631d99069cfccb966e22abab495e41a9ba918031a529928e522/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7774667a2f6c61726176656c2d726f7574652d627574746f6e)](https://packagist.org/packages/wtfz/laravel-route-button)[![License](https://camo.githubusercontent.com/16a92d5bf301b890937d750528db40e0f336eaf6a54089d4da2f09eddd07cfb4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7774667a2f6c61726176656c2d726f7574652d627574746f6e)](https://packagist.org/packages/wtfz/laravel-route-button)

Generate route buttons with dropdown from the model.

---

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

[](#installation)

```
composer require wtfz/laravel-route-button
```

Customization
-------------

[](#customization)

To customize, publish and edit the component.

```
php artisan vendor:publish --tag=laravel-route-button
// resources/views/vendor/route-button
```

Usage
-----

[](#usage)

Add this code and define each route buttons inside your model.

```
use Wtfz\LaravelRouteButton\RouteButton;

class YourModel extends Model
{
    use RouteButton;

    // init empty route button
    public static $routeButton = [];

    // or init global route button
    public static $routeButton = [
            [
                'route' => 'admin.auth.user.delete',
                'text' => 'Delete User',
                'view' => 'frontend.profile.confirm',
                'args' => [$this, 1], // Optional, default: $model
            ],
            // ...
        ];

    // or init named route button
    public static $routeButton = [
            'index' => [
                'route' => 'admin.auth.user.edit',
                'text' => 'Edit User'
            ],
            'edit' => [
                'route' => 'admin.auth.user.destroy',
                'text' => 'Destroy User'
            ],
            // ...
        ];

    // or init mixed route button
    public static $routeButton = [
            [
                'route' => 'admin.auth.user.edit',
                'text' => 'Edit User',
                'args' => [$this, 1], // Optional, default: $model
            ],
            'index' => [
                'route' => 'admin.auth.user.edit',
                'text' => 'Edit User'
            ],
            'edit' => [
                'route' => 'admin.auth.user.destroy',
                'text' => 'Destroy User'
            ],
            // ...
        ];
}
```

Render route button inside your view by calling it from your model.

```
// global route button
{{ $model->routeButton() }}

// named route button
{{ $model->routeButton('edit') }}

// or in Livewire table...
Column::make(__('Actions'), 'id')
    ->format(function ($value, $row, $column) {
        return $row->routeButton('edit');
    }),

// or add new route button on the fly...
Column::make(__('Actions'), 'id')
    ->format(function ($value, $row, $column) {
        // for global route (set integer index)
        $row::$routeButton[0][] = [
            'route' => 'admin.auth.user.delete',
            'text' => 'Delete User',
            'args' => ['type' => 'member', 'user' => $row],
        ];

        // for named route (set string index)
        $row::$routeButton['edit'][] = [
            'route' => 'admin.auth.user.delete',
            'text' => 'Delete User',
            'args' => ['type' => 'member', 'user' => $row],
        ];

        return $row->routeButton('index');
    }),
```

License
-------

[](#license)

Copyright © Ahmad Zaim

The [MIT License](LICENSE.md) (MIT)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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 ~2 days

Total

10

Last Release

1219d ago

PHP version history (2 changes)v1.0.0PHP ^7.4|^8.0

v1.0.7PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3521c332b51e1f363a5b14257adedc73d66231b5e34b991c363a71856d8c5e69?d=identicon)[wtfz](/maintainers/wtfz)

---

Top Contributors

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

---

Tags

wtfzlaravel-route-button

### Embed Badge

![Health badge](/badges/wtfz-laravel-route-button/health.svg)

```
[![Health](https://phpackages.com/badges/wtfz-laravel-route-button/health.svg)](https://phpackages.com/packages/wtfz-laravel-route-button)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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