I am not new to MVC, but am new to Laravel. I have managed to install it on Windows 8.1 with WAMP. I go to the root URL ( http://localhost/public/
) and get the Laravel logo and the 'You have arrived.' line of text.
Now I want to play around a bit, the documentation tells me that the code below should work.
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::get('/', function()
{
return View::make('hello');
});
Route::get('users', function () {
return 'users!';
});
I should get the text users
when I navigate to http://localhost/public/users
instead I get a 404. What am I doing wrong?
Your code in route file should be like this
Route::get('/users', function () {
return 'users!';
});
Give it a try!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.