diff --git a/app/Http/Controllers/MateriaController.php b/app/Http/Controllers/MateriaController.php
index 77664831..ab3efbbf 100644
--- a/app/Http/Controllers/MateriaController.php
+++ b/app/Http/Controllers/MateriaController.php
@@ -73,8 +73,8 @@ public function update(Request $request, string $id)
/**
* Remove the specified resource from storage.
*/
- public function destroy(string $id)
+ public function destroy( $id)
{
-
+ Materia::find($id)->delete();
}
}
diff --git a/resources/js/Pages/Materias.vue b/resources/js/Pages/Materias.vue
index 92933986..caad6ad0 100644
--- a/resources/js/Pages/Materias.vue
+++ b/resources/js/Pages/Materias.vue
@@ -17,6 +17,10 @@ const submit = () => {
});
};
+function deleteMateria(id) {
+ this.$inertia.delete(route('materias.destroy', id));
+};
+
const prop = defineProps({
materias: ''
});
@@ -48,7 +52,9 @@ const prop = defineProps({