我在 PHP 和 Laravel 中绝对是新手。
我正在开发一个Laravel 控制器类,我已经把这两行
控制台:: info('用户名:' + $ userName); 控制台::信息('密码' + $ pswd);
记录代码中发生的事情。
所以我的整个控制器类是:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\Input;
use function GuzzleHttp\json_encode;
use function GuzzleHttp\json_decode;
use Illuminate\Support\Facades\Artisan;
class LoginBetriviusController extends Controller
{
//------------------------------------------------------------------------------------
//metodo richiamato al caricamento della web application - carica la pagina principale
//------------------------------------------------------------------------------------
public function index(){
return view('login');
}
//------------------------------------------------------------------------------------
//TODO _ implementare chiamata per la LOGIN
//------------------------------------------------------------------------------------
public function doLogin(){
$userName = Input::get('username');
$pswd = Input::get('password');
Console::info('username: ' + $userName);
Console::info('password ' + $pswd);
return view('dashboard-hotel');
}
//------------------------------------------------------------------------------------
//FINE --- implementare chiamata per la LOGIN
//------------------------------------------------------------------------------------
}
问题是当输入此方法时,我在尝试执行第一个 Console :: info 方法时获取以下错误消息:
[Mon Jan 23 17:48:46 2017] PHP Fatal error: Class 'App\Http\Controllers\Console' not found in C:\Users\Andrea\Documents\Betrivius
\WorkSpace\betriviusExtranet\app\Http\Controllers\LoginBetriviusController.php on line 34
为什么呢?我错过了什么?我该如何解决这个问题?