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 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c