added route:destination method.

This commit is contained in:
Taylor Otwell 2012-02-09 23:36:08 -06:00
parent 8737dde682
commit 4330124d79
1 changed files with 16 additions and 0 deletions

View File

@ -218,4 +218,20 @@ public function handles($uri)
})); }));
} }
/**
* Extract the URI string from a route destination.
*
* <code>
* // Returns "home/index" as the destination's URI
* $uri = Route::uri('GET /home/index');
* </code>
*
* @param string $destination
* @return string
*/
public static function destination($destination)
{
return trim(substr($destination, strpos($destination, '/')), '/') ?: '/';
}
} }