edit.blade.php 8.7 KB

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