라라벨 AuthController.php

(라라벨 AuthController에서 넘어옴)

1 개요[ | ]

라라벨 AuthController

AuthenticatesUsers <|-- RedirectsUsers RegistersUsers <|-- RedirectsUsers AuthenticatesAndRegistersUsers <|-- AuthenticatesUsers AuthenticatesAndRegistersUsers <|-- RegistersUsers AuthController <|-- AuthenticatesAndRegistersUsers AuthController <|-- ThrottlesLogins

2 소스 코드[ | ]

<?php

namespace App\Http\Controllers\Auth;

use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;

class AuthController extends Controller
{
    use AuthenticatesAndRegistersUsers, ThrottlesLogins;
    protected $redirectTo = '/';

    public function __construct()
    {
        $this->middleware($this->guestMiddleware(), ['except' => 'logout']);
    }

    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'password' => 'required|min:6|confirmed',
        ]);
    }

    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
        ]);
    }
}

3 관련 route[ | ]

메소드 URI 액션 구현부
GET/HEAD login AuthController@showLoginForm 라라벨 AuthenticatesUsers.php
POST login AuthController@login 라라벨 AuthenticatesUsers.php
GET/HEAD logout AuthController@logout 라라벨 AuthenticatesUsers.php
GET/HEAD register AuthController@showRegistrationForm 라라벨 RegistersUsers.php
POST register AuthController@register 라라벨 RegistersUsers.php

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}