dongzhi2332 2015-04-08 00:23
浏览 62
已采纳

routes.php和whoops,看起来出了问题

I just started learning laravel and in the tutorial I found, it told me to edit the routes.php file, but when I replace the code in the file with new code I get the message "Whoops, looks like something went wrong." Also in the video the routes.php file is located in the Http folder, but I don't have this folder in my directories. Instead routes.php is located in the app folder. Is this supposed to be the same fil

If I replace the following code in routes.php:

<?php

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

with this code:

<?php
get('songs', 'SongsController@index');'

I get the whoops error.

Also in the video the routes.php file is located in the Http folder, but I don't have this folder in my directories. Instead routes.php is located in the app folder. Is this supposed to be the same file?

enter image description here

I've been stuck on this for a couple days now so any help is appreciated. Screenshot attached of my app's directories/file structure.

  • 写回答

1条回答 默认 最新

  • duangu1868 2015-04-08 00:58
    关注

    You are using Laravel 4.2 and this tutorial that you found is using Laravel 5, that's the problem.

    The get() helper is new to Laravel 5, so you might want to use it to follow up your tutorial. Also, even though "Whoops, looks like something went wrong." (and it's relative package) is removed from Laravel 5, this is your error "tracking" page, so try to read the real error, it will provide more guidance on what is wrong.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题