Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Console\Commands;
  4.  
  5. use Mail;
  6. use Illuminate\Console\Command;
  7. use Maatwebsite\Excel\Facades\Excel;
  8.  
  9. class DailyWebshopUpdate extends Command
  10. {
  11. protected $signature = 'email:webshoplist';
  12. protected $description = 'This is a test.';
  13.  
  14. public function __construct()
  15. {
  16. parent::__construct();
  17. }
  18.  
  19. public function handle()
  20. {
  21. error_log('FIRED');
  22. $csv = \Excel::download(new \App\Exports\ExportWebshopAll, 'klantenlijst.csv')
  23.  
  24. Mail::send('emails.dailyupdate', [], function($message)
  25. {
  26. $message->to('remco.rol@bickery.nl')->subject('Test')->attach($csv->store("csv", false, true)['full']);
  27. });
  28.  
  29. $this->info('Test has fired.');
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement