Skip to content

Commit b518970

Browse files
Episode 02
1 parent ce1e5fa commit b518970

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
7+
class NotificationController extends Controller
8+
{
9+
public function edit()
10+
{
11+
return view('notifications.edit');
12+
}
13+
14+
public function update()
15+
{
16+
//
17+
}
18+
}

resources/views/layouts/navigation.blade.php

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
{{ __('Profile') }}
3939
</x-dropdown-link>
4040

41+
<x-dropdown-link :href="route('notifications.edit')">
42+
{{ __('Notifications') }}
43+
</x-dropdown-link>
44+
4145
<!-- Authentication -->
4246
<form method="POST" action="{{ route('logout') }}">
4347
@csrf
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<x-app-layout>
2+
<x-slot name="header">
3+
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
4+
{{ __('Notifications') }}
5+
</h2>
6+
</x-slot>
7+
8+
<div class="py-12">
9+
<div class="max-w-4xl mx-auto sm:px-6 lg:px-8 space-y-6">
10+
<div class="p-4 sm:p-8 bg-white shadow sm:rounded-lg">
11+
<form action="{{ route('notifications.update') }}" method="post" class="space-y-6">
12+
<div class="space-y-6">
13+
<div class="flex items-center justify-between">
14+
<div></div>
15+
16+
<div class="flex items-center">
17+
{{--Notification channels--}}
18+
<div class="w-24 flex items-center justify-center font-semibold text-gray-800">
19+
Channel
20+
</div>
21+
{{--/Notification channels--}}
22+
</div>
23+
</div>
24+
25+
{{--Notification groups--}}
26+
<div class="border-b border-b-gray-100 last:border-b-0 pb-8">
27+
<div class="flex items-center justify-between">
28+
<div class="text-lg font-semibold text-gray-800">
29+
Group
30+
</div>
31+
</div>
32+
33+
<div class="space-y-1.5 mt-4">
34+
{{--Notifications--}}
35+
<div class="flex items-center justify-between">
36+
<div>
37+
Notification title
38+
</div>
39+
40+
<div class="flex items-center">
41+
{{--Notification channel checkboxes--}}
42+
<div class="w-24 flex items-center justify-center">
43+
<input
44+
type="checkbox"
45+
class="rounded"
46+
>
47+
</div>
48+
{{--/Notification channel checkboxes--}}
49+
</div>
50+
</div>
51+
{{--/Notifications--}}
52+
</div>
53+
</div>
54+
{{--/Notification groups--}}
55+
</div>
56+
57+
<div class="flex items-center gap-4">
58+
<x-primary-button>{{ __('Save') }}</x-primary-button>
59+
</div>
60+
61+
@csrf
62+
@method('patch')
63+
</form>
64+
</div>
65+
</div>
66+
</div>
67+
</x-app-layout>

routes/web.php

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
use App\Http\Controllers\NotificationController;
34
use App\Http\Controllers\ProfileController;
45
use Illuminate\Support\Facades\Route;
56

@@ -12,6 +13,9 @@
1213
})->middleware(['auth', 'verified'])->name('dashboard');
1314

1415
Route::middleware('auth')->group(function () {
16+
Route::get('/notifications', [NotificationController::class, 'edit'])->name('notifications.edit');
17+
Route::patch('/notifications', [NotificationController::class, 'update'])->name('notifications.update');
18+
1519
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
1620
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
1721
Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');

0 commit comments

Comments
 (0)