Skip to content

Commit

Permalink
Add NotificationData DTO and update NotificationController and Index.vue
Browse files Browse the repository at this point in the history
- Introduced NotificationData class for structured notification data handling.
- Updated NotificationController to use the new NotificationData namespace.
- Enhanced Index.vue to include a link for creating new notifications and added breadcrumb navigation.
  • Loading branch information
amitavroy committed Dec 24, 2024
1 parent 6f2092d commit 9d4310f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Data;
namespace App\Domain\Notification\Data;

use Spatie\LaravelData\Data;

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/NotificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Data\NotificationData;
use App\Domain\Notification\Data\NotificationData;
use App\Domain\Notification\Models\Notification;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Http\RedirectResponse;
Expand Down
10 changes: 10 additions & 0 deletions resources/js/Pages/Notification/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import PageContainer from '../../Components/PageContainer.vue'
import Breadcrumb from '../../Components/Breadcrumb.vue'
import PageTitle from '../../Components/PageTitle.vue'
import { Link } from '@inertiajs/vue3'
import NotificationTable from './NotificationTable.vue'
const { notifications } = defineProps({
Expand All @@ -10,6 +11,7 @@ const { notifications } = defineProps({
required: true
}
});
const breadCrumb = [{ name: 'Notifications', link: route('user.index') }]
</script>

<template>
Expand All @@ -19,6 +21,14 @@ const { notifications } = defineProps({
<Breadcrumb :links="breadCrumb" />
<PageTitle title="Recent Notifications" />
</div>

<div class="items-center justify-between block sm:flex md:divide-x md:divide-gray-100 dark:divide-gray-700">
<div class="flex items-center mb-4 sm:mb-0"></div>
<Link :href="route('notification.create')" id="createProductButton"
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800"
type="button">Add new notification
</Link>
</div>
</PageContainer>

<NotificationTable :notifications="notifications" />
Expand Down

0 comments on commit 9d4310f

Please sign in to comment.