0
votes

In routes.php I have this code above all routes:

# Lang::get('routes.page') = 'page';
if (preg_match('/\\/'.Lang::get('routes.page').'-[0-9]+/i',
    $_SERVER['REQUEST_URI'], $matches)) {
    if (isset($matches[0]) and strtolower($matches[0]) !== $matches[0]) {
        $url = str_ireplace(
            '/'.Lang::get('routes.page').'-', 
            '/'.Lang::get('routes.page').'-',
            $_SERVER['REQUEST_URI']
        );
        return Redirect::to($url, 301);
    }
}

It's giving me error:

Error in exception handler: Route [content] not defined. (View: /path/to/app/views/view.blade.php) (View: /path/to/app/views/view.blade.php) in /path/to/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php:231

This is Laravel 4.2. Why I get this error?

1
Do you have a Route::get('content', ...) or similar in your routes file?user1669496
No, not in route. And I don't include this blade template file in code above "return" operator.G.N.

1 Answers

0
votes

Error exists in "views/view.blade.php" not in your route. May be like this

// ....
//
{{route('content')}}
// [or]
{{URL::route('content')}}
// ....