diff --git a/app/Notifications/AuditNotification.php b/app/Notifications/AuditNotification.php index 5629e82f33..900650e975 100644 --- a/app/Notifications/AuditNotification.php +++ b/app/Notifications/AuditNotification.php @@ -29,10 +29,9 @@ class AuditNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { $notifyBy = []; if (Setting::getSettings()->slack_endpoint) { @@ -42,13 +41,13 @@ class AuditNotification extends Notification return $notifyBy; } - public function toSlack($notifiable) + public function toSlack() { return (new SlackMessage) ->success() ->content(class_basename(get_class($this->params['item'])) . " Audited") - ->attachment(function ($attachment) use ($notifiable) { + ->attachment(function ($attachment) { $item = $this->params['item']; $admin_user = $this->params['admin']; $fields = [ @@ -61,27 +60,4 @@ class AuditNotification extends Notification ->fields($fields); }); } - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage - */ - public function toMail($notifiable) - { - - } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/CheckinAccessoryNotification.php b/app/Notifications/CheckinAccessoryNotification.php index f6a8b19e96..2f6b5a5685 100644 --- a/app/Notifications/CheckinAccessoryNotification.php +++ b/app/Notifications/CheckinAccessoryNotification.php @@ -31,7 +31,6 @@ class CheckinAccessoryNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ public function via() @@ -65,14 +64,11 @@ class CheckinAccessoryNotification extends Notification $note = $this->note; $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot' ; - $fields = [ 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', 'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>', ]; - - return (new SlackMessage) ->content(':arrow_down: :keyboard: Accessory Checked In') ->from($botname) @@ -88,10 +84,8 @@ class CheckinAccessoryNotification extends Notification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail() { - - return (new MailMessage)->markdown('notifications.markdown.checkin-accessory', [ 'item' => $this->item, @@ -102,17 +96,4 @@ class CheckinAccessoryNotification extends Notification ->subject('Accessory checked in'); } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/CheckinAssetNotification.php b/app/Notifications/CheckinAssetNotification.php index c203168e08..0b0c29d7b5 100644 --- a/app/Notifications/CheckinAssetNotification.php +++ b/app/Notifications/CheckinAssetNotification.php @@ -39,7 +39,6 @@ class CheckinAssetNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ public function via() @@ -53,7 +52,7 @@ class CheckinAssetNotification extends Notification } /** - * Only send checkin notifications to users if the category + * Only send checkin notifications to users if the category * has the corresponding checkbox checked. */ if ($this->item->checkin_email() && $this->target instanceof User && $this->target->email != '') @@ -78,7 +77,7 @@ class CheckinAssetNotification extends Notification trans('general.status') => $item->assetstatus->name, trans('general.location') => ($item->location) ? $item->location->name : '', ]; - + return (new SlackMessage) ->content(':arrow_down: :computer: Asset Checked In') ->from($botname) @@ -94,13 +93,10 @@ class CheckinAssetNotification extends Notification /** * Get the mail representation of the notification. * - * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail() { - - $fields = []; // Check if the item has custom fields associated with it diff --git a/app/Notifications/CheckinLicenseSeatNotification.php b/app/Notifications/CheckinLicenseSeatNotification.php index f6459bae40..07d5455b13 100644 --- a/app/Notifications/CheckinLicenseSeatNotification.php +++ b/app/Notifications/CheckinLicenseSeatNotification.php @@ -35,10 +35,9 @@ class CheckinLicenseSeatNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { $notifyBy = []; @@ -47,7 +46,7 @@ class CheckinLicenseSeatNotification extends Notification } /** - * Only send checkin notifications to users if the category + * Only send checkin notifications to users if the category * has the corresponding checkbox checked. */ if ($this->item->checkin_email() && $this->target instanceof User && $this->target->email != '') @@ -58,7 +57,7 @@ class CheckinLicenseSeatNotification extends Notification return $notifyBy; } - public function toSlack($notifiable) + public function toSlack() { $target = $this->target; @@ -90,7 +89,7 @@ class CheckinLicenseSeatNotification extends Notification * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail() { return (new MailMessage)->markdown('notifications.markdown.checkin-license', [ @@ -103,16 +102,4 @@ class CheckinLicenseSeatNotification extends Notification } - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/CheckoutAccessoryNotification.php b/app/Notifications/CheckoutAccessoryNotification.php index 2e69856236..2c2001253d 100644 --- a/app/Notifications/CheckoutAccessoryNotification.php +++ b/app/Notifications/CheckoutAccessoryNotification.php @@ -25,7 +25,7 @@ class CheckoutAccessoryNotification extends Notification $this->note = $note; $this->target = $checkedOutTo; $this->acceptance = $acceptance; - + $this->settings = Setting::getSettings(); } @@ -33,10 +33,9 @@ class CheckoutAccessoryNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { $notifyBy = []; @@ -52,7 +51,7 @@ class CheckoutAccessoryNotification extends Notification if ($this->target instanceof User && $this->target->email != '') { /** - * Send an email if the asset requires acceptance, + * Send an email if the asset requires acceptance, * so the user can accept or decline the asset */ if ($this->item->requireAcceptance()) { @@ -71,17 +70,15 @@ class CheckoutAccessoryNotification extends Notification */ if ($this->item->checkin_email()) { $notifyBy[1] = 'mail'; - } + } } return $notifyBy; } - public function toSlack($notifiable) + public function toSlack() { - - $target = $this->target; $admin = $this->admin; $item = $this->item; @@ -93,8 +90,6 @@ class CheckoutAccessoryNotification extends Notification 'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>', ]; - - return (new SlackMessage) ->content(':arrow_up: :keyboard: Accessory Checked Out') ->from($botname) @@ -107,12 +102,10 @@ class CheckoutAccessoryNotification extends Notification /** * Get the mail representation of the notification. * - * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail() { - \Log::debug($this->item->getImageUrl()); $eula = $this->item->getEula(); $req_accept = $this->item->requireAcceptance(); @@ -132,17 +125,4 @@ class CheckoutAccessoryNotification extends Notification ->subject(trans('mail.Confirm_accessory_delivery')); } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/CheckoutAssetNotification.php b/app/Notifications/CheckoutAssetNotification.php index 8c93f08c54..ff759f68ef 100644 --- a/app/Notifications/CheckoutAssetNotification.php +++ b/app/Notifications/CheckoutAssetNotification.php @@ -49,7 +49,6 @@ class CheckoutAssetNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ public function via() @@ -68,7 +67,7 @@ class CheckoutAssetNotification extends Notification if ($this->target instanceof User && $this->target->email != '') { /** - * Send an email if the asset requires acceptance, + * Send an email if the asset requires acceptance, * so the user can accept or decline the asset */ if ($this->item->requireAcceptance()) { @@ -80,14 +79,14 @@ class CheckoutAssetNotification extends Notification */ if ($this->item->getEula()) { $notifyBy[1] = 'mail'; - } + } /** * Send an email if an email should be sent at checkin/checkout */ if ($this->item->checkin_email()) { $notifyBy[1] = 'mail'; - } + } } @@ -160,7 +159,6 @@ class CheckoutAssetNotification extends Notification return $message; - } } diff --git a/app/Notifications/CheckoutConsumableNotification.php b/app/Notifications/CheckoutConsumableNotification.php index a9785677cd..edf970789d 100644 --- a/app/Notifications/CheckoutConsumableNotification.php +++ b/app/Notifications/CheckoutConsumableNotification.php @@ -39,10 +39,9 @@ class CheckoutConsumableNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { $notifyBy = []; @@ -56,7 +55,7 @@ class CheckoutConsumableNotification extends Notification if ($this->target instanceof User && $this->target->email != '') { /** - * Send an email if the asset requires acceptance, + * Send an email if the asset requires acceptance, * so the user can accept or decline the asset */ if ($this->item->requireAcceptance()) { @@ -68,7 +67,7 @@ class CheckoutConsumableNotification extends Notification */ if ($this->item->getEula()) { $notifyBy[1] = 'mail'; - } + } /** * Send an email if an email should be sent at checkin/checkout @@ -77,14 +76,14 @@ class CheckoutConsumableNotification extends Notification if ((method_exists($this->item, 'checkin_email')) && ($this->item->checkin_email())) { $notifyBy[1] = 'mail'; - } + } } return $notifyBy; } - public function toSlack($notifiable) + public function toSlack() { $target = $this->target; $admin = $this->admin; @@ -109,10 +108,9 @@ class CheckoutConsumableNotification extends Notification /** * Get the mail representation of the notification. * - * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail() { \Log::debug($this->item->getImageUrl()); @@ -135,16 +133,4 @@ class CheckoutConsumableNotification extends Notification } - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/CheckoutLicenseSeatNotification.php b/app/Notifications/CheckoutLicenseSeatNotification.php index fd21295210..3ec2c1f9ae 100644 --- a/app/Notifications/CheckoutLicenseSeatNotification.php +++ b/app/Notifications/CheckoutLicenseSeatNotification.php @@ -37,7 +37,6 @@ class CheckoutLicenseSeatNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ public function via() @@ -54,7 +53,7 @@ class CheckoutLicenseSeatNotification extends Notification if ($this->target instanceof User && $this->target->email != '') { /** - * Send an email if the asset requires acceptance, + * Send an email if the asset requires acceptance, * so the user can accept or decline the asset */ if ($this->item->requireAcceptance()) { @@ -66,23 +65,22 @@ class CheckoutLicenseSeatNotification extends Notification */ if ($this->item->getEula()) { $notifyBy[1] = 'mail'; - } + } /** * Send an email if an email should be sent at checkin/checkout */ if ($this->item->checkin_email()) { $notifyBy[1] = 'mail'; - } + } } - + return $notifyBy; } - public function toSlack($notifiable) + public function toSlack() { - $target = $this->target; $admin = $this->admin; $item = $this->item; @@ -106,10 +104,9 @@ class CheckoutLicenseSeatNotification extends Notification /** * Get the mail representation of the notification. * - * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail() { $eula = method_exists($this->item, 'getEula') ? $this->item->getEula() : ''; @@ -131,16 +128,4 @@ class CheckoutLicenseSeatNotification extends Notification } - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/CurrentInventory.php b/app/Notifications/CurrentInventory.php index 3948fe9c0d..d0161aa165 100644 --- a/app/Notifications/CurrentInventory.php +++ b/app/Notifications/CurrentInventory.php @@ -26,7 +26,7 @@ class CurrentInventory extends Notification * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { return ['mail']; } @@ -34,10 +34,9 @@ class CurrentInventory extends Notification /** * Get the mail representation of the notification. * - * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail() { $message = (new MailMessage)->markdown('notifications.markdown.user-inventory', [ @@ -49,17 +48,4 @@ class CurrentInventory extends Notification return $message; } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/ExpectedCheckinAdminNotification.php b/app/Notifications/ExpectedCheckinAdminNotification.php index 743e801d96..c90c2fa3e1 100644 --- a/app/Notifications/ExpectedCheckinAdminNotification.php +++ b/app/Notifications/ExpectedCheckinAdminNotification.php @@ -27,28 +27,21 @@ class ExpectedCheckinAdminNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { $notifyBy = []; $notifyBy[]='mail'; return $notifyBy; } - public function toSlack($notifiable) - { - - } - /** * Get the mail representation of the notification. * - * @param mixed $asset * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($params) + public function toMail() { $message = (new MailMessage)->markdown('notifications.markdown.report-expected-checkins', @@ -62,16 +55,4 @@ class ExpectedCheckinAdminNotification extends Notification } - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/ExpectedCheckinNotification.php b/app/Notifications/ExpectedCheckinNotification.php index 06d5589e90..e7262ae54e 100644 --- a/app/Notifications/ExpectedCheckinNotification.php +++ b/app/Notifications/ExpectedCheckinNotification.php @@ -28,10 +28,9 @@ class ExpectedCheckinNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { $notifyBy = []; $item = $this->params['item']; @@ -40,18 +39,12 @@ class ExpectedCheckinNotification extends Notification return $notifyBy; } - public function toSlack($notifiable) - { - - } - /** * Get the mail representation of the notification. * - * @param mixed $asset * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($params) + public function toMail() { $formatted_due = Carbon::parse($this->params->expected_checkin)->format('D, M j, Y'); return (new MailMessage) @@ -63,20 +56,6 @@ class ExpectedCheckinNotification extends Notification ->line('Serial: '.$this->params->serial) ->line('Asset Tag: '.$this->params->asset_tag) ->action('View Your Assets', route('view-assets')); - - } - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/ExpiringAssetsNotification.php b/app/Notifications/ExpiringAssetsNotification.php index d130d26e27..47d5509259 100644 --- a/app/Notifications/ExpiringAssetsNotification.php +++ b/app/Notifications/ExpiringAssetsNotification.php @@ -28,28 +28,22 @@ class ExpiringAssetsNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { $notifyBy = []; $notifyBy[]='mail'; return $notifyBy; } - public function toSlack($notifiable) - { - - } - /** * Get the mail representation of the notification. * * @param mixed $asset * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($params) + public function toMail() { $message = (new MailMessage)->markdown('notifications.markdown.report-expiring-assets', @@ -64,16 +58,4 @@ class ExpiringAssetsNotification extends Notification } - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/ExpiringLicenseNotification.php b/app/Notifications/ExpiringLicenseNotification.php index fce8ba23ef..5ca1e93cf6 100644 --- a/app/Notifications/ExpiringLicenseNotification.php +++ b/app/Notifications/ExpiringLicenseNotification.php @@ -31,25 +31,20 @@ class ExpiringLicenseNotification extends Notification * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { $notifyBy = []; $notifyBy[]='mail'; return $notifyBy; } - public function toSlack($notifiable) - { - - } - /** * Get the mail representation of the notification. * * @param mixed $asset * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($params) + public function toMail() { $message = (new MailMessage)->markdown('notifications.markdown.report-expiring-licenses', @@ -64,16 +59,4 @@ class ExpiringLicenseNotification extends Notification } - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/FirstAdminNotification.php b/app/Notifications/FirstAdminNotification.php index 951e24e72b..153aff4aec 100644 --- a/app/Notifications/FirstAdminNotification.php +++ b/app/Notifications/FirstAdminNotification.php @@ -30,10 +30,9 @@ class FirstAdminNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { return ['mail']; } @@ -41,26 +40,13 @@ class FirstAdminNotification extends Notification /** * Get the mail representation of the notification. * - * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail() { return (new MailMessage) ->subject(trans('mail.welcome', ['name' => $this->_data['first_name'] . ' ' . $this->_data['last_name'] ])) ->markdown('notifications.FirstAdmin', $this->_data); } - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/InventoryAlert.php b/app/Notifications/InventoryAlert.php index 31b61a13ae..ff88b548c0 100644 --- a/app/Notifications/InventoryAlert.php +++ b/app/Notifications/InventoryAlert.php @@ -28,27 +28,21 @@ class InventoryAlert extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { $notifyBy[] = 'mail'; return $notifyBy; } - public function toSlack($notifiable) - { - } - /** * Get the mail representation of the notification. * - * @param mixed $asset * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($params) + public function toMail() { $message = (new MailMessage)->markdown( 'notifications.markdown.report-low-inventory', @@ -61,17 +55,4 @@ class InventoryAlert extends Notification return $message; } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/MailTest.php b/app/Notifications/MailTest.php index 1e84fab8e9..65a6c63b77 100644 --- a/app/Notifications/MailTest.php +++ b/app/Notifications/MailTest.php @@ -24,10 +24,9 @@ class MailTest extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { return ['mail']; } @@ -35,26 +34,12 @@ class MailTest extends Notification /** * Get the mail representation of the notification. * - * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail() { return (new MailMessage) ->subject(trans('mail.test_email')) ->markdown('notifications.Test'); } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/RequestAssetCancelation.php b/app/Notifications/RequestAssetCancelation.php index 21c565c632..d50aea3529 100644 --- a/app/Notifications/RequestAssetCancelation.php +++ b/app/Notifications/RequestAssetCancelation.php @@ -2,6 +2,7 @@ namespace App\Notifications; +use App\Helpers\Helper; use App\Models\Setting; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\SlackMessage; @@ -27,7 +28,7 @@ class RequestAssetCancelation extends Notification $this->last_checkout = ''; $this->item_quantity = $params['item_quantity']; $this->expected_checkin = ''; - $this->requested_date = \App\Helpers\Helper::getFormattedDateObject($params['requested_date'], 'datetime', + $this->requested_date = Helper::getFormattedDateObject($params['requested_date'], 'datetime', false); $this->settings = Setting::getSettings(); @@ -36,16 +37,14 @@ class RequestAssetCancelation extends Notification } if ($this->item->last_checkout) { - $this->last_checkout = \App\Helpers\Helper::getFormattedDateObject($this->item->last_checkout, 'date', + $this->last_checkout = Helper::getFormattedDateObject($this->item->last_checkout, 'date', false); } if ($this->item->expected_checkin) { - $this->expected_checkin = \App\Helpers\Helper::getFormattedDateObject($this->item->expected_checkin, 'date', + $this->expected_checkin = Helper::getFormattedDateObject($this->item->expected_checkin, 'date', false); } - - } /** @@ -72,8 +71,6 @@ class RequestAssetCancelation extends Notification public function toSlack() { - - $target = $this->target; $item = $this->item; $note = $this->note; @@ -130,8 +127,6 @@ class RequestAssetCancelation extends Notification return $message; - - } } diff --git a/app/Notifications/RequestAssetNotification.php b/app/Notifications/RequestAssetNotification.php index eac2cef22f..8c0c7d8505 100644 --- a/app/Notifications/RequestAssetNotification.php +++ b/app/Notifications/RequestAssetNotification.php @@ -2,6 +2,7 @@ namespace App\Notifications; +use App\Helpers\Helper; use App\Models\Setting; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\SlackMessage; @@ -28,7 +29,7 @@ class RequestAssetNotification extends Notification $this->note = ''; $this->last_checkout = ''; $this->expected_checkin = ''; - $this->requested_date = \App\Helpers\Helper::getFormattedDateObject($params['requested_date'], 'datetime', + $this->requested_date = Helper::getFormattedDateObject($params['requested_date'], 'datetime', false); $this->settings = Setting::getSettings(); @@ -37,12 +38,12 @@ class RequestAssetNotification extends Notification } if ($this->item->last_checkout) { - $this->last_checkout = \App\Helpers\Helper::getFormattedDateObject($this->item->last_checkout, 'date', + $this->last_checkout = Helper::getFormattedDateObject($this->item->last_checkout, 'date', false); } if ($this->item->expected_checkin) { - $this->expected_checkin = \App\Helpers\Helper::getFormattedDateObject($this->item->expected_checkin, 'date', + $this->expected_checkin = Helper::getFormattedDateObject($this->item->expected_checkin, 'date', false); } @@ -73,8 +74,6 @@ class RequestAssetNotification extends Notification public function toSlack() { - - $target = $this->target; $qty = $this->item_quantity; $item = $this->item; @@ -98,7 +97,6 @@ class RequestAssetNotification extends Notification /** * Get the mail representation of the notification. * - * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail() @@ -127,8 +125,6 @@ class RequestAssetNotification extends Notification return $message; - - } } diff --git a/app/Notifications/SendUpcomingAuditNotification.php b/app/Notifications/SendUpcomingAuditNotification.php index 0aaf11cda5..a6863ea8e3 100644 --- a/app/Notifications/SendUpcomingAuditNotification.php +++ b/app/Notifications/SendUpcomingAuditNotification.php @@ -26,10 +26,9 @@ class SendUpcomingAuditNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { return $notifyBy = ['mail']; } @@ -37,10 +36,9 @@ class SendUpcomingAuditNotification extends Notification /** * Get the mail representation of the notification. * - * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail() { $message = (new MailMessage)->markdown('notifications.markdown.upcoming-audits', [ @@ -51,17 +49,4 @@ class SendUpcomingAuditNotification extends Notification return $message; } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/SlackTest.php b/app/Notifications/SlackTest.php index 1d18be86a1..99d37761b8 100644 --- a/app/Notifications/SlackTest.php +++ b/app/Notifications/SlackTest.php @@ -32,26 +32,13 @@ class SlackTest extends Notification return ['slack']; } - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage - */ - public function toMail($notifiable) - { - return [ - // - ]; - } - /** * Get the Slack representation of the notification. * * @param mixed $notifiable * @return SlackMessage */ - public function toSlack($notifiable) + public function toSlack() { $settings = Setting::getSettings(); return (new SlackMessage) @@ -61,17 +48,4 @@ class SlackTest extends Notification ->content('Oh hai! Looks like your Slack integration with Snipe-IT is working!'); } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } } diff --git a/app/Notifications/WelcomeNotification.php b/app/Notifications/WelcomeNotification.php index 0fc3377708..9a98a97734 100644 --- a/app/Notifications/WelcomeNotification.php +++ b/app/Notifications/WelcomeNotification.php @@ -30,10 +30,9 @@ class WelcomeNotification extends Notification /** * Get the notification's delivery channels. * - * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via() { return ['mail']; } @@ -41,26 +40,12 @@ class WelcomeNotification extends Notification /** * Get the mail representation of the notification. * - * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail() { return (new MailMessage) ->subject(trans('mail.welcome', ['name' => $this->_data['first_name'] . ' ' . $this->_data['last_name'] ])) ->markdown('notifications.Welcome', $this->_data); } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } }