Skip to content

Commit

Permalink
Merge pull request #41 from mikebarlow/develop
Browse files Browse the repository at this point in the history
V2.1.0
  • Loading branch information
mikebarlow authored Sep 11, 2024
2 parents d612386 + 14398cb commit 9d15c55
Show file tree
Hide file tree
Showing 28 changed files with 5,205 additions and 3,888 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-20.04]
php: ['8.1', '8.2']
php: ['8.1', '8.2', '8.3']

name: P${{ matrix.php }}
steps:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [2.1.0] - 2024-09-11

* Moved SVG icons into anonymous components for easier reuse / overwriting.[PR#35](https://github.com/mikebarlow/megaphone/pull/35)
* Reworked notification type templates into components. [PR#35](https://github.com/mikebarlow/megaphone/pull/35)
* Added "mark all as read" feature for unread notifications. [PR#37](https://github.com/mikebarlow/megaphone/pull/37)
* Added support for `wire:poll` to give the impression of a live component. [PR#38](https://github.com/mikebarlow/megaphone/pull/38)
* Added `@megaphoneStyles` blade directive + improved default styles. [PR#39](https://github.com/mikebarlow/megaphone/pull/39)

## [2.0.0] - 2023-09-11

* Updated PHP requirement to 8.1 and above (7.4 and 8.0 dropped) [PR#28](https://github.com/mikebarlow/megaphone/pull/28)
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,23 @@ If you are not using the default user model found at `App\Models\User`, you will
To get started using megaphone, drop in the Megaphone Livewire component into your template.

```html
<livewire:megaphone></livewire:megaphone>
<livewire:megaphone />
```

This will render a Bell Icon where the component has been placed. When clicked a static sidebar will appear on the right of the screen which will show all the existing and any new notifications to the user.

### Styling

As default, Megaphone uses TailwindCSS to style the Bell Icon and the notification sidebar. If you are not using Tailwind you may want to include the Megaphone CSS into your template.
As default, Megaphone uses TailwindCSS to style the Bell Icon and the notification sidebar. If you are not using Tailwind you may want to include the Megaphone CSS into your template. Add the following blade directive to your sites `<head></head>`.

```html
<link rel="stylesheet" href="{{ asset('vendor/megaphone/css/megaphone.css') }}">
@megaphoneStyles
```

If you are using TailwindCSS, make sure the Megaphone views are added to any Tailwind config to ensure the correct classes are compiled.

If you wish to recompile Megaphone stylesheet, ensure you have node and npm installed and run `npm install`. To compile the styles then run `npx mix` as per the [Larave Mix Documentation](https://laravel-mix.com/docs/6.0/installation)

## Sending Notifications

As default, Megaphone will only load notifications that have been registered within the Megaphone config file. Notifications shipped with Megaphone will be within `config('megaphone.types')`. This will be merged with the key values of `config('megaphone.customTypes')` to create the list of supported notifications.
Expand Down
15 changes: 15 additions & 0 deletions config/megaphone.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,19 @@
* show a dot instead
*/
'showCount' => true,

/*
* Enable Livewire Poll feature for auto updating.
* See livewire docs for poll option descriptions
* @link https://livewire.laravel.com/docs/wire-poll
*/
'poll' => [
'enabled' => false,

'options' => [
'time' => '15s',
'keepAlive' => false,
'viewportVisible' => false,
],
],
];
Loading

0 comments on commit 9d15c55

Please sign in to comment.