/app/Laravel/Notifications/WishlistViewer/PermissionGrantedNotification.php
https://bitbucket.org/cityserv/techreportph · PHP · 33 lines · 22 code · 6 blank · 5 comment · 0 complexity · da0266ac2cc985df72719c21c8f8cc98 MD5 · raw file
- <?php
- namespace App\Laravel\Notifications\WishlistViewer;
- use App\Laravel\Models\WishlistViewer;
- use App\Laravel\Notifications\MainNotification;
- use Helper;
- class PermissionGrantedNotification extends MainNotification
- {
- /**
- * Create a new notification instance.
- *
- * @return void
- */
- public function __construct(WishlistViewer $wishlist_viewer)
- {
- $owner = $wishlist_viewer->owner ? $wishlist_viewer->owner->name : '';
- $wishlist = $wishlist_viewer->wishlist ? $wishlist_viewer->wishlist->title : '';
- $thumbnail = $wishlist_viewer->owner ? $wishlist_viewer->owner->getAvatar() : '';
- $data = [
- 'type' => "WISHLIST",
- 'reference_id' => $wishlist_viewer->wishlist_id,
- 'title' => Helper::get_response_message("PERMISSION_GRANTED_NOTIFICATION_TITLE"),
- 'content' => Helper::get_response_message("PERMISSION_GRANTED_NOTIFICATION_CONTENT", ['name' => $owner, 'wishlist' => $wishlist]),
- 'thumbnail' => $thumbnail,
- ];
- $this->setData($data);
- }
- }