http://www.jianshu.com/p/fe99f83caa95
https://cs.laravel-china.org/ 速查表
加载JS和CSS
<link href="{{ asset('comm/static/h-ui/css/H-ui.min.css') }}" rel="stylesheet" type="text/css" />
验证码
<img src="{{ url('login/code') }}" onclick="this.src='{{ url('login/code') }}?'+Math.random()">
Login
namespace AppHttpControllersAdmin; use AppHttpControllersController; use IlluminateHttpRequest; require_once './../app/Libs/Captcha/captcha.php'; class LoginController extends Controller { private $request = null; public function __construct(Request $request) { if(empty($this->request)){ $this->request = $request; } } public function login(){ if($this->request->isMethod('post') ){ $data = $this->request->all(); $account = $this->request->input('account',''); } return view('admin.login.login'); } public function code() { $captcha = new Captcha(); $captcha->doimg(); session(['code'=>$captcha->getCode()]); } }