mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Add referral codes to user models
This commit is contained in:
parent
f87547a603
commit
aff180deef
@ -12,6 +12,7 @@
|
||||
namespace App\Factory;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class UserFactory
|
||||
{
|
||||
@ -29,6 +30,7 @@ class UserFactory
|
||||
$user->signature = '';
|
||||
$user->theme_id = 0;
|
||||
$user->user_logged_in_notification = true;
|
||||
$user->referral_code = Str::lower(Str::random(32));
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ use App\Models\User;
|
||||
use App\Utils\Ninja;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class CreateUser
|
||||
{
|
||||
@ -62,6 +63,7 @@ class CreateUser
|
||||
$user->fill($this->request);
|
||||
$user->email = $this->request['email']; //todo need to remove this in production
|
||||
$user->last_login = now();
|
||||
$user->referral_code = Str::lower(Str::random(32));
|
||||
$user->ip = request()->ip();
|
||||
|
||||
if (Ninja::isSelfHost()) {
|
||||
|
Loading…
Reference in New Issue
Block a user