आप अपना पासवर्ड रीसेट ईमेल विषय बदल सकते हैं, लेकिन इसे कुछ अतिरिक्त काम की आवश्यकता होगी। सबसे पहले, आपको ResetPassword
अधिसूचना का अपना कार्यान्वयन बनाना होगा। पेस्ट कॉपी-
php artisan make:notification ResetPassword
या आप बस कर सकते हैं:
app\Notifications
निर्देशिका के अंदर एक नई अधिसूचना कक्षा बनाएं, चलो यह ResetPassword.php
नामित करते हैं:
<?php
namespace App\Notifications;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;
class ResetPassword extends Notification
{
public $token;
public function __construct($token)
{
$this->token = $token;
}
public function via($notifiable)
{
return ['mail'];
}
public function toMail($notifiable)
{
return (new MailMessage)
->subject('Your Reset Password Subject Here')
->line('You are receiving this email because we received a password reset request for your account.')
->action('Reset Password', url('password/reset', $this->token))
->line('If you did not request a password reset, no further action is required.');
}
}
तुम भी कारीगर आदेश का उपयोग अधिसूचना टेम्पलेट उत्पन्न कर सकते हैं उपरोक्त कोड। जैसा कि आप देख सकते हैं कि यह अधिसूचना वर्ग डिफ़ॉल्ट Illuminate\Auth\Notifications\ResetPassword
के साथ बहुत समान है। आप वास्तव में इसे डिफ़ॉल्ट ResetPassword
कक्षा से बढ़ा सकते हैं।
फर्क सिर्फ इतना है यहाँ है, आप ईमेल का विषय परिभाषित करने के लिए एक नई विधि कॉल जोड़ें:
return (new MailMessage)
->subject('Your Reset Password Subject Here')
आप Mail Notifications here के बारे में अधिक पढ़ सकते हैं।
दूसरी बात, आपके app\User.php
फ़ाइल पर, आपको Illuminate\Auth\Passwords\CanResetPassword
विशेषता द्वारा परिभाषित डिफ़ॉल्ट sendPasswordResetNotification()
विधि को ओवरराइड करने की आवश्यकता है।
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Notifications\ResetPassword as ResetPasswordNotification;
class User extends Authenticatable
{
use Notifiable;
...
public function sendPasswordResetNotification($token)
{
// Your your own implementation.
$this->notify(new ResetPasswordNotification($token));
}
}
और अब आपके कूटशब्द पुनर्स्थापन ईमेल विषय अद्यतन किया जाना चाहिए: अब आप अपने खुद के ResetPassword
कार्यान्वयन का उपयोग करना चाहिए!
आशा इस मदद!
स्रोत
2016-11-13 13:37:03
और हम शीर्ष पर लिखे गए लैरवेल और लैरवेल के संबंध में कैसे बदल सकते हैं। – Steve
@Steve config/app.php पर जाएं और एप्लिकेशन का नाम बदलें – kniteli