| @ -0,0 +1,29 @@ | |||
| <?php | |||
| namespace App\Events; | |||
| use App\User; | |||
| use Illuminate\Queue\SerializesModels; | |||
| class UserCreating | |||
| { | |||
| use SerializesModels; | |||
| /** | |||
| * The user being created. | |||
| * | |||
| * @var \App\User | |||
| */ | |||
| public $user; | |||
| /** | |||
| * Create a new event instance. | |||
| * | |||
| * @param \App\User $user | |||
| * @return void | |||
| */ | |||
| public function __construct(User $user) | |||
| { | |||
| $this->user = $user; | |||
| } | |||
| } | |||
| @ -0,0 +1,37 @@ | |||
| <?php | |||
| namespace App\Listeners; | |||
| use App\Events\UserCreating; | |||
| use App\Mail\UserPassword; | |||
| use Illuminate\Contracts\Queue\ShouldQueue; | |||
| use Illuminate\Queue\InteractsWithQueue; | |||
| use Illuminate\Support\Facades\Hash; | |||
| use Illuminate\Support\Facades\Mail; | |||
| use Illuminate\Support\Str; | |||
| class SendUserPasswordEmail | |||
| { | |||
| /** | |||
| * Create the event listener. | |||
| * | |||
| * @return void | |||
| */ | |||
| public function __construct() | |||
| { | |||
| // | |||
| } | |||
| /** | |||
| * Handle the event. | |||
| * | |||
| * @param \App\Events\UserCreating $event | |||
| * @return void | |||
| */ | |||
| public function handle(UserCreating $event) | |||
| { | |||
| $password = Str::random(config('auth.password_requirements.users.min_length')); | |||
| $event->user->password = Hash::make($password); | |||
| Mail::to($event->user)->send(new UserPassword($event->user, $password)); | |||
| } | |||
| } | |||
| @ -0,0 +1,50 @@ | |||
| <?php | |||
| namespace App\Mail; | |||
| use App\User; | |||
| use Illuminate\Bus\Queueable; | |||
| use Illuminate\Contracts\Queue\ShouldQueue; | |||
| use Illuminate\Mail\Mailable; | |||
| use Illuminate\Queue\SerializesModels; | |||
| class UserPassword extends Mailable | |||
| { | |||
| use Queueable, SerializesModels; | |||
| /** | |||
| * The user instance. | |||
| * | |||
| * @var \App\User | |||
| */ | |||
| public $user; | |||
| /** | |||
| * The user password. | |||
| * | |||
| * @var string | |||
| */ | |||
| public $password; | |||
| /** | |||
| * Create a new message instance. | |||
| * | |||
| * @return void | |||
| */ | |||
| public function __construct(User $user, string $password) | |||
| { | |||
| $this->user = $user; | |||
| $this->password = $password; | |||
| } | |||
| /** | |||
| * Build the message. | |||
| * | |||
| * @return $this | |||
| */ | |||
| public function build() | |||
| { | |||
| return $this->subject(__('Seu cadastro em ') . config('app.name')) | |||
| ->markdown('emails.users.password'); | |||
| } | |||
| } | |||
| @ -0,0 +1,30 @@ | |||
| <?php | |||
| namespace App; | |||
| use Illuminate\Database\Eloquent\Model; | |||
| use Sushi\Sushi; | |||
| class UserCategory extends Model | |||
| { | |||
| use Sushi; | |||
| protected $rows = [ | |||
| [ | |||
| 'key' => 'individual', | |||
| 'name' => 'Associado Indivíduo', | |||
| ], | |||
| [ | |||
| 'key' => 'company', | |||
| 'name' => 'Associada Empresa Apoiadora', | |||
| ], | |||
| [ | |||
| 'key' => 'acting-institution', | |||
| 'name' => 'Associada Instituição Atuante', | |||
| ], | |||
| [ | |||
| 'key' => 'supporting-institution', | |||
| 'name' => 'Associada Instituição Apoiadora', | |||
| ], | |||
| ]; | |||
| } | |||
| @ -0,0 +1,5 @@ | |||
| <?php | |||
| return [ | |||
| 'individual' => 'Associado Indivíduo', | |||
| ]; | |||
| @ -0,0 +1,8 @@ | |||
| <?php | |||
| return [ | |||
| 'attributes' => [ | |||
| 'name' => 'Nome', | |||
| 'email' => 'E-mail', | |||
| ], | |||
| ]; | |||
| @ -1,8 +0,0 @@ | |||
| @extends('layouts.auth') | |||
| @section('title', 'Create a new account') | |||
| @section('content') | |||
| <div> | |||
| @livewire('auth.register') | |||
| </div> | |||
| @endsection | |||
| @ -0,0 +1,8 @@ | |||
| @extends('layouts.auth') | |||
| @section('title', __('user_categories.individual')) | |||
| @section('content') | |||
| <div> | |||
| @livewire('auth.register.individual') | |||
| </div> | |||
| @endsection | |||
| @ -0,0 +1,23 @@ | |||
| @component('mail::message') | |||
| {{ __('Olá') }}! | |||
| {{ __('Você acabou de se registrar em ') }} {{ config('app.name', 'Laravel') }}. {{ __('Sua senha é') }}: | |||
| @component('mail::panel') | |||
| **{{ $password }}** | |||
| @endcomponent | |||
| @component('mail::button', ['url' => route('login') ]) | |||
| {{ __('Fazer login') }} | |||
| @endcomponent | |||
| {{ __('Obrigado,') }} | |||
| {{ __('Equipe') }} {{ config('app.name') }} | |||
| @component('mail::footer') | |||
| {{ __('Se o botão acima não funcionar, copie e cole a URL a seguir em seu navegador:') }} {{ route('login') }} | |||
| @endcomponent | |||
| @endcomponent | |||