Laravel笔记

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 App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

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()]);
    }
}

 

posted @ 2017-09-19 10:38  FinnYY  阅读(152)  评论(0编辑  收藏  举报