Laravel 5.4の新しいインストールでは、単純なコントローラ、ルート、およびビューをセットアップしました。ここで(1/1)LaravelのBadMethodCallException 5.4
は私のweb.phpです:
<?php
use App\Task;
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function() {
return view('welcome');
});
Route::get('profile', '[email protected]');
マイUserController.php:
<?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
class UserController extends Controller
{
public function profile()
{
return view('profile');
}
}
マイビューファイルはprofile.blade.phpで、1つの文字列のみが存在し、 "こんにちは、世界は!"
アクセスしようとしたとき:。。 。 /プロファイルは、私が間違って何をやっている
(1/1) BadMethodCallException Method [profile] does not exist. in Controller.php (line 82) at Controller->__call('profile', array()) at UserController->profile() at call_user_func_array(array(object(UserController), 'profile'), array()) in Controller.php (line 55)
を取得しますか?助けてください理解するために助けてください
他のフォルダを作成してコントローラを保持しましたか?http/Cotrollers内。 – molagbal
@molagbalいいえ私は追加のフォルダを作成していません –