PHP code example of cleaniquecoders / laravel-helper
1. Go to this page and download the library: Download cleaniquecoders/laravel-helper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// send by id
notify(1)
->subject('Laravel Helper')
->message('Sending notification via notify helper is awesome.')->send();
// you can send by email, but nd with Subject and Message, CC and BCC
$cc = \App\Models\User::whereIn('id', [2,3,4])->get()->pluck('email')->toArray();
$bcc = \App\Models\User::whereIn('id', [5,6,7])->get()->pluck('email')->toArray();
notify(1)
->subject('Laravel Helper')
->message('Send notification via notify() helper is awesome and easy.')
->cc($cc)
->bcc($bcc)
->send();
// Send Notification with Subject, Message, Link.
notify(1)
->subject('Laravel Helper')
->message('Send notification via notify() helper is awesome and easy.')
->link('https://google.com')
->send();
// Send Notification with Subject, Message, Link and Custom Link Label.
notify(1)
->subject('Laravel Helper')
->message('Send notification via notify() helper is awesome and easy.')
->link('https://google.com')
->link_label('Google')
->send();
// Send Notification with Subject, Message, Link, Custom Link Label and Custom Template.
notify(1)
->subject('Laravel Helper')
->message('Send notification via notify() helper is awesome and easy.')
->link('https://google.com')
->link_label('Google')
->template('mail.custom')
->send();
// Send Notification with Subject, Message, Link, Custom Link Label, Custom Template and Mixed Data.
notify(1)
->subject('Laravel Helper')
->message('Send notification via notify() helper is awesome and easy.')
->link('https://google.com')
->link_label('Google')
->template('mail.custom')
->data($anything)
->send();