New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

beanmoss/annotroute

Allows you to use Route annotations on your controllers.
425 6

Larablocks Analysis

beanmoss/annotroute works with Laravel 4 (latest release 0.1, Jul 8, 2014), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 4, past end of life
  • No release in the last 12 months (last: Jul 8, 2014)
  • 0 downloads a month (needs 10,000)
  • 6 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Jul 8, 2014.
  • No releases in the last 12 months.
  • First released: Jul 8, 2014.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.

Install
composer require beanmoss/annotroute
Latest Version:0.1
PHP:>=5.4.0
Laravel:4
License:MIT
Last Updated:Jul 27, 2014
Links: GitHub  ·  Packagist
Maintainer: beanmoss

#Annotroute: Laravel 4 Controller routing annotations.

Allows you to use Route annotations on your laravel controllers.

To install annotroute as a Composer package to be used with Laravel 4, simply add this to your composer.json:

"beanmoss/annotroute": "dev-master"

..and run composer update. Once it's installed, you can register the service provider in app/config/app.php in the providers array. I strongly suggest that it should be registeristered after the Router Provider:

'providers' => array(
...
    'Beanmoss\Annotroute\AnnotrouteServiceProvider',
)

and for the Facade:

...
'AnnotRoute'      => 'Beanmoss\Annotroute\Facade\AnnotRoute',
...

#Usage

<?php
use Beanmoss\Annotroute\Annotation\Route as MyRoute;
/**
 * @MyRoute(group={"prefix" = "home", "before" = "auth"})
 */
class HomeController extends BaseController
{
    /*
      |--------------------------------------------------------------------------
      | Default Home Controller
      |--------------------------------------------------------------------------
      |
      | You may wish to use controllers instead of, or in addition to, Closure
      | based routes. That's great! Here is an example controller method to
      | get you started. To route to this controller, just add the route:
      |
      |	Route::get('/', 'HomeController@showWelcome');
      |
     */

    /**
     * @MyRoute(method="get", path="/")
     * @MyRoute(method="get", path="/welcome")
     */
    public function showWelcome()
    {
        return View::make('hello');
    }

    /**
     * @MyRoute(
     *  method="get", 
     *  path="/test/{id}/{name}", 
     *  before = "", 
     *  name="test", 
     *  where={"id" = "[0-9]+","name" = "[a-z]+"}
     * )
     */
    public function test($id, $name)
    {
        return 'test' . $id . $name;
    }
}


And somewhere in your routes.php

<?php

/*
  |--------------------------------------------------------------------------
  | Application Routes
  |--------------------------------------------------------------------------
  |
  | Here is where you can register all of the routes for an application.
  | It's a breeze. Simply tell Laravel the URIs it should respond to
  | and give it the Closure to execute when that URI is requested.
  |
 */

AnnotRoute::generateRoute('HomeController');

Thats it! If you found some bugs, please let me know. Thank you! Also, you can help me test this ;)

Related Packages

eusonlito/laravel-simple-route

A package to create basic routes based in locales

112 0
laravel/folio

Page based routing for Laravel.

901,435 609
inmanturbo/turbohx

Send HTMX hx-post, put, patch and delete requests to your laravel/folio routes.

6,177 2
delormejonathan/laravel-js-routing

Laravel 4/5 package to access Routing from Javascript

1,018 7
babanesma/laravel5-routing

Laravel5 routing package

14 0

Version History

Version Released PHP Laravel License
0.1 >=5.4.0 4.2.*