2017-08-24 74 views
5

获取在laravel简单的控制器类错误与下面的代码不允许的方法HTTP异常laravel 5.4

MethodNotAllowedHttpException

namespace App\Http\Controllers; 

use Illuminate\Http\Request; 
use DB; 
use app\Http\Requests; 
use Illuminate\Support\Facades\Auth; 


class ProfileController extends Controller 
{ 


    private $userId; 

    public function __construct() 
    { 
     $this->userId = Auth::id();  
    } 

} 

路线:

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

调用由:<form action="/user_profile" method="post">

+1

份额完整的错误....也分享路线的详细信息。 – Naincy

+0

其完整,没有别的 –

+0

哪种方法?得到? POST? PUT/PATCH?删除?我们需要信息,信息,信息... – delboy1978uk

回答

0

我要运行

php artisan config:clear 
php artisan cache:clear 
php artisan route:clear