-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3675 from ColoredCow/master
Release 2 July
- Loading branch information
Showing
4 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace App\Observers; | ||
|
||
use Carbon\Carbon; | ||
use Modules\HR\Entities\Employee; | ||
use Modules\User\Entities\User; | ||
|
||
class UserObserver | ||
{ | ||
/** | ||
* Handle to the user "created" event. | ||
* | ||
* @param \Modules\User\Entities\User $user | ||
* @return void | ||
*/ | ||
public function created(User $user) | ||
{ | ||
Employee::create([ | ||
'user_id' => $user->id, | ||
'name' => $user->name, | ||
'joined_on' => Carbon::today(), | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters