| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace App\Notifications;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Notifications\Messages\MailMessage;
- use Illuminate\Notifications\Notification;
- use NotificationChannels\Twitter\TwitterChannel;
- use NotificationChannels\Twitter\TwitterStatusUpdate;
- class TwitterPost extends Notification
- {
- use Queueable;
- /**
- * Create a new notification instance.
- *
- * @return void
- */
- public function __construct()
- {
- //
- }
- /**
- * Get the notification's delivery channels.
- *
- * @param mixed $notifiable
- * @return array
- */
- public function via($notifiable)
- {
- return [TwitterChannel::class];
- // 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('The introduction to the notification.')
- ->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 [
- //
- ];
- }
- public function toTwitter($notifiable)
- {
- $text = "Calcio a 5 Anteprima - " . $notifiable->title . " " . url(env('APP_URL') . "/" . $notifiable->slug);
- return new TwitterStatusUpdate($text);//->withImage('marcel.png');
- }
- }
|