2015-04-21 118 views
0

我有一个关于Laravel 5.使用问题后Form::open,产生了某种错误:关于调用一个成员函数域()一个非对象

error : Call to a member function domain() on a non-object 

FatalErrorException in UrlGenerator.php line 440: 
Call to a member function domain() on a non-object 
in UrlGenerator.php line 440 
at HandleExceptions->fatalExceptionFromError(array('type' => '1', 'message' => 'Call to a member function domain() on a non-object', 'file' => '/home/nl/Laravel/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php', 'line' => '440')) in HandleExceptions.php line 116 
at HandleExceptions->handleShutdown() 

这是我LoginCheckController.php:

<?php namespace App\Http\Controllers; 

class LoginCheckController extends BaseController { 

    public function index() 

这是我的路线:

Route::post('/LoginCheck', '[email protected]'); 

鉴于我有这样的:

{!! Form::open(array('action' => '[email protected]')) !!} 

我也跑composer dump-autoloadphp artisan clear-compiled,但我仍然得到错误。有什么我忘了吗?有明确的版本

  1. 重新安装作曲家
  2. PHP工匠化妆:

    我解决它由控制器具有手动

+0

这是否错误发生在什么文件和行? – deceze

+0

像上面的错误谢谢。 – nlstduio

+0

你需要告诉我们你使用的是什么版本。 GitHub的5.0分支上的最新版本没有与440行相关的任何内容:https://github.com/laravel/framework/blob/5.0/src/Illuminate/Routing/UrlGenerator.php#L440还寻找通话为'domain'(' - >域(')没有返回在该文件中有关:https://github.com/laravel/framework/search?utf8=%E2%9C%93&q=-%3Edomain%28 –

回答

0

首先更新您的laravel框架包,看着你在后面跟着跑就行了。

其次,在Laravel 5中,一切都在App命名空间中,您的控制器在App\Http\Controllers\中。路由是因为命名空间的工作是在RouteServiceProvider设定。

尝试使用action时添加在您的模板命名空间,或使用命名的路线是这样的:

Route::post('/LoginCheck', ['uses' => '[email protected]', 'as' => 'login.check.index']); 

{!! Form::open(['route' => 'login.check.index']) !!} 
+0

对不起,感谢您的帮助,但仍然无法正常工作,或者我不知道如何使用它为参考>< – nlstduio

+0

你更新laravel包? 可以给一个示例代码?在你的终端运行'作曲家update'。而你得到同样的错误还是其他什么东西? – Robert

+0

现在出现跟随联合〜 在compile.php中的RouteCollection-> methodNotAllowed(array('POST'))中的Route_Collection.php行7717_ 行7713 line 7691 at RouteCollection-> match(object(Request))in compiled-php line 6965 at Router-> findRoute(object(Request))in compiled。php line 6937 – nlstduio

相关问题