-
Notifications
You must be signed in to change notification settings - Fork 0
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 #39 from civictechro/release/0.0.3
Mail templates and pass reseting
- Loading branch information
Showing
44 changed files
with
1,435 additions
and
132 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,28 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Http\Request; | ||
|
||
class HomeController extends Controller | ||
{ | ||
/** | ||
* Create a new controller instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->middleware('auth'); | ||
} | ||
|
||
/** | ||
* Show the application dashboard. | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function index() | ||
{ | ||
return view('home'); | ||
} | ||
} |
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,46 @@ | ||
<?php | ||
|
||
namespace App\Mail; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Mail\Mailable; | ||
use Illuminate\Queue\SerializesModels; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
|
||
class DsuResetPassword extends Mailable | ||
{ | ||
use Queueable, SerializesModels; | ||
|
||
protected $token; | ||
protected $notifiable; | ||
|
||
/** | ||
* Create a new message instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct($token, $notifiable) | ||
{ | ||
$this->token = $token; | ||
$this->notifiable = $notifiable; | ||
} | ||
|
||
/** | ||
* Build the message. | ||
* | ||
* @return $this | ||
*/ | ||
public function build() | ||
{ | ||
return $this->markdown('emails.users.dsuresetpassword', [ | ||
'greeting' => __('mail.greetings.informal') . ' ' . $this->notifiable->name . ',', | ||
'body_message' => __('mail.body.reset_password'), | ||
'level' => 'error', | ||
'actionUrl' => url(config('app.url').route('password.reset', $this->token, false)), | ||
'actionText' => __('mail.buttons.reset_password'), | ||
'salutation' => __('mail.greetings.salutation'), | ||
'signature' => __('mail.greetings.signature_tehnic'), | ||
'subcopy_content' => __('mail.subcopy.reset_password', ['actionText' => __('mail.buttons.reset_password')]), | ||
]); | ||
} | ||
} |
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,58 @@ | ||
<?php | ||
|
||
namespace App\Notifications; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Notifications\Notification; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Notifications\Messages\MailMessage; | ||
use App\Mail\DsuResetPassword as Mailable; | ||
|
||
class DsuResetPassword extends Notification | ||
{ | ||
use Queueable; | ||
|
||
/** | ||
* The password reset token. | ||
* | ||
* @var string | ||
*/ | ||
public $token; | ||
|
||
/** | ||
* Create a notification instance. | ||
* | ||
* @param string $token | ||
* @return void | ||
*/ | ||
public function __construct($token) | ||
{ | ||
$this->token = $token; | ||
} | ||
|
||
/** | ||
* Get the notification's channels. | ||
* | ||
* @param mixed $notifiable | ||
* @return array|string | ||
*/ | ||
public function via($notifiable) | ||
{ | ||
return ['mail']; | ||
} | ||
|
||
/** | ||
* Build the mail representation of the notification. | ||
* | ||
* @param mixed $notifiable | ||
* @return \Illuminate\Notifications\Messages\MailMessage | ||
*/ | ||
public function toMail($notifiable) | ||
{ | ||
$subject = sprintf("[%s] %s", config('app.name'), __('mail.subject.reset_password')); | ||
return (new Mailable($this->token, $notifiable)) | ||
->from('[email protected]', config('app.name')) | ||
->subject($subject) | ||
->to($notifiable->email); | ||
} | ||
} |
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,19 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Authentication Language Lines | ||
|-------------------------------------------------------------------------- | ||
| | ||
| The following language lines are used during authentication for various | ||
| messages that we need to display to the user. You are free to modify | ||
| these language lines according to your application's requirements. | ||
| | ||
*/ | ||
|
||
'failed' => 'These credentials do not match our records.', | ||
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', | ||
|
||
]; |
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,22 @@ | ||
<?php | ||
|
||
return [ | ||
'subject' => [ | ||
'reset_password' => 'Resetarea parolei', | ||
], | ||
'greetings' => [ | ||
'informal' => 'Bună', | ||
'salutation' => 'Toate cele bune,', | ||
'signature_tehnic' => 'Echipa tehnică', | ||
], | ||
'body' => [ | ||
'reset_password' => 'Primești acest e-mail deoarece am primit o solicitare de resetare a parolei pentru contul tău. Dacă nu ai cerut resetarea parolei, atunci poți ignora acest mesaj.', | ||
'rights_reserved' => 'Toate drepturile rezervate', | ||
], | ||
'buttons' => [ | ||
'reset_password' => 'Resetează parola', | ||
], | ||
'subcopy' => [ | ||
'reset_password' => 'Dacă întâmpini probleme la clic pe butonul :actionText, copiază și inserează adresa URL de mai jos în browser-ul tău:', | ||
], | ||
]; |
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,19 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Pagination Language Lines | ||
|-------------------------------------------------------------------------- | ||
| | ||
| The following language lines are used by the paginator library to build | ||
| the simple pagination links. You are free to change them to anything | ||
| you want to customize your views to better match your application. | ||
| | ||
*/ | ||
|
||
'previous' => '« Precedenta', | ||
'next' => 'Următoarea »', | ||
|
||
]; |
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,22 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Password Reset Language Lines | ||
|-------------------------------------------------------------------------- | ||
| | ||
| The following language lines are the default lines which match reasons | ||
| that are given by the password broker for a password update attempt | ||
| has failed, such as for an invalid token or invalid new password. | ||
| | ||
*/ | ||
|
||
'password' => 'Parola trebuie să conțină cel puțin șase caractere și să coincidă cu confirmarea.', | ||
'reset' => 'Parola a fost resetată!', | ||
'sent' => 'Link-ul de resetare a parolei a fost trimis pe email!', | ||
'token' => 'Acest token de resetare a parolei este invalid.', | ||
'user' => "Nu am găsit un utilizator cu această adresă de email.", | ||
|
||
]; |
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,121 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Validation Language Lines | ||
|-------------------------------------------------------------------------- | ||
| | ||
| The following language lines contain the default error messages used by | ||
| the validator class. Some of these rules have multiple versions such | ||
| as the size rules. Feel free to tweak each of these messages here. | ||
| | ||
*/ | ||
|
||
'accepted' => 'The :attribute must be accepted.', | ||
'active_url' => 'The :attribute is not a valid URL.', | ||
'after' => 'The :attribute must be a date after :date.', | ||
'after_or_equal' => 'The :attribute must be a date after or equal to :date.', | ||
'alpha' => 'The :attribute may only contain letters.', | ||
'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', | ||
'alpha_num' => 'The :attribute may only contain letters and numbers.', | ||
'array' => 'The :attribute must be an array.', | ||
'before' => 'The :attribute must be a date before :date.', | ||
'before_or_equal' => 'The :attribute must be a date before or equal to :date.', | ||
'between' => [ | ||
'numeric' => 'The :attribute must be between :min and :max.', | ||
'file' => 'The :attribute must be between :min and :max kilobytes.', | ||
'string' => 'The :attribute must be between :min and :max characters.', | ||
'array' => 'The :attribute must have between :min and :max items.', | ||
], | ||
'boolean' => 'The :attribute field must be true or false.', | ||
'confirmed' => 'Parola și confirmarea acesteia nu coincid.', | ||
'date' => 'The :attribute is not a valid date.', | ||
'date_format' => 'The :attribute does not match the format :format.', | ||
'different' => 'The :attribute and :other must be different.', | ||
'digits' => 'The :attribute must be :digits digits.', | ||
'digits_between' => 'The :attribute must be between :min and :max digits.', | ||
'dimensions' => 'The :attribute has invalid image dimensions.', | ||
'distinct' => 'The :attribute field has a duplicate value.', | ||
'email' => 'Adresa de :attribute trebuie sa fie o adresă validă.', | ||
'exists' => 'The selected :attribute is invalid.', | ||
'file' => 'The :attribute must be a file.', | ||
'filled' => 'The :attribute field must have a value.', | ||
'image' => 'The :attribute must be an image.', | ||
'in' => 'The selected :attribute is invalid.', | ||
'in_array' => 'The :attribute field does not exist in :other.', | ||
'integer' => 'The :attribute must be an integer.', | ||
'ip' => 'The :attribute must be a valid IP address.', | ||
'ipv4' => 'The :attribute must be a valid IPv4 address.', | ||
'ipv6' => 'The :attribute must be a valid IPv6 address.', | ||
'json' => 'The :attribute must be a valid JSON string.', | ||
'max' => [ | ||
'numeric' => 'The :attribute may not be greater than :max.', | ||
'file' => 'The :attribute may not be greater than :max kilobytes.', | ||
'string' => 'The :attribute may not be greater than :max characters.', | ||
'array' => 'The :attribute may not have more than :max items.', | ||
], | ||
'mimes' => 'The :attribute must be a file of type: :values.', | ||
'mimetypes' => 'The :attribute must be a file of type: :values.', | ||
'min' => [ | ||
'numeric' => 'The :attribute must be at least :min.', | ||
'file' => 'The :attribute must be at least :min kilobytes.', | ||
'string' => 'The :attribute must be at least :min characters.', | ||
'array' => 'The :attribute must have at least :min items.', | ||
], | ||
'not_in' => 'The selected :attribute is invalid.', | ||
'numeric' => 'The :attribute must be a number.', | ||
'present' => 'The :attribute field must be present.', | ||
'regex' => 'The :attribute format is invalid.', | ||
'required' => 'The :attribute field is required.', | ||
'required_if' => 'The :attribute field is required when :other is :value.', | ||
'required_unless' => 'The :attribute field is required unless :other is in :values.', | ||
'required_with' => 'The :attribute field is required when :values is present.', | ||
'required_with_all' => 'The :attribute field is required when :values is present.', | ||
'required_without' => 'The :attribute field is required when :values is not present.', | ||
'required_without_all' => 'The :attribute field is required when none of :values are present.', | ||
'same' => 'The :attribute and :other must match.', | ||
'size' => [ | ||
'numeric' => 'The :attribute must be :size.', | ||
'file' => 'The :attribute must be :size kilobytes.', | ||
'string' => 'The :attribute must be :size characters.', | ||
'array' => 'The :attribute must contain :size items.', | ||
], | ||
'string' => 'The :attribute must be a string.', | ||
'timezone' => 'The :attribute must be a valid zone.', | ||
'unique' => 'The :attribute has already been taken.', | ||
'uploaded' => 'The :attribute failed to upload.', | ||
'url' => 'The :attribute format is invalid.', | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Custom Validation Language Lines | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Here you may specify custom validation messages for attributes using the | ||
| convention "attribute.rule" to name the lines. This makes it quick to | ||
| specify a specific custom language line for a given attribute rule. | ||
| | ||
*/ | ||
|
||
'custom' => [ | ||
'attribute-name' => [ | ||
'rule-name' => 'custom-message', | ||
], | ||
], | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Custom Validation Attributes | ||
|-------------------------------------------------------------------------- | ||
| | ||
| The following language lines are used to swap attribute place-holders | ||
| with something more reader friendly such as E-Mail Address instead | ||
| of "email". This simply helps us make messages a little cleaner. | ||
| | ||
*/ | ||
|
||
'attributes' => [], | ||
|
||
]; |
Oops, something went wrong.