laravel/laravel — Issue #323: Better HMVC support
Author: kbanman
Created: 2012-02-09 10:38:34+00:00
State: open

I've run into some limitations with the current [hackish] support for making in-application "HMVC" requests:
Here's a bit of my code:

```php
Event::listen('content_panels', function($type, Customer $customer)
{
$panel = Router::route('GET', '/customers/'.$customer->id.'/comments')->call()->render();

Section::inject('content', $panel);
});
```
I'm collecting partials by faking a request to their URIs. These partials are accessible via URIs to allow the application to request them bit by bit from the client (using ajax calls).

The problem I ran into is determining from within one of these "partial" URIs whether the current request is the main request or not.

###Proposed solution###

This could be solved by allowing multiple instances of `Request`. Then referencing request properties would look like `Request::current()->method()`, `Request::main()->ajax()`, etc.

Let's hear some thoughts. I'd be happy to help with the implementation if this flies with Taylor.