edit.blade.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!--
  2. Copyright (C) 2022 Echedey López Romero <elr@disroot.org>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. -->
  14. @extends('layouts.app')
  15. @section('content')
  16. <div class="container">
  17. <div class="row mb-3">
  18. <h1 class="col-12 mb-0 text-center">Category edition</h1>
  19. </div>
  20. @if ($errors->any())
  21. <div class = "row mb-3">
  22. <div class="col-xl-6 col-lg-8 col-md-10 col-12 mx-auto alert alert-danger">
  23. <div class="container">
  24. <div class="row mb-2">
  25. <span class="col-12 text-center"><strong>Whoops!</strong> There were some problems with your input.</span>
  26. </div>
  27. <div class="row">
  28. <ul class="col-12 mb-0">
  29. @foreach ($errors->all() as $error)
  30. <li>{{ $error }}</li>
  31. @endforeach
  32. </ul>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. @endif
  38. <div class="row">
  39. <form class="col-xl-6 col-lg-8 col-md-10 col-12 mx-auto" action="{{ route('categories.update', $category->id) }}" method="POST">
  40. @csrf
  41. @method('PUT')
  42. <div class="container">
  43. <div class="row mb-3">
  44. <div class="col-12">
  45. <label class="form-label" for="name">Name</label>
  46. <input class="form-control" type="text" id="name" name="name" value="{{ old('name') ? old('name') : $category->name }}"/>
  47. </div>
  48. </div>
  49. <div class="row mb-3">
  50. <div class="col-12">
  51. <label class="form-label" for="description">Description</label>
  52. <textarea class="form-control" rows="3" id="description" name="description">{{ old('description') ? old('description') : $category->description }}</textarea>
  53. </div>
  54. </div>
  55. <div class="row">
  56. <div class="col-lg-6 col-12 mb-lg-0 mb-2">
  57. <div class="d-grid gap-2">
  58. <button type="submit" class="btn btn-primary">Modify</button>
  59. </div>
  60. </div>
  61. <div class="col-lg-6 col-12">
  62. <div class="d-grid gap-2">
  63. <button type="reset" class="btn btn-danger">Reset</button>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </form>
  69. </div>
  70. </div>
  71. @endsection