Skip to content

Commit

Permalink
Feature/notifications (#555)
Browse files Browse the repository at this point in the history
* initial commit

* Fix styling

---------

Co-authored-by: mikagrich <[email protected]>
  • Loading branch information
mikagrich and mikagrich authored Jun 27, 2024
1 parent 441f3a7 commit e848748
Show file tree
Hide file tree
Showing 30 changed files with 840 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/monorepo-split-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- sync
- audit
- passkey
- notifications

steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions app/Providers/Filament/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function panel(Panel $panel): Panel
\Moox\UserSession\UserSessionPlugin::make(),

\Moox\Passkey\PasskeyPlugin::make(),
\Moox\Notification\NotificationPlugin::make(),

]);
}
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"moox/login-link": "*",
"moox/user-session": "*",
"moox/passkey": "*",
"moox/notifications": "*",
"wikimedia/composer-merge-plugin": "^2.1"
},
"require-dev": {
Expand Down Expand Up @@ -116,4 +117,4 @@
},
"minimum-stability": "dev",
"prefer-stable": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('notifications', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
$table->text('data');
$table->timestamp('read_at')->nullable();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('notifications');
}
};
13 changes: 13 additions & 0 deletions packages/notifications/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: [mooxphp]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
49 changes: 49 additions & 0 deletions packages/notifications/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Environment
.env
.env.backup

# Composer
/vendor
composer.lock
auth.json

# NPM / Node
/node_modules
npm-debug.log
package-lock.json

# Laravel
/public/hot
/public/storage
/storage/*.key

# PHPUnit
.phpunit.result.cache
phpunit.xml

# Yarn
yarn-error.log

# PHPStan
/build
phpstan.neon

# Testbench
testbench.yaml

# PHP CS Fixer
.php-cs-fixer.cache

# Homestead
Homestead.json
Homestead.yaml

# IDEs
/.idea
/.vscode

# MacOS
.DS_Store

# Windows
Thumbs.db
1 change: 1 addition & 0 deletions packages/notifications/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
13 changes: 13 additions & 0 deletions packages/notifications/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: [mooxphp]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
21 changes: 21 additions & 0 deletions packages/notifications/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Moox <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
53 changes: 53 additions & 0 deletions packages/notifications/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
![Moox Notification](https://github.com/mooxphp/moox/raw/main/art/banner/notifications.jpg)

# Moox Notification

This is my package notifications

## Quick Installation

These two commmands are all you need to install the package:

```bash
composer require moox/notifications
php artisan mooxnotifications:install
```

Curious what the install command does? See manual installation below.

## What it does

<!--whatdoes-->

Here are some things missing, like an overview with screenshots about this package, or simply a link to the package's docs.

<!--/whatdoes-->

## Manual Installation

Instead of using the install-command `php artisan mooxnotifications:install` you are able to install this package manually step by step:

```bash
// Publish and run the migrations:
php artisan vendor:publish --tag="notifications-migrations"
php artisan migrate

// Publish the config file with:
php artisan vendor:publish --tag="notifications-config"
```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Security Vulnerabilities

Please review [our security policy](https://github.com/mooxphp/moox/security/policy) on how to report security vulnerabilities.

## Credits

- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
13 changes: 13 additions & 0 deletions packages/notifications/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Security Policy

## Supported Versions

We maintain the current version of `Moox Notification` actively.

Do not expect security fixes for older versions.

## Reporting a Vulnerability

If you find any security-related bug, please report it to [email protected].

Please do not use Github issues, to give us enough time to review and fix the issue, before others can use it, to do stupid things.
36 changes: 36 additions & 0 deletions packages/notifications/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "moox/notifications",
"description": "This is my package notifications",
"keywords": [
"Laravel",
"Filament",
"Filament plugin",
"Laravel package"
],
"homepage": "https://moox.org/",
"license": "MIT",
"authors": [
{
"name": "Moox Developer",
"email": "[email protected]",
"role": "Developer"
}
],
"require": {
"moox/core": "*"
},
"autoload": {
"psr-4": {
"Moox\\Notification\\": "src"
}
},
"extra": {
"laravel": {
"providers": [
"Moox\\Notification\\NotificationServiceProvider"
]
}
},
"minimum-stability": "stable",
"prefer-stable": true
}
5 changes: 5 additions & 0 deletions packages/notifications/config/notifications.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'navigation_sort' => 2001,
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('notifications', function (Blueprint $table) {
$table->id();
$table->string('name')->nullable();
$table->timestamp('started_at')->nullable()->index();
$table->timestamp('finished_at')->nullable();
$table->boolean('failed')->default(false)->index();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void

{
Schema::dropIfExists('notifications');
}
};
16 changes: 16 additions & 0 deletions packages/notifications/resources/lang/de/translations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

return [
'single' => 'Notification',
'plural' => 'Notifications',
'breadcrumb' => 'Notification',
'title' => 'Notification',
'navigation_label' => 'Notification',
'navigation_group' => 'Moox Notification',
'totalone' => 'Notification Eins',
'totaltwo' => 'Notification Zwei',
'totalthree' => 'Notification Drei',
'name' => 'Name',
'started_at' => 'Gestartet am',
'failed' => 'failed',
];
16 changes: 16 additions & 0 deletions packages/notifications/resources/lang/en/translations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

return [
'single' => 'Notification',
'plural' => 'Notifications',
'breadcrumb' => 'Notification',
'title' => 'Notification',
'navigation_label' => 'Notification',
'navigation_group' => 'Moox Notification',
'totalone' => 'Notification One',
'totaltwo' => 'Notification Two',
'totalthree' => 'Notification Three',
'name' => 'Name',
'started_at' => 'Started at',
'failed' => 'failed',
];
16 changes: 16 additions & 0 deletions packages/notifications/resources/lang/es/translations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

return [
'single' => 'Desarrollador',
'plural' => 'Desarrolladores',
'breadcrumb' => 'Desarrollador',
'title' => 'Desarrollador',
'navigation_label' => 'Desarrollador',
'navigation_group' => 'Desarrollador de Moox',
'totalone' => 'Desarrollador uno',
'totaltwo' => 'Desarrollador dos',
'totalthree' => 'Desarrollador tres',
'name' => 'Nombre',
'started_at' => 'Empezó a las',
'failed' => 'failed',
];
16 changes: 16 additions & 0 deletions packages/notifications/resources/lang/hr/translations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

return [
'single' => '',
'plural' => '',
'breadcrumb' => '',
'title' => '',
'navigation_label' => '',
'navigation_group' => '',
'totalone' => '',
'totaltwo' => '',
'totalthree' => '',
'name' => 'Ime',
'started_at' => 'Pokrenuto',
'failed' => 'neuspjelo',
];
16 changes: 16 additions & 0 deletions packages/notifications/resources/lang/nb_NO/translations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

return [
'single' => 'Bygger',
'plural' => 'Byggers',
'breadcrumb' => 'Bygger',
'title' => 'Bygger',
'navigation_label' => 'Bygger',
'navigation_group' => 'Moox Notification',
'totalone' => 'Bygger én',
'totaltwo' => 'Bygger to',
'totalthree' => 'Bygger tre',
'name' => 'Navn',
'started_at' => 'Startet',
'failed' => 'mislyktes',
];
Loading

0 comments on commit e848748

Please sign in to comment.