drake900918 2016-01-13 09:09
浏览 25

如何在laravel 5.2中添加新路线

I am new to laravel,

this is my issue, I downloaded latest laravel 5.2 using composer and run initial code using wamp, it runs without any issue. Now I want to add a simple about us page. So I put href in welcome.blade.php

<a href="{{ url('aboutus') }}">About Us</a>

After that I changed the route.php as below:

Route::get ( '/', function () {
return view ( 'welcome' );
} );

Route::get ( '/aboutus', function () {
    return view ( 'welcome' );
} );


Route::group ( [ 
        'middleware' => [ 
                'web' 
        ] 
], function () {

} );

I just added the "aboutus" route part, but when I click the About Us link, server gives a 404 error, please help me.

  • 写回答

1条回答 默认 最新

  • dongtan5555 2016-01-13 09:40
    关注
    Use Route::get ( 'aboutus', function () {
        return view ( 'welcome' );
    } );
    

    Please check this.

    评论

报告相同问题?

悬赏问题

  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥500 火焰左右视图、视差(基于双目相机)