edit.blade.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. @extends('layouts.main')
  2. @section('content')
  3. <!-- CONTENT HEADER -->
  4. <section class="content-header">
  5. <div class="container-fluid">
  6. <div class="row mb-2">
  7. <div class="col-sm-6">
  8. <h1>Store</h1>
  9. </div>
  10. <div class="col-sm-6">
  11. <ol class="breadcrumb float-sm-right">
  12. <li class="breadcrumb-item"><a href="{{route('home')}}">Dashboard</a></li>
  13. <li class="breadcrumb-item"><a href="{{route('admin.store.index')}}">Store</a></li>
  14. <li class="breadcrumb-item"><a class="text-muted" href="{{route('admin.store.edit' , $creditProduct->id)}}">Edit</a>
  15. </li>
  16. </ol>
  17. </div>
  18. </div>
  19. </div>
  20. </section>
  21. <!-- END CONTENT HEADER -->
  22. <!-- MAIN CONTENT -->
  23. <section class="content">
  24. <div class="container-fluid">
  25. <div class="row">
  26. <div class="col-lg-6">
  27. <div class="card">
  28. <div class="card-body">
  29. <form action="{{route('admin.store.update' , $creditProduct->id)}}" method="POST">
  30. @csrf
  31. @method('PATCH')
  32. <div class="d-flex flex-row-reverse">
  33. <div class="custom-control custom-switch">
  34. <input type="checkbox" @if($creditProduct->disabled) checked @endif name="disabled" class="custom-control-input custom-control-input-danger"
  35. id="switch1">
  36. <label class="custom-control-label" for="switch1">Disabled <i data-toggle="popover"
  37. data-trigger="hover"
  38. data-content="Will hide this option from being selected"
  39. class="fas fa-info-circle"></i></label>
  40. </div>
  41. </div>
  42. <div class="form-group">
  43. <label for="type">Type</label>
  44. <select required name="type" id="type" class="custom-select @error('name') is-invalid @enderror">
  45. <option selected value="Credits">Credits</option>
  46. </select>
  47. @error('name')
  48. <div class="text-danger">
  49. {{$message}}
  50. </div>
  51. @enderror
  52. </div>
  53. <div class="form-group">
  54. <label for="currency_code">Currency code</label>
  55. <select required name="currency_code" id="currency_code" class="custom-select @error('name') is-invalid @enderror">
  56. @foreach($currencyCodes as $code)
  57. <option @if($creditProduct->currency_code == $code) selected @endif value="{{$code}}">{{$code}}</option>
  58. @endforeach
  59. </select>
  60. @error('currency_code')
  61. <div class="text-danger">
  62. {{$message}}
  63. </div>
  64. @enderror
  65. <div class="text-muted">
  66. Checkout the paypal docs to select the appropriate code <a target="_blank" href="https://developer.paypal.com/docs/api/reference/currency-codes/">link</a>
  67. </div>
  68. </div>
  69. <div class="form-group">
  70. <label for="price">Price</label>
  71. <input value="{{$creditProduct->price}}" id="price" name="price"
  72. type="number"
  73. placeholder="10.00"
  74. step="any"
  75. class="form-control @error('price') is-invalid @enderror"
  76. required="required">
  77. @error('price')
  78. <div class="invalid-feedback">
  79. {{$message}}
  80. </div>
  81. @enderror
  82. </div>
  83. <div class="form-group">
  84. <label for="quantity">Quantity</label>
  85. <input value="{{$creditProduct->quantity}}" id="quantity" name="quantity"
  86. type="number"
  87. placeholder="1000"
  88. class="form-control @error('quantity') is-invalid @enderror"
  89. required="required">
  90. @error('quantity')
  91. <div class="invalid-feedback">
  92. {{$message}}
  93. </div>
  94. @enderror
  95. <div class="text-muted">
  96. Amount given to the user after purchasing
  97. </div>
  98. </div>
  99. <div class="form-group">
  100. <label for="display">Display</label>
  101. <input value="{{$creditProduct->display}}" id="display" name="display"
  102. type="text"
  103. placeholder="750 + 250"
  104. class="form-control @error('display') is-invalid @enderror"
  105. required="required">
  106. @error('display')
  107. <div class="invalid-feedback">
  108. {{$message}}
  109. </div>
  110. @enderror
  111. <div class="text-muted">
  112. This is what the user sees at store and checkout
  113. </div>
  114. </div>
  115. <div class="form-group">
  116. <label for="description">Description</label>
  117. <input value="{{$creditProduct->description}}" id="description" name="description"
  118. type="text"
  119. placeholder="Adds 1000 credits to your account"
  120. class="form-control @error('description') is-invalid @enderror"
  121. required="required">
  122. @error('description')
  123. <div class="invalid-feedback">
  124. {{$message}}
  125. </div>
  126. @enderror
  127. <div class="text-muted">
  128. This is what the user sees at checkout
  129. </div>
  130. </div>
  131. <div class="form-group text-right">
  132. <button type="submit" class="btn btn-primary">
  133. Submit
  134. </button>
  135. </div>
  136. </form>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </section>
  143. <!-- END CONTENT -->
  144. @endsection