Hash::make 在 laravel 5.0 控制器中不工作

Hash::make not working in laravel 5.0 Controller

我在 laravel 5.0 上看到错误 http://i.stack.imgur.com/4ZMgZ.png 这是我的控制器代码

<?php namespace App\Http\Controllers;
use Illuminate\Support\Facades\Input;
class DealerController extends Controller {

    public function __construct(){
        //$this->middleware('auth');
    }

    public function login(){
        return view('login');
    }

    public function index() {
        return view('login');

    }
    public function login_auth(){
        $dealer_loginname = Input::get('dealer_loginname');
        $dealer_password = Input::get('dealer_password');
        $dealer_hashed_pass = Hash::make($dealer_password);

    }
}

I Hash::make 在 composer cmd 中工作正常 http://i.stack.imgur.com/SqdYs.jpg 并且它也适用于路由文件

//Route::post('dealerpanel/login_auth','DealerController@login_auth');
Route::post('dealerpanel/login_auth',function (){
    $pass = Hash::make('abc');
    die($pass);
    //y$lSG0Dl3NCJ0ubWIwILzPk.SFGeLmwkw03v3NZ5yMgkg4fAry1Cjc2
});

自从使用命名空间后,您似乎没有导入 Hash

尝试添加

use Hash;

DealerController 文件之上,如

<?php namespace App\Http\Controllers;

    use Illuminate\Support\Facades\Input;
    use Hash;

    class DealerController extends Controller {

    public function __construct(){....

或者直接使用

$pass = \Hash::make('abc');