Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
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
Platform
Commits
57e2caaa
Unverified
Commit
57e2caaa
authored
Sep 16, 2016
by
Micheal Mand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add updating event that fires before saving
Signed-off-by:
Micheal Mand
<
micheal@kmdwebdesigns.com
>
parent
f89d9277
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
UserIsUpdating.php
Modules/User/Events/UserIsUpdating.php
+13
-0
SentinelUserRepository.php
...les/User/Repositories/Sentinel/SentinelUserRepository.php
+9
-1
No files found.
Modules/User/Events/UserIsUpdating.php
0 → 100644
View file @
57e2caaa
<?php
namespace
Modules\User\Events
;
class
UserIsUpdating
{
public
$user
;
public
function
__construct
(
$user
)
{
$this
->
user
=
$user
;
}
}
Modules/User/Repositories/Sentinel/SentinelUserRepository.php
View file @
57e2caaa
...
@@ -7,6 +7,7 @@ use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
...
@@ -7,6 +7,7 @@ use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use
Illuminate\Support\Facades\Hash
;
use
Illuminate\Support\Facades\Hash
;
use
Modules\User\Entities\Sentinel\User
;
use
Modules\User\Entities\Sentinel\User
;
use
Modules\User\Events\UserHasRegistered
;
use
Modules\User\Events\UserHasRegistered
;
use
Modules\User\Events\UserIsUpdating
;
use
Modules\User\Events\UserWasCreated
;
use
Modules\User\Events\UserWasCreated
;
use
Modules\User\Events\UserWasUpdated
;
use
Modules\User\Events\UserWasUpdated
;
use
Modules\User\Exceptions\UserNotFoundException
;
use
Modules\User\Exceptions\UserNotFoundException
;
...
@@ -120,7 +121,11 @@ class SentinelUserRepository implements UserRepository
...
@@ -120,7 +121,11 @@ class SentinelUserRepository implements UserRepository
*/
*/
public
function
update
(
$user
,
$data
)
public
function
update
(
$user
,
$data
)
{
{
$user
->
update
(
$data
);
$user
->
fill
(
$data
);
event
(
new
UserIsUpdating
(
$user
));
$user
->
save
();
event
(
new
UserWasUpdated
(
$user
));
event
(
new
UserWasUpdated
(
$user
));
...
@@ -143,6 +148,9 @@ class SentinelUserRepository implements UserRepository
...
@@ -143,6 +148,9 @@ class SentinelUserRepository implements UserRepository
$this
->
checkForManualActivation
(
$user
,
$data
);
$this
->
checkForManualActivation
(
$user
,
$data
);
$user
=
$user
->
fill
(
$data
);
$user
=
$user
->
fill
(
$data
);
event
(
new
UserIsUpdating
(
$user
));
$user
->
save
();
$user
->
save
();
event
(
new
UserWasUpdated
(
$user
));
event
(
new
UserWasUpdated
(
$user
));
...
...
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