diff --git a/app/Http/Controllers/WordsController.php b/app/Http/Controllers/WordsController.php
index 032209e..a87e680 100644
--- a/app/Http/Controllers/WordsController.php
+++ b/app/Http/Controllers/WordsController.php
@@ -35,4 +35,22 @@ class WordsController extends Controller
return redirect('/words');
}
+
+ /**
+ * Update an existing Word in the database.
+ */
+ public function update(Request $request): RedirectResponse
+ {
+
+ return redirect('/words');
+ }
+
+ /**
+ * Delete an existing Word in the database.
+ */
+ public function delete($id): RedirectResponse
+ {
+ word::destroy($id);
+ return redirect('/words');
+ }
}
diff --git a/resources/views/components/table.blade.php b/resources/views/components/table.blade.php
index 102696a..022cffa 100644
--- a/resources/views/components/table.blade.php
+++ b/resources/views/components/table.blade.php
@@ -14,6 +14,8 @@
| {{ $item->{$fields[0]} }} |
{{ $item->{$fields[1]} }} |
+ |
+ |
@empty
diff --git a/resources/views/words/index.blade.php b/resources/views/words/index.blade.php
index 2f05471..df56b78 100644
--- a/resources/views/words/index.blade.php
+++ b/resources/views/words/index.blade.php
@@ -33,11 +33,6 @@
@include('words.partials.insert-word-form')
- {{----}}
- {{--
--}}
- {{-- @include('words.partials.modify-word-form')--}}
- {{--
--}}
- {{--
--}}
diff --git a/resources/views/words/partials/insert-word-form.blade.php b/resources/views/words/partials/insert-word-form.blade.php
index 3c55bfe..f357caf 100644
--- a/resources/views/words/partials/insert-word-form.blade.php
+++ b/resources/views/words/partials/insert-word-form.blade.php
@@ -14,19 +14,17 @@
-
+
-
+
-
-
-
+ {{ __('Submit') }}
diff --git a/routes/web.php b/routes/web.php
index 5fff9c5..f5c05bc 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -56,7 +56,8 @@ Route::prefix('words')->group(function () {
Route::post('/', [WordsController::class, 'store'])->name('words.insert');
});
-
+Route::get('delete_record/{id}', [WordsController::class, 'delete']);
+//Route::get('delete_record/{id}', [WordsController::class, 'update']);
require __DIR__ . '/auth.php';