mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
notifications added
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Nova;
|
||||
|
||||
use App\Notifications\ModelCreatedNotification;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Http\Request;
|
||||
use Laravel\Nova\Fields\DateTime;
|
||||
use Laravel\Nova\Fields\Markdown;
|
||||
@@ -32,6 +34,15 @@ class Comment extends Resource
|
||||
?->hasRole('super-admin');
|
||||
}
|
||||
|
||||
public static function afterCreate(NovaRequest $request, Model $model)
|
||||
{
|
||||
\App\Models\User::find(1)
|
||||
->notify(new ModelCreatedNotification($model, str($request->getRequestUri())
|
||||
->after('/nova-api/')
|
||||
->before('?')
|
||||
->toString()));
|
||||
}
|
||||
|
||||
public function fields(NovaRequest $request)
|
||||
{
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user