notifications added

This commit is contained in:
Benjamin Takats
2022-12-15 14:51:56 +01:00
parent f217c4a04d
commit 9e43f166a3
23 changed files with 276 additions and 25 deletions

View File

@@ -2,6 +2,8 @@
namespace App\Nova;
use App\Notifications\ModelCreatedNotification;
use Illuminate\Database\Eloquent\Model;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
@@ -30,6 +32,15 @@ class Team extends Resource
'id', 'name',
];
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()));
}
/**
* Get the fields displayed by the resource.
*