PHPackages                             brayniverse/laravel-route-macros - 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. brayniverse/laravel-route-macros

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

brayniverse/laravel-route-macros
================================

A collection of useful route macros.

v1.0.0(9y ago)191504[2 issues](https://github.com/brayniverse/laravel-route-macros/issues)MITPHPPHP ^5.5.9 || ^7.0

Since Mar 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/brayniverse/laravel-route-macros)[ Packagist](https://packagist.org/packages/brayniverse/laravel-route-macros)[ Docs](https://github.com/brayniverse/laravel-route-macros)[ RSS](/packages/brayniverse-laravel-route-macros/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Laravel route macros
====================

[](#laravel-route-macros)

[![Build Status](https://camo.githubusercontent.com/9190fccc63f4f236a0a04fef1138819abd7707ae2a86a467ab9a359ed987d05c/68747470733a2f2f7472617669732d63692e6f72672f627261796e6976657273652f6c61726176656c2d726f7574652d6d6163726f732e737667)](https://travis-ci.org/brayniverse/laravel-route-macros)[![Total Downloads](https://camo.githubusercontent.com/9815b29e90af21c9aa0a02d17188ab49a5415a54b003473055305d5652bb986d/68747470733a2f2f706f7365722e707567782e6f72672f627261796e6976657273652f6c61726176656c2d726f7574652d6d6163726f732f642f746f74616c2e737667)](https://packagist.org/packages/brayniverse/laravel-route-macros)[![Latest Stable Version](https://camo.githubusercontent.com/a28aa079d185fd41865ddcd88a7711c534bf22087efd1714bd646332384cda5f/68747470733a2f2f706f7365722e707567782e6f72672f627261796e6976657273652f6c61726176656c2d726f7574652d6d6163726f732f762f737461626c652e737667)](https://packagist.org/packages/brayniverse/laravel-route-macros)[![Latest Unstable Version](https://camo.githubusercontent.com/8711dedb94194cf7fffe7027e2b2aa4a8083005fb54597ac4861ab0f1b02313f/68747470733a2f2f706f7365722e707567782e6f72672f627261796e6976657273652f6c61726176656c2d726f7574652d6d6163726f732f762f756e737461626c652e737667)](https://packagist.org/packages/brayniverse/laravel-route-macros)[![License](https://camo.githubusercontent.com/f645dcaf7466e102c1a94fc7e5ae8ccb44986d1794a20bf8e8e6a636079664f8/68747470733a2f2f706f7365722e707567782e6f72672f627261796e6976657273652f6c61726176656c2d726f7574652d6d6163726f732f6c6963656e73652e737667)](https://packagist.org/packages/brayniverse/laravel-route-macros)

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

[](#installation)

Begin by installing the package through Composer.

```
$ composer require brayniverse/laravel-route-macros
```

Then add the following to your providers array in `config/app.php`.

```
Brayniverse\RouteMacros\ServiceProvider::class
```

Usage
-----

[](#usage)

### `view`

[](#view)

Normally you'd have to return a view in either a controller method or callback like the following:

```
public function contact()
{
  return view('contact');
}

// or

Route::get('/contact', function () {
  return view('contact');
});
```

Now you can do the same in one line.

```
Route::view('/contact', 'contact');
```

### `redirect`

[](#redirect)

Normally you'd have to create a closure to redirect to the new route.

```
Route::get('/contact_us', function () {
  return redirect('/contact');
});
```

Now you can do the same in one line.

```
Route::redirect('/contact_us', '/contact');
```

Optionally, you can pass a third argument to `Route::redirect()` which will set the status code when redirecting. If you do not specify a status code, the package will use `301` as the status code.

```
Route::redirect('/contact_us', '/contact', 302);
```

Credits
-------

[](#credits)

- [Christopher L Bray](https://github.com/brayniverse)
- [All Contributors](../../contributors)

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3403d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravellaravel-packagemacrosroutelaravelroutermacros

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/brayniverse-laravel-route-macros/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M337](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M131](/packages/laravel-mcp)[toin0u/geocoder-laravel

Geocoder Service Provider for Laravel

7615.4M15](/packages/toin0u-geocoder-laravel)[zidbih/laravel-deadlock

Make temporary Laravel workarounds expire and fail CI when ignored.

984.0k](/packages/zidbih-laravel-deadlock)

PHPackages © 2026

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