Promo Lebaran, Kelas Online CODEPOLITAN Cukup Bayar Setengah Harga KLAIM PROMO

Notifikasi tidak masuk di mailtrap.io

Ditanyakan pada tanggal 24 October 2019 oleh Aji Said Wahyudi Hidayat Edit  Hapus  Tandai Selesai  Tandai 

Route web.php saya:

use App\Notifications\NotifKepala;

Route::get('/', function () {
    $user = Auth::user();
    $user->notify(new NotifKepala("User baru {$user->name}"));
    return view('welcome');
});

NotifKepala.php

<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class NotifKepala extends Notification
{
    use Queueable;

    public $greeting;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct($greeting)
    {
        $this->greeting = $greeting;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)
                    ->line($this->greeting)
                    ->action('Notification Action', url('/'))
                    ->line('Thank you for using our application!');
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            //
        ];
    }
}

.env (udah sesuai dengan akun mailtrap saya)

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=7712c2f5e74f6e
MAIL_PASSWORD=36a42d3f554f9d
MAIL_ENCRYPTION=null
BUAT KOMENTAR

1 JAWABAN / 0 KOMENTAR

User avatar
Hakim Sembiring menjawab pada tanggal 7 January 2020 Jadikan Jawaban Terbaik  Edit  Hapus  Ubah ke Komentar 

coba drivernya log dlu kak. berhasil gak muncul dilog pada saat trigger event dipanggil?

BUAT KOMENTAR