Not understanding basic routes of Laravel php framework -


i learning laravel 5. have installed . os ubuntu 14.04. following this learn laravel.

i have written these codes in app/http/roures.php:

route::get('/foo', function() {     return 'hello world'; }); 

going localhost:8000/foo see hello world. that's ok.

now, replaced above codes following codes:

route::post('foo/bar', function() {     return 'hello world'; });  route::put('foo/bar', function() {     // });  route::delete('foo/bar', function() {     // }); 

then, how able access post or put or delete routes? mean should url ?

you don't change url, depends on http request was.

when navigate /foo/bar request using get.

if post form action set /foo/bar post route takes effect.

so bottom line, same url, different method.


Comments