├── social-image.png ├── mix-manifest.json ├── tests ├── Pest.php ├── Setup │ ├── Types │ │ ├── CustomType.php │ │ └── SecondCustomType.php │ ├── User.php │ ├── migrations │ │ └── 2022_09_05_072807_create_notifications_table.php │ ├── views │ │ └── custom-type.blade.php │ └── TestCase.php ├── HasMegaphoneTest.php ├── HelpersTest.php ├── ConsoleClearNotificationsTest.php ├── MegaphoneAdminComponentTest.php └── MegaphoneComponentTest.php ├── .gitignore ├── resources ├── css │ └── megaphone.scss └── views │ ├── megaphone.blade.php │ ├── components │ ├── notification │ │ ├── date.blade.php │ │ ├── link-tag.blade.php │ │ ├── title.blade.php │ │ ├── notification.blade.php │ │ └── link.blade.php │ └── icons │ │ ├── close.blade.php │ │ ├── bell.blade.php │ │ ├── read.blade.php │ │ ├── delete.blade.php │ │ ├── exclaimation.blade.php │ │ ├── bullhorn.blade.php │ │ └── bells.blade.php │ ├── types │ ├── general.blade.php │ ├── new-feature.blade.php │ └── important.blade.php │ ├── icon.blade.php │ ├── admin │ └── create-announcement.blade.php │ └── popout.blade.php ├── src ├── Types │ ├── General.php │ ├── Important.php │ ├── NewFeature.php │ └── BaseAnnouncement.php ├── HasMegaphone.php ├── helpers.php ├── Console │ └── ClearOldNotifications.php ├── Livewire │ ├── MegaphoneAdmin.php │ └── Megaphone.php ├── Components │ └── Display.php └── MegaphoneServiceProvider.php ├── tailwind.config.js ├── webpack.mix.js ├── phpunit.xml ├── package.json ├── .github └── workflows │ └── tests.yml ├── LICENSE ├── CONTRIBUTING.md ├── composer.json ├── config └── megaphone.php ├── CHANGELOG.md ├── public └── css │ └── megaphone.css └── README.md /social-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikebarlow/megaphone/HEAD/social-image.png -------------------------------------------------------------------------------- /mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/public/css/megaphone.css": "/public/css/megaphone.css" 3 | } 4 | -------------------------------------------------------------------------------- /tests/Pest.php: -------------------------------------------------------------------------------- 1 | in(__DIR__); 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | composer.phar 2 | /vendor/ 3 | .idea 4 | .DS_Store 5 | node_modules 6 | composer.lock 7 | .phpunit.result.cache 8 | -------------------------------------------------------------------------------- /resources/css/megaphone.scss: -------------------------------------------------------------------------------- 1 | [x-cloak] { display: none !important; } 2 | 3 | @tailwind components; 4 | @tailwind utilities; 5 | -------------------------------------------------------------------------------- /src/Types/General.php: -------------------------------------------------------------------------------- 1 | 2 |
4 | {{ $createdAt->diffForHumans() }} 5 |
6 | -------------------------------------------------------------------------------- /resources/views/components/notification/link-tag.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'id' => null, 3 | 'markAsReadOnClick' => false, 4 | ]) 5 | 6 | 7 | {{ $slot }} 8 | 9 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | // webpack.mix.js 2 | let mix = require('laravel-mix'); 3 | const tailwindcss = require('tailwindcss'); 4 | 5 | mix.sass('resources/css/megaphone.scss', 'public/css') 6 | .options({ 7 | processCssUrls: false, 8 | postCss: [ tailwindcss('./tailwind.config.js') ], 9 | }) 10 | -------------------------------------------------------------------------------- /tests/Setup/User.php: -------------------------------------------------------------------------------- 1 | notifications() 12 | ->whereIn( 13 | 'type', 14 | getMegaphoneTypes() 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /resources/views/components/icons/close.blade.php: -------------------------------------------------------------------------------- 1 | @props(['class' => '']) 2 | 3 | 7 | -------------------------------------------------------------------------------- /resources/views/components/icons/bell.blade.php: -------------------------------------------------------------------------------- 1 | @props(['class' => 'h-full w-full fill-black dark:fill-white']) 2 | 3 | 6 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 |7 | {{ $title }} 8 |
9 |10 | {{ $body }} 11 |
12 |
10 |
Notifications
25 | 28 |93 | No new announcements 94 |
95 |