Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
laravel-adminpanel
Commits
99fe1126
Unverified
Commit
99fe1126
authored
Nov 25, 2017
by
Viral Solani
Committed by
GitHub
Nov 25, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #34 from viralsolani/analysis-z9gJnn
Apply fixes from StyleCI
parents
d31c62e0
ab73d353
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
21 deletions
+22
-21
StoreUserRequest.php
app/Http/Requests/Backend/Access/User/StoreUserRequest.php
+1
-1
UserNeedsConfirmation.php
app/Notifications/Frontend/Auth/UserNeedsConfirmation.php
+1
-1
UserRepository.php
app/Repositories/Backend/Access/User/UserRepository.php
+20
-19
No files found.
app/Http/Requests/Backend/Access/User/StoreUserRequest.php
View file @
99fe1126
...
...
@@ -31,7 +31,7 @@ class StoreUserRequest extends Request
'first_name'
=>
'required|max:255'
,
'last_name'
=>
'required|max:255'
,
'email'
=>
[
'required'
,
'email'
,
'max:255'
,
Rule
::
unique
(
'users'
)],
'password'
=>
'required|min:6|confirmed'
'password'
=>
'required|min:6|confirmed'
,
];
}
...
...
app/Notifications/Frontend/Auth/UserNeedsConfirmation.php
View file @
99fe1126
...
...
@@ -3,8 +3,8 @@
namespace
App\Notifications\Frontend\Auth
;
use
Illuminate\Bus\Queueable
;
use
Illuminate\Notifications\Notification
;
use
Illuminate\Notifications\Messages\MailMessage
;
use
Illuminate\Notifications\Notification
;
/**
* Class UserNeedsConfirmation.
...
...
app/Repositories/Backend/Access/User/UserRepository.php
View file @
99fe1126
...
...
@@ -113,17 +113,16 @@ class UserRepository extends BaseRepository
}
/**
* Create User
* Create User
.
*
* @param Model $request
*
*/
public
function
create
(
$request
)
{
$data
=
$request
->
except
(
'assignees_roles'
,
'permissions'
);
$roles
=
$request
->
all
(
'assignees_roles'
);
$permissions
=
$request
->
all
(
'permissions'
)
?
$request
->
all
(
'permissions'
)
:
[];
$user
=
$this
->
createUserStub
(
$data
);
$data
=
$request
->
except
(
'assignees_roles'
,
'permissions'
);
$roles
=
$request
->
all
(
'assignees_roles'
);
$permissions
=
$request
->
all
(
'permissions'
)
?
$request
->
all
(
'permissions'
)
:
[];
$user
=
$this
->
createUserStub
(
$data
);
DB
::
transaction
(
function
()
use
(
$user
,
$data
,
$roles
,
$permissions
)
{
// Set email type 2
...
...
@@ -143,7 +142,7 @@ class UserRepository extends BaseRepository
$this
->
attachPermissions
(
$permissions
);
//Send confirmation email if requested and account approval is off
if
(
isset
(
$data
[
'confirmation_email'
])
&&
$user
->
confirmed
==
0
)
{
if
(
isset
(
$data
[
'confirmation_email'
])
&&
$user
->
confirmed
==
0
)
{
$user
->
notify
(
new
UserNeedsConfirmation
(
$user
->
confirmation_code
));
}
...
...
@@ -411,28 +410,30 @@ class UserRepository extends BaseRepository
*/
protected
function
createUserStub
(
$input
)
{
$user
=
self
::
MODEL
;
$user
=
new
$user
();
$user
->
first_name
=
$input
[
'first_name'
];
$user
->
last_name
=
$input
[
'last_name'
];
$user
->
email
=
$input
[
'email'
];
$user
->
password
=
bcrypt
(
$input
[
'password'
]);
$user
->
status
=
isset
(
$input
[
'status'
])
?
1
:
0
;
$user
->
confirmation_code
=
md5
(
uniqid
(
mt_rand
(),
true
));
$user
->
confirmed
=
isset
(
$input
[
'confirmed'
])
?
1
:
0
;
$user
->
created_by
=
access
()
->
user
()
->
id
;
$user
=
self
::
MODEL
;
$user
=
new
$user
();
$user
->
first_name
=
$input
[
'first_name'
];
$user
->
last_name
=
$input
[
'last_name'
];
$user
->
email
=
$input
[
'email'
];
$user
->
password
=
bcrypt
(
$input
[
'password'
]);
$user
->
status
=
isset
(
$input
[
'status'
])
?
1
:
0
;
$user
->
confirmation_code
=
md5
(
uniqid
(
mt_rand
(),
true
));
$user
->
confirmed
=
isset
(
$input
[
'confirmed'
])
?
1
:
0
;
$user
->
created_by
=
access
()
->
user
()
->
id
;
return
$user
;
}
/**
* Attach Permission
* Attach Permission
.
*
* @param $permissions
*
* @todo attach permission like role
*
* @return mix
*/
public
function
attachPermissions
(
$value
=
''
)
public
function
attachPermissions
(
$value
=
''
)
{
$arrUserPermissions
=
[];
if
(
isset
(
$permissions
)
&&
count
(
$permissions
)
>
0
)
{
...
...
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