PHPackages                             corvo/router - 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. [API Development](/categories/api)
4. /
5. corvo/router

ActiveLibrary[API Development](/categories/api)

corvo/router
============

0111PHP

Since May 16Pushed 12y ago2 watchersCompare

[ Source](https://github.com/LisandroSeijo/CorvoRoutes)[ Packagist](https://packagist.org/packages/corvo/router)[ RSS](/packages/corvo-router/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#CorvoRoutes Simple way to organize Laravel proyects.

If you wanna contribute, please, fork or open an [issue](https://github.com/LisandroSeijo/CorvoRoutes/issues).

If you have a question, sand me a [tweet](https://twitter.com/LisandroSeijo), or join on [Laraveles](http://laraveles.com/foro/) (Laravel in spanish).

\#How to use

\###Instalation Add `"corvo/router"` in your composer.json requires and run `composer update`.

```
require {
    ...,
    "corvo/router": "dev-master"
}

```

Note: if you use namespaces in your sections add `app/web` with `psr-0` or `psr-4` on `composer.json`

```
autoload {
    "classmap": [
      ...
    ],
    "psr-0": {
      "": "app/web"
    }
}

```

Add `Corvo\Routes\Providers\CorvoRoutesServiceProvider` in your `app/config/app.php` file

```
'providers' => array(
  'Illuminate\Foundation\Providers\ArtisanServiceProvider',
  ...
  'Corvo\Routes\Providers\CorvoRoutesServiceProvider'
)
```

Now, the easy way to create sections is using `artsian`, run the following command in your root application folder:

```
php artsian corvo:section [section_name]

```

That create a section called `[section_name]`. For example, lets to create a section for a blog

```
php artsian corvo:section Blog

```

And an admin section

```
php artsian corvo:section Admin

```

See in your `proyect/app` folder, and open the new folder named `web`, this contain all sections, and now we have the Blog and Admin sections.

You must have something like that:

```
|--app
|--|--web
|--|--|--Blog
|--|--|--|--Config
|--|--|--|--Controllers
|--|--|--|--Library
|--|--|--|--Models
|--|--|--|--routes.php
|--|--|--|--Views
|--|--|--Admin
|--|--|--|--Config
|--|--|--|--Controllers
|--|--|--|--Library
|--|--|--|--Models
|--|--|--|--routes.php
|--|--|--|--Views

```

\###Namespaces Now what we have the sections, go to create the views:

```
/* app/web/Blog/Views/index.blade.php */

My Awsome Blog!

@foreach($posts as $post)

    {{ $post->title }}
    {{ $post->content }}

@endforeach
```

For access to this view, we can use the namespaces called in the same way as section.

Add in the Blog/routes.php file:

```
/* app/web/Blog/routes.php */

Route::group(array('prefix' => 'blog'), function ()
{
  Route::get('/', function()
  {
    $posts = Blog\Models\Post::all();
    return View::make('Blog::index', ['posts' => $posts]);
  });
});
```

The Blog namespace is already added, and we can use that for do refence to all Blogs views.

The same way in our Admin views, and all sections:

```
/* app/web/Admin/routes.php */

Route::group(array('prefix' => 'admin'), function ()
{
  Route::get('/users', function()
  {
    $users = Admin\Models\Users::all();
    return View::make('Admin::users', ['users' => $users]);
  });
});
```

To access to config files is the same way:

```
/* app/web/Blog/Config/general.php */

return array(
  'posts_per_page' => 10
);
```

```
/* app/web/Blog/Controllers/HomeController.php */

public function getIndex()
{
  $postsPerPage = Config::('Blog::general.posts_per_page');
  $posts = Blog\Models\Post::take($postsPerPage)->get();
  return View::make('Blog::index', ['posts' => $posts]);
}
```

\#Runing To run this, we need load CorvoRoutes class. To do that, in the `proyect/app/routes.php` file add the following line:

```
/* app/routes.php */

CorvoRoutes::load();
```

And that's all.

\#Advanced usage:

\###Configuration You can change the some features of CorvoRoutes like the path of sections, routes filename or the name of view folder.

In your `proyect/app/config` folder create a new config file called `corvoroutes`

```
|--app
|--|--config
|--|--|--corvoroutes.php

```

In this file, you can change one or more features.

Options:

NameDescriptionbase\_pathChange the base path of your sections locationalternative\_pathsArray which contain the absolute path to other sections locationroutes\_filenameName of your routes fileviews\_folderName of your views folderFor example, if you wanna change the views folder `/Views` for `/Templates`, only add this option:

```
/* proyect/app/config/corvoroutes.php */

return array(
    'views_folder' => 'Templates'
);
```

And change the `base_path`, you don't like `proyect/app/web` and think is better `proyect/content`:

```
/* proyect/app/config/corvoroutes.php */

return array(
    'base_path'    => base_path().'/content',
    'views_folder' => 'Templates'
);
```

**Note:** if you change `base_path` and created previous sections in `proyect/app/web` you must move to the new base\_path or add with `alternative_paths`

\###Alternative paths For add a section in other location like `proyect/content/Foro/` and `proyect/Users/` you have two was:

1. Using config file:

```
return array(
    'alternative_paths' => array(
        base_path().'/content/Foro',
        base_path().'/Users'
    )
);
```

2. Using alternativePaths() method

```
/* proyect/app/routes.php */

CorvoRoutes::alternativePaths(array(
    base_path().'/content/Foro',
    base_path().'/Users'
))
->load();
```

And each "alternative path" work like `proyect/app/web` sections.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0262a664e7ae963073c3cf0c085c9fe55fddac4273f3c0c6dd8ade7a462318fb?d=identicon)[LisandroSeijo](/maintainers/LisandroSeijo)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/corvo-router/health.svg)

```
[![Health](https://phpackages.com/badges/corvo-router/health.svg)](https://phpackages.com/packages/corvo-router)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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