Skip to content

Commit

Permalink
#54 Fixed delete a Faq question
Browse files Browse the repository at this point in the history
  • Loading branch information
guillecro committed Apr 13, 2023
1 parent eda7380 commit f42f14d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
5 changes: 0 additions & 5 deletions app/Http/Controllers/AdminPanelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,6 @@ public function viewDeleteFaq(Request $request, $faqId){
}

public function formDeleteFaq(Request $request, $faqId){
$rules = [
'password' => ['required', new MatchOldPassword],
];

$request->validate($rules);

$faq = Faq::findOrFail($faqId);
$faq->delete();
Expand Down
25 changes: 25 additions & 0 deletions resources/views/admin/faqs/delete.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@extends('admin.master')

@section('adminContent')

<section>
<h3 class="is-700">Eliminar pregunta frecuente</h3>
<h5 class="text-muted is-700">{{$faq->title}}</h5>
@if ($errors->any())
<div class="alert alert-danger">
<ul class="mb-0">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<form action="{{ route('admin.faqs.delete.form',['faqId' => $faq->id]) }}" method="POST">
@method('DELETE')
@csrf
<p>Al eliminar la pregunta frecuente, tenga en cuenta que no se podrá recuperar.</p>
<button type="submit" class="btn btn-danger">Eliminar</button>
</form>
</section>

@endsection

0 comments on commit f42f14d

Please sign in to comment.