Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
d5f285ba
Commit
d5f285ba
authored
Feb 17, 2015
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify authentication. Remove service.
parent
d75ed338
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
85 deletions
+1
-85
AuthController.php
app/Http/Controllers/Auth/AuthController.php
+0
-38
AppServiceProvider.php
app/Providers/AppServiceProvider.php
+1
-8
Registrar.php
app/Services/Registrar.php
+0
-39
No files found.
app/Http/Controllers/Auth/AuthController.php
deleted
100644 → 0
View file @
d75ed338
<?php
namespace
App\Http\Controllers\Auth
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Contracts\Auth\Guard
;
use
Illuminate\Contracts\Auth\Registrar
;
use
Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers
;
class
AuthController
extends
Controller
{
/*
|--------------------------------------------------------------------------
| Registration & Login Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users, as well as the
| authentication of existing users. By default, this controller uses
| a simple trait to add these behaviors. Why don't you explore it?
|
*/
use
AuthenticatesAndRegistersUsers
;
/**
* Create a new authentication controller instance.
*
* @param \Illuminate\Contracts\Auth\Guard $auth
* @param \Illuminate\Contracts\Auth\Registrar $registrar
* @return void
*/
public
function
__construct
(
Guard
$auth
,
Registrar
$registrar
)
{
$this
->
auth
=
$auth
;
$this
->
registrar
=
$registrar
;
$this
->
middleware
(
'guest'
,
[
'except'
=>
'getLogout'
]);
}
}
app/Providers/AppServiceProvider.php
View file @
d5f285ba
...
...
@@ -17,18 +17,11 @@ class AppServiceProvider extends ServiceProvider {
/**
* Register any application services.
*
* This service provider is a great spot to register your various container
* bindings with the application. As you can see, we are registering our
* "Registrar" implementation here. You can add your own bindings too!
*
* @return void
*/
public
function
register
()
{
$this
->
app
->
bind
(
'Illuminate\Contracts\Auth\Registrar'
,
'App\Services\Registrar'
);
//
}
}
app/Services/Registrar.php
deleted
100644 → 0
View file @
d75ed338
<?php
namespace
App\Services
;
use
App\User
;
use
Validator
;
use
Illuminate\Contracts\Auth\Registrar
as
RegistrarContract
;
class
Registrar
implements
RegistrarContract
{
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
public
function
validator
(
array
$data
)
{
return
Validator
::
make
(
$data
,
[
'name'
=>
'required|max:255'
,
'email'
=>
'required|email|max:255|unique:users'
,
'password'
=>
'required|confirmed|min:6'
,
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return User
*/
public
function
create
(
array
$data
)
{
return
User
::
create
([
'name'
=>
$data
[
'name'
],
'email'
=>
$data
[
'email'
],
'password'
=>
bcrypt
(
$data
[
'password'
]),
]);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment