douzhi9395 2016-01-15 15:08
浏览 32
已采纳

定义路径时,Laravel路径未定义错误

In my view I am calling the following function:

<a href="{!! Route('admin.sessions') !!}">Sessions</a>

Which is triggering the following error:

ErrorException in UrlGenerator.php line 307:
Route [admin.sessions] not defined.

The thing is in my routes I have the following:

Route::get('admin/sessions', ['middleware' => ['ability:super_admin,sessions.view'], 'uses' => 'Admin\SessionsController@index', 'as' => 'admin.sessions']);

Am I missing something? This should work shouldn't it?

  • 写回答

1条回答 默认 最新

  • dou70260 2016-01-15 15:13
    关注

    Found the problem I had another route that was referencing the same URL but with a different name.

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

报告相同问题?

悬赏问题

  • ¥15 socket通信实现多人聊天室疑惑
  • ¥15 DEV-C++编译缺失
  • ¥33 找熟练码农写段Pyhthon程序
  • ¥100 怎么让数据库字段自动更新
  • ¥15 antv g6 力导向图布局
  • ¥15 quartz框架,No record found for selection of Trigger with key
  • ¥15 锅炉建模+优化算法,遗传算法优化锅炉燃烧模型,ls-svm会搞,后面的智能算法不会
  • ¥20 MATLAB多目标优化问题求解
  • ¥15 windows2003服务器按你VPN教程设置后,本地win10如何连接?
  • ¥15 求一阶微分方程的幂级数