Route Error Accessing Site

Asked

Viewed 133 times

1

When I add this route to the file Routes.php:

Routes.php

Route::get('postagem', function (){
   return "teste";
});

Route::get('/', function(){
    return View::make('hello');
});

Presents this error:

Fatal error: Class 'Route' not found in C: wamp www Laravel app Routes.php on line 13

Use Laravel 4.2, Wamp Server. I have already made several commands with the upgrade software, but without success.

  • Type in the http://localhost/seusite/public/posting URL, which appears ?

  • @Taopaipai NOT Found 404

  • How’s your URL? Put it there.

  • @Taopaipai localhost/Standard/public/posting

  • So, but the name of your route is posting and not postagem.

  • @Taopaipai is posting is because I put this question in the English forum then I just copied

  • That’s all there is in your route file? And .htaccess ?

  • @Taopaipai this way >'<Ifmodule mod_rewrite. c> <Ifmodule mod_negotiation. c> Options -Multiviews </Ifmodule> Rewriteengine On # Redirect Trailing Slashes... Rewriterule (.*)/$ /$1 [L,R=301] # Handle Front Controller... Rewritecond %{REQUST_FILENAME} ! -d Rewritecond %{REQUEST_FILENAME} ! -f Rewriterule index.php [L] </Ifmodule>'

  • When you installed Laravel worked the test page ?

  • @Taopaipai yes, this is the only route that works

  • Everson, post the entire route file code in your question.

  • @Taopaipai ready made

  • Did you install it like Laravel? And what command did you use to create the project? The problem here doesn’t seem to be with Apache or folder permission.

Show 8 more comments

1 answer

1


Try to do it this way:

Create a Controller from the command:

$ php artisan make:controller HomeController.

Then on the route erase everything and do:

Route::controller('/', 'HomeController');

In Homecontroller enter the code:

public function getIndex(){
    return "Teste";
}

Then type in the URL:

http://localhost/Standard/public/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.