Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12871064
Registrar.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
937 B
Referenced Files
None
Subscribers
None
Registrar.php
View Options
<?php
namespace
AuthGrove\Services
;
use
AuthGrove\User
;
use
Validator
;
/**
* Trait offering an implementation of Illuminate\Contracts\Auth\Registrar
*/
trait
Registrar
{
/**
* 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
,
[
'username'
=>
'required|max:255|unique:users'
,
'fullname'
=>
'max:255'
,
'email'
=>
'sometimes|required|email|max:255|unique:users'
,
'password'
=>
'required|confirmed|min:8'
,
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return User
*/
public
function
create
(
array
$data
)
{
return
User
::
create
([
'username'
=>
$data
[
'username'
],
'fullname'
=>
$data
[
'fullname'
],
'email'
=>
$data
[
'email'
],
'password'
=>
bcrypt
(
$data
[
'password'
]),
]);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 17, 16:06 (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3168167
Default Alt Text
Registrar.php (937 B)
Attached To
Mode
rGROVE Auth Grove
Attached
Detach File
Event Timeline
Log In to Comment