Notification

Route

Essentials::notificationsRoute();

Class

<?php
namespace App\Notifications;
use Illuminate\Contracts\Queue\ShouldQueue;
use Vortechron\Essentials\Core\Notification;
class Welcome extends Notification
{
protected $subject = 'Welcome to {{name}}';
protected $description = 'Sent to the customer with account activation instructions. You can edit this email before you send it.';
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct()
{
//
}
}

index.blade.php

@extends('layouts.admin')
@section('content')
<card title="Notifications">
<div class="flex flex-col">
<div class="tw-table">
<table>
<thead>
<tr>
<th>
Title
</th>
<th>
Description
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach ($data as $notification)
<tr>
<td>
{{ $notification->slug }}
</td>
<td>
{{ $notification->instance->getDescription() }}
</td>
<td>
<a href="@route('admin.notifications.edit', $notification->slug)" class="text-indigo-600 hover:text-indigo-900">Edit</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</card>
@endsection

template.blade.php

@extends('layouts.admin')
@section('content')
<enable-warn></enable-warn>
<card class="mb-5">
<template v-slot:title>
<breadcrumbs>
<breadcrumb label="All Notifications" url="{{ route('admin.notifications.index') }}"></breadcrumb>
<breadcrumb label="Edit Notification"></breadcrumb>
</breadcrumbs>
</template>
</card>
<alpine inline-template :populate-data='{ model: @json($model), options: { validateAfterChanged: true } }'>
<div>
<form action="@route('admin.notifications.update', $notification->slug)" method="POST">
<prepare-form></prepare-form>
<card title="Edit Notification">
<template v-slot:content>
@errors
@alerts
<vfg is-row :model="data.model" :options="data.options" ref="form3">
{
type: "input",
inputType: "text",
inputName: "subject",
label: "Subject",
model: "subject",
styleClasses: 'col-md-12',
placeholder: ""
},
{
type: "rich-editor",
inputName: "content",
label: "Content",
model: "content",
styleClasses: 'col-md-12',
height: 400,
placeholder: ""
},
{
type: "divider"
}
</vfg>
</template>
<template v-slot:after-content>
<card-actions no-delete></card-actions>
</template>
</card>
</form>
</div>
</alpine>
@endsection