我有Laravel問題,becouse它沒有找到我的路線: 看錯誤:Laravel:方法不存在
(1/1) BadMethodCallException
Method [sendEmail] does not exist.
我的路線 「web.php」:
Route::get('/', function() {
return view('index');
});
Route::get('/studio', '[email protected]');
Route::get('/studio/contratos', '[email protected]');
Route::get('/studio/agenda', '[email protected]');
Route::get('/studio/clientes', '[email protected]');
Route::get('/studio/ensaios', '[email protected]');
Route::get('/home', '[email protected]')->name('home');
Route::get('/email/{id}', '[email protected]');
我控制器「UserController.php」:
<?php
namespace App\Http\Controllers;
use Mail;
use App\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class UserController extends Controller
{
public function sendEmail(Request $request, $id)
{
$user = User::findOrFail($id);
Mail::send('emails.reminder', ['user' => $user], function ($m) use ($user) {
$m->from('[email protected]', 'a Your Application');
$m->to($user->email, $user->name)->subject('Your Reminder!');
});
}
}
一個奇怪的事情是,它工作在本地服務器上,但是當我把它上傳我ñ直播服務器,我有這樣的錯誤://
謝謝你們
錯誤?圖片:
你能告訴我們從您正在訪問該路由的代碼? –
從URL訪問 - >'www.photobooker.com.br/email/1' 我有一個ID爲1的用戶 – Hermus
這似乎沒關係。你確定你在現場環境中推動了代碼嗎? –