【问题标题】:ErrorException in UrlGenerator.php line 304: Route [manageDoctors] not defined. (View:UrlGenerator.php 第 304 行中的 ErrorException:未定义路由 [manageDoctors]。 (看法:
【发布时间】:2017-09-07 21:16:07
【问题描述】:

我有

<li>
    <a href="{{ route('manageDoctors') }}">
         <i class="demo-psi-split-vertical-2"></i>
         <span class="menu-title">
         <strong>Manage Doctors</strong>
         </span>
         <!--       <i class="arrow"></i> -->
     </a>
</li>

在我看来和

Route::post('login', 
            array('uses' => 'login\LoginController@doLogin')); 

在我的 web.php 中。

仍然出现错误Route [manageDoctors] not defined

我是 Laravel 的新手

【问题讨论】:

  • 请检查您的问题并检查格式!有问题!
  • 你必须先添加一个命名'manageDoctors'的路由,然后才能调用route ('manageDoctors')

标签: php laravel-5.4


【解决方案1】:

错误很明显,您没有定义任何名为manageDoctors 的路由。你可以:

Route::post('login', 
        array('uses' => 'login\LoginController@doLogin')); 
Route::get('manageDoctors', function () { 
     return response("Look, I'm managing doctors!");
});

【讨论】:

    【解决方案2】:

    试试这个

    Route::post('login', 
            array('uses' => 'login\LoginController@doLogin'))->name('manageDoctors');
    

    您必须在您的网络文件中专门命名路线

    【讨论】:

      猜你喜欢
      • 2017-10-09
      • 2017-06-15
      • 2017-08-13
      • 2017-05-14
      • 2019-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多