����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.170 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/home/builderbox/././././www/common/Csv/ |
Upload File : |
<?php
namespace Common\Csv;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class CsvExportReadyNotif extends Notification
{
use Queueable;
/**
* @var CsvExport
*/
protected $csvExport;
/**
* @var string
*/
protected $exportName;
public function __construct(CsvExport $csvExport, string $exportName)
{
$this->csvExport = $csvExport;
$this->exportName = $exportName;
}
public function via($notifiable): array
{
return ['mail', 'database'];
}
public function toMail($notifiable): MailMessage
{
return (new MailMessage)
->line($this->primaryLine())
->line(__('This download link will only work if you are logged in as user who has requested the export and it will expire in one day.'))
->action('Download', $this->csvExport->downloadLink());
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable): array
{
return [
'image' => 'export-csv',
'mainAction' => [
'Label' => 'Download',
'action' => $this->csvExport->downloadLink(),
],
'lines' => [
[
'content' => $this->primaryLine(),
],
[
'content' => __('This download link will expire in one day.'),
],
],
];
}
protected function primaryLine(): string
{
return __(':name CSV export you have requested is ready to download.', ['name' => ucfirst($this->exportName)]);
}
}