Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
pad-upe
Commits
10fd7287
"resources/views/components/buttons/btn-download.blade.php" did not exist on "dd258fba734c4a67cbaf4b3d217daa9f0b6865d1"
Commit
10fd7287
authored
Feb 03, 2023
by
alissonalbuquerque
Browse files
Enviar Email de Recuperação de Senha
parent
21c644e5
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/Auth/NewPasswordController.php
View file @
10fd7287
...
@@ -33,11 +33,22 @@ class NewPasswordController extends Controller
...
@@ -33,11 +33,22 @@ class NewPasswordController extends Controller
*/
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
$request
->
validate
([
$request
->
validate
(
[
'token'
=>
[
'required'
],
'token'
=>
[
'required'
],
'email'
=>
[
'required'
,
'email'
],
'email'
=>
[
'required'
,
'email'
],
'password'
=>
[
'required'
,
'confirmed'
,
Rules\Password
::
defaults
()],
'password'
=>
[
'required'
,
'min:8'
,
'max:255'
,
'confirmed'
],
]);
],
[
'email.email'
=>
'O "E-mail" deve ser um e-mail válido.'
,
'email.required'
=>
'O "E-mail" é um campo obrigatório.'
,
'password.required'
=>
'A "Nova Senha" é obrigatória!'
,
'password.min'
=>
'A "Nova Senha" deve contér no minímo 8 caracteres!'
,
'password.max'
=>
'A campo "Nova Senha" deve contér no máximo 255 caracteres!'
,
'password.confirmed'
=>
'As senhas devem ser iguais!'
,
]
);
// Here we will attempt to reset the user's password. If it is successful we
// Here we will attempt to reset the user's password. If it is successful we
// will update the password on an actual user model and persist it to the
// will update the password on an actual user model and persist it to the
...
...
app/Http/Controllers/Auth/PasswordResetLinkController.php
View file @
10fd7287
...
@@ -28,9 +28,15 @@ class PasswordResetLinkController extends Controller
...
@@ -28,9 +28,15 @@ class PasswordResetLinkController extends Controller
*/
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
$request
->
validate
([
$request
->
validate
(
[
'email'
=>
[
'required'
,
'email'
],
'email'
=>
[
'required'
,
'email'
],
]);
],
[
'email.email'
=>
'O "E-mail" deve ser um e-mail válido.'
,
'email.required'
=>
'O "E-mail" é um campo obrigatório.'
,
]
);
// We will send the password reset link to this user. Once we have attempted
// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// to send the link, we will examine the response then see the message we
...
@@ -40,7 +46,7 @@ class PasswordResetLinkController extends Controller
...
@@ -40,7 +46,7 @@ class PasswordResetLinkController extends Controller
);
);
return
$status
==
Password
::
RESET_LINK_SENT
return
$status
==
Password
::
RESET_LINK_SENT
?
back
()
->
with
(
's
tatus'
,
__
(
$status
)
)
?
back
()
->
with
(
's
uccess'
,
'Enviamos seu link de redefinição de senha por e-mail! Verifique a sua inbox!'
)
:
back
()
->
withInput
(
$request
->
only
(
'email'
))
:
back
()
->
withInput
(
$request
->
only
(
'email'
))
->
withErrors
([
'email'
=>
__
(
$status
)]);
->
withErrors
([
'email'
=>
__
(
$status
)]);
}
}
...
...
app/Http/Controllers/UserController.php
View file @
10fd7287
...
@@ -78,6 +78,7 @@ class UserController extends Controller
...
@@ -78,6 +78,7 @@ class UserController extends Controller
return
view
(
'users.create'
,
[
return
view
(
'users.create'
,
[
'menu'
=>
Menu
::
USERS
,
'menu'
=>
Menu
::
USERS
,
'model'
=>
$model
,
'model'
=>
$model
,
'tab'
=>
'user'
,
]);
]);
}
}
...
@@ -118,14 +119,14 @@ class UserController extends Controller
...
@@ -118,14 +119,14 @@ class UserController extends Controller
Session
::
flash
(
'warning'
,
'Não existem papeis cadastrados para esse usuário!'
);
Session
::
flash
(
'warning'
,
'Não existem papeis cadastrados para esse usuário!'
);
}
}
$tab
_active
=
$request
->
query
(
'tab
_active
'
)
??
'user'
;
$tab
=
$request
->
query
(
'tab'
)
??
'user'
;
return
view
(
'users.update'
,
[
return
view
(
'users.update'
,
[
'menu'
=>
Menu
::
USERS
,
'menu'
=>
Menu
::
USERS
,
'model'
=>
$model
,
'model'
=>
$model
,
'status'
=>
$status
,
'status'
=>
$status
,
'profiles'
=>
$profiles
,
'profiles'
=>
$profiles
,
'tab
_active
'
=>
$tab
_active
'tab'
=>
$tab
]);
]);
}
}
...
...
app/Providers/AuthServiceProvider.php
View file @
10fd7287
...
@@ -2,7 +2,9 @@
...
@@ -2,7 +2,9 @@
namespace
App\Providers
;
namespace
App\Providers
;
use
Illuminate\Auth\Notifications\ResetPassword
;
use
Illuminate\Foundation\Support\Providers\AuthServiceProvider
as
ServiceProvider
;
use
Illuminate\Foundation\Support\Providers\AuthServiceProvider
as
ServiceProvider
;
use
Illuminate\Notifications\Messages\MailMessage
;
use
Illuminate\Support\Facades\Gate
;
use
Illuminate\Support\Facades\Gate
;
class
AuthServiceProvider
extends
ServiceProvider
class
AuthServiceProvider
extends
ServiceProvider
...
@@ -25,6 +27,22 @@ class AuthServiceProvider extends ServiceProvider
...
@@ -25,6 +27,22 @@ class AuthServiceProvider extends ServiceProvider
{
{
$this
->
registerPolicies
();
$this
->
registerPolicies
();
//
ResetPassword
::
toMailUsing
(
function
(
$notifiable
,
$url
)
{
$minutes
=
config
(
'auth.passwords.'
.
config
(
'auth.defaults.passwords'
)
.
'.expire'
);
$url
=
url
(
route
(
'password.reset'
,
[
'token'
=>
$url
,
'email'
=>
$notifiable
->
getEmailForPasswordReset
()
]),
false
);
return
(
new
MailMessage
)
->
subject
(
'Notificação de redefinição de senha'
)
->
line
(
'Você está recebendo este e-mail porque recebemos uma solicitação de redefinição de senha para sua conta.'
)
->
action
(
'Redefinir senha'
,
$url
)
->
line
(
'Este link de redefinição de senha expirará em '
.
$minutes
.
' minutos.'
)
->
line
(
'Se você não solicitou uma redefinição de senha, nenhuma outra ação será necessária'
);
});
}
}
}
}
composer.lock
View file @
10fd7287
This diff is collapsed.
Click to expand it.
resources/views/auth/forgot-password.blade.php
View file @
10fd7287
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
<!--
Validation
Errors
-->
<!--
Validation
Errors
-->
<
x
-
auth
-
validation
-
errors
class
=
"alert alert-danger mb-2"
:
errors
=
"
$errors
"
/>
<
x
-
auth
-
validation
-
errors
class
=
"alert alert-danger mb-2"
:
errors
=
"
$errors
"
/>
@
include
(
'components.alerts'
)
<
div
class
=
"signin-form d-md-flex"
>
<
div
class
=
"signin-form d-md-flex"
>
@
csrf
@
csrf
...
@@ -26,11 +28,6 @@
...
@@ -26,11 +28,6 @@
<
h4
class
=
"mb-4"
>
Redefinir
senha
</
h4
>
<
h4
class
=
"mb-4"
>
Redefinir
senha
</
h4
>
</
div
>
</
div
>
<!--
Session
Status
-->
<
x
-
auth
-
session
-
status
class
=
"mb-4"
:
status
=
"session('status')"
/>
<!--
Validation
Errors
-->
<
x
-
auth
-
validation
-
errors
class
=
"mb-4"
:
errors
=
"
$errors
"
/>
<
form
method
=
"POST"
action
=
"{{ route('password.email') }}"
>
<
form
method
=
"POST"
action
=
"{{ route('password.email') }}"
>
@
csrf
@
csrf
<!--
Email
Address
-->
<!--
Email
Address
-->
...
...
resources/views/auth/passwords/confirm.blade.php
0 → 100644
View file @
10fd7287
resources/views/auth/passwords/email.blade.php
0 → 100644
View file @
10fd7287
resources/views/auth/passwords/reset.blade.php
0 → 100644
View file @
10fd7287
resources/views/auth/reset-password.blade.php
View file @
10fd7287
...
@@ -14,11 +14,6 @@
...
@@ -14,11 +14,6 @@
<
h4
class
=
"mb-4"
>
Redefinir
senha
</
h4
>
<
h4
class
=
"mb-4"
>
Redefinir
senha
</
h4
>
</
div
>
</
div
>
<!--
Session
Status
-->
<
x
-
auth
-
session
-
status
class
=
"mb-4"
:
status
=
"session('status')"
/>
<!--
Validation
Errors
-->
<
x
-
auth
-
validation
-
errors
class
=
"mb-4"
:
errors
=
"
$errors
"
/>
<
form
method
=
"POST"
action
=
"{{ route('password.update') }}"
>
<
form
method
=
"POST"
action
=
"{{ route('password.update') }}"
>
@
csrf
@
csrf
<!--
Password
Reset
Token
-->
<!--
Password
Reset
Token
-->
...
@@ -34,14 +29,14 @@
...
@@ -34,14 +29,14 @@
<!--
Password
-->
<!--
Password
-->
<
div
class
=
"form-group mt-3"
>
<
div
class
=
"form-group mt-3"
>
<
x
-
label
for
=
"password"
:
value
=
"__('
Password
')"
/>
<
x
-
label
for
=
"password"
:
value
=
"__('
Nova Senha
')"
/>
<
x
-
input
id
=
"password"
class
=
"form-control"
type
=
"password"
name
=
"password"
required
/>
<
x
-
input
id
=
"password"
class
=
"form-control"
type
=
"password"
name
=
"password"
required
/>
</
div
>
</
div
>
<!--
Confirm
Password
-->
<!--
Confirm
Password
-->
<
div
class
=
"form-group mt-3"
>
<
div
class
=
"form-group mt-3"
>
<
x
-
label
for
=
"password_confirmation"
:
value
=
"__('Confirm
Password
')"
/>
<
x
-
label
for
=
"password_confirmation"
:
value
=
"__('Confirm
ar Senha
')"
/>
<
x
-
input
id
=
"password_confirmation"
class
=
"form-control"
type
=
"password"
<
x
-
input
id
=
"password_confirmation"
class
=
"form-control"
type
=
"password"
name
=
"password_confirmation"
required
/>
name
=
"password_confirmation"
required
/>
...
...
resources/views/users/_form.blade.php
View file @
10fd7287
@
php
@
php
if
(
$tab_active
==
'user'
)
$userTabActive
=
''
;
{
$userContainerActive
=
''
;
$userTabActive
=
'active'
;
$userContainerActive
=
'show active'
;
$paperTabActive
=
''
;
$paperTabActive
=
''
;
$paperContainerActive
=
''
;
$paperContainerActive
=
''
;
}
if
(
$tab
_active
==
'
pap
er'
)
if
(
$tab
==
'
us
er'
)
{
{
$userTabActive
=
''
;
$userTabActive
=
'active'
;
$userContainerActive
=
''
;
$userContainerActive
=
'show active'
;
}
if
(
$tab
==
'paper'
)
{
$paperTabActive
=
'active'
;
$paperTabActive
=
'active'
;
$paperContainerActive
=
'show active'
;
$paperContainerActive
=
'show active'
;
}
}
...
...
resources/views/users/create.blade.php
View file @
10fd7287
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
@
include
(
'users._form'
,
[
@
include
(
'users._form'
,
[
'action'
=>
route
(
'user_store'
),
'action'
=>
route
(
'user_store'
),
'model'
=>
$model
,
'model'
=>
$model
,
'tab'
=>
$tab
])
])
</
div
>
</
div
>
...
...
resources/views/users/update.blade.php
View file @
10fd7287
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
'model'
=>
$model
,
'model'
=>
$model
,
'status'
=>
$status
,
'status'
=>
$status
,
'profiles'
=>
$profiles
,
'profiles'
=>
$profiles
,
'tab
_active
'
=>
$tab
_active
,
'tab'
=>
$tab
,
])
])
@
include
(
'components.modal'
,
[
@
include
(
'components.modal'
,
[
...
...
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