Merge pull request #211 from j122j/minimum-credits
Add minimal credits per product
This commit is contained in:
commit
e53a055bc2
8 changed files with 386 additions and 279 deletions
|
@ -3,6 +3,7 @@
|
|||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Configuration;
|
||||
use App\Models\Product;
|
||||
use Exception;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
|
@ -51,6 +52,7 @@ class ProductController extends Controller
|
|||
"swap" => "required|numeric|max:1000000|min:0",
|
||||
"description" => "required|string|max:191",
|
||||
"disk" => "required|numeric|max:1000000|min:5",
|
||||
"minimum_credits" => "required|numeric|max:1000000|min:-1",
|
||||
"io" => "required|numeric|max:1000000|min:0",
|
||||
"databases" => "required|numeric|max:1000000|min:0",
|
||||
"backups" => "required|numeric|max:1000000|min:0",
|
||||
|
@ -73,7 +75,8 @@ class ProductController extends Controller
|
|||
public function show(Product $product)
|
||||
{
|
||||
return view('admin.products.show', [
|
||||
'product' => $product
|
||||
'product' => $product,
|
||||
'minimum_credits' => Configuration::getValueByKey("MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER"),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -108,6 +111,7 @@ class ProductController extends Controller
|
|||
"description" => "required|string|max:191",
|
||||
"disk" => "required|numeric|max:1000000|min:5",
|
||||
"io" => "required|numeric|max:1000000|min:0",
|
||||
"minimum_credits" => "required|numeric|max:1000000|min:-1",
|
||||
"databases" => "required|numeric|max:1000000|min:0",
|
||||
"backups" => "required|numeric|max:1000000|min:0",
|
||||
"allocations" => "required|numeric|max:1000000|min:0",
|
||||
|
@ -125,7 +129,8 @@ class ProductController extends Controller
|
|||
* @param Product $product
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function disable(Request $request, Product $product) {
|
||||
public function disable(Request $request, Product $product)
|
||||
{
|
||||
$product->update(['disabled' => !$product->disabled]);
|
||||
|
||||
return redirect()->route('admin.products.index')->with('success', 'product has been updated!');
|
||||
|
@ -181,12 +186,11 @@ class ProductController extends Controller
|
|||
' . csrf_field() . '
|
||||
' . method_field("PATCH") . '
|
||||
<div class="custom-control custom-switch">
|
||||
<input '.$checked.' name="disabled" onchange="this.form.submit()" type="checkbox" class="custom-control-input" id="switch'.$product->id.'">
|
||||
<label class="custom-control-label" for="switch'.$product->id.'"></label>
|
||||
<input ' . $checked . ' name="disabled" onchange="this.form.submit()" type="checkbox" class="custom-control-input" id="switch' . $product->id . '">
|
||||
<label class="custom-control-label" for="switch' . $product->id . '"></label>
|
||||
</div>
|
||||
</form>
|
||||
';
|
||||
|
||||
})
|
||||
->editColumn('created_at', function (Product $product) {
|
||||
return $product->created_at ? $product->created_at->diffForHumans() : '';
|
||||
|
|
|
@ -16,7 +16,8 @@ use Illuminate\Http\Client\Response;
|
|||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Request as FacadesRequest;
|
||||
|
||||
class ServerController extends Controller
|
||||
{
|
||||
|
@ -39,6 +40,7 @@ class ServerController extends Controller
|
|||
$query->where('disabled', '=', false);
|
||||
})->get(),
|
||||
'nests' => Nest::where('disabled', '=', false)->get(),
|
||||
'minimum_credits' => Configuration::getValueByKey('MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER', 50)
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -52,7 +54,7 @@ class ServerController extends Controller
|
|||
"description" => "nullable|max:191",
|
||||
"node_id" => "required|exists:nodes,id",
|
||||
"egg_id" => "required|exists:eggs,id",
|
||||
"product_id" => "required|exists:products,id",
|
||||
"product_id" => "required|exists:products,id"
|
||||
]);
|
||||
|
||||
//get required resources
|
||||
|
@ -74,8 +76,8 @@ class ServerController extends Controller
|
|||
'identifier' => $response->json()['attributes']['identifier']
|
||||
]);
|
||||
|
||||
if (Configuration::getValueByKey('SERVER_CREATE_CHARGE_FIRST_HOUR' , 'true') == 'true'){
|
||||
if (Auth::user()->credits >= $server->product->getHourlyPrice()){
|
||||
if (Configuration::getValueByKey('SERVER_CREATE_CHARGE_FIRST_HOUR', 'true') == 'true') {
|
||||
if (Auth::user()->credits >= $server->product->getHourlyPrice()) {
|
||||
Auth::user()->decrement('credits', $server->product->getHourlyPrice());
|
||||
}
|
||||
}
|
||||
|
@ -86,15 +88,24 @@ class ServerController extends Controller
|
|||
/**
|
||||
* @return null|RedirectResponse
|
||||
*/
|
||||
private function validateConfigurationRules(){
|
||||
private function validateConfigurationRules()
|
||||
{
|
||||
//limit validation
|
||||
if (Auth::user()->servers()->count() >= Auth::user()->server_limit) {
|
||||
return redirect()->route('servers.index')->with('error', 'Server limit reached!');
|
||||
}
|
||||
|
||||
//minimum credits
|
||||
if (Auth::user()->credits <= Configuration::getValueByKey('MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER', 50)) {
|
||||
return redirect()->route('servers.index')->with('error', "You do not have the required amount of ".CREDITS_DISPLAY_NAME." to create a new server!");
|
||||
// minimum credits
|
||||
if (FacadesRequest::has("product_id")) {
|
||||
$product = Product::findOrFail(FacadesRequest::input("product_id"));
|
||||
if (
|
||||
Auth::user()->credits <
|
||||
($product->minimum_credits == -1
|
||||
? Configuration::getValueByKey('MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER', 50)
|
||||
: $product->minimum_credits)
|
||||
) {
|
||||
return redirect()->route('servers.index')->with('error', "You do not have the required amount of " . CREDITS_DISPLAY_NAME . " to use this product!");
|
||||
}
|
||||
}
|
||||
|
||||
//Required Verification for creating an server
|
||||
|
@ -141,7 +152,7 @@ class ServerController extends Controller
|
|||
* @param Server $server
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
private function serverCreationFailed(Response $response , Server $server)
|
||||
private function serverCreationFailed(Response $response, Server $server)
|
||||
{
|
||||
$server->delete();
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ use Hidehalo\Nanoid\Client;
|
|||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Spatie\Activitylog\Traits\LogsActivity;
|
||||
|
||||
class Product extends Model
|
||||
|
@ -17,10 +16,11 @@ class Product extends Model
|
|||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public static function boot() {
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(function(Product $product) {
|
||||
static::creating(function (Product $product) {
|
||||
$client = new Client();
|
||||
|
||||
$product->{$product->getKeyName()} = $client->generateId($size = 21);
|
||||
|
@ -47,6 +47,6 @@ class Product extends Model
|
|||
*/
|
||||
public function servers(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Server::class , 'id' , 'product_id');
|
||||
return $this->belongsTo(Server::class, 'id', 'product_id');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddProductMinimumCredits extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->float('minimum_credits')->default(-1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->dropColumn('minimum_credits');
|
||||
});
|
||||
}
|
||||
}
|
|
@ -10,9 +10,10 @@
|
|||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="{{route('home')}}">Dashboard</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{route('admin.products.index')}}">Products</a></li>
|
||||
<li class="breadcrumb-item"><a class="text-muted" href="{{route('admin.products.create')}}">Create</a>
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('admin.products.index') }}">Products</a></li>
|
||||
<li class="breadcrumb-item"><a class="text-muted"
|
||||
href="{{ route('admin.products.create') }}">Create</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
@ -29,12 +30,16 @@
|
|||
<div class="col-lg-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{route('admin.products.store')}}" method="POST">
|
||||
<form action="{{ route('admin.products.store') }}" method="POST">
|
||||
@csrf
|
||||
<div class="d-flex flex-row-reverse">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" name="disabled" class="custom-control-input custom-control-input-danger" id="switch1">
|
||||
<label class="custom-control-label" for="switch1">Disabled <i data-toggle="popover" data-trigger="hover" data-content="Will hide this option from being selected" class="fas fa-info-circle"></i></label>
|
||||
<input type="checkbox" name="disabled"
|
||||
class="custom-control-input custom-control-input-danger" id="switch1">
|
||||
<label class="custom-control-label" for="switch1">Disabled <i data-toggle="popover"
|
||||
data-trigger="hover"
|
||||
data-content="Will hide this option from being selected"
|
||||
class="fas fa-info-circle"></i></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -42,78 +47,75 @@
|
|||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input value="{{old('name')}}" id="name" name="name" type="text"
|
||||
class="form-control @error('name') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ old('name') }}" id="name" name="name" type="text"
|
||||
class="form-control @error('name') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('name')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="price">Price in {{CREDITS_DISPLAY_NAME}}</label>
|
||||
<input value="{{old('price')}}" id="price" name="price"
|
||||
type="number"
|
||||
class="form-control @error('price') is-invalid @enderror"
|
||||
required="required">
|
||||
<label for="price">Price in {{ CREDITS_DISPLAY_NAME }}</label>
|
||||
<input value="{{ old('price') }}" id="price" name="price" type="number"
|
||||
class="form-control @error('price') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('price')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="memory">Memory</label>
|
||||
<input value="{{old('memory')}}" id="memory" name="memory"
|
||||
type="number"
|
||||
class="form-control @error('memory') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ old('memory') }}" id="memory" name="memory" type="number"
|
||||
class="form-control @error('memory') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('memory')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="cpu">Cpu</label>
|
||||
<input value="{{old('cpu')}}" id="cpu" name="cpu"
|
||||
type="number"
|
||||
class="form-control @error('cpu') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ old('cpu') }}" id="cpu" name="cpu" type="number"
|
||||
class="form-control @error('cpu') is-invalid @enderror" required="required">
|
||||
@error('cpu')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="swap">Swap</label>
|
||||
<input value="{{old('swap')}}" id="swap" name="swap"
|
||||
type="number"
|
||||
class="form-control @error('swap') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ old('swap') }}" id="swap" name="swap" type="number"
|
||||
class="form-control @error('swap') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('swap')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">Description <i data-toggle="popover" data-trigger="hover" data-content="This is what the users sees" class="fas fa-info-circle"></i></label>
|
||||
<textarea id="description" name="description"
|
||||
type="text"
|
||||
class="form-control @error('description') is-invalid @enderror"
|
||||
required="required">{{old('description')}}</textarea>
|
||||
<label for="description">Description <i data-toggle="popover"
|
||||
data-trigger="hover" data-content="This is what the users sees"
|
||||
class="fas fa-info-circle"></i></label>
|
||||
<textarea id="description" name="description" type="text"
|
||||
class="form-control @error('description') is-invalid @enderror"
|
||||
required="required">{{ old('description') }}</textarea>
|
||||
@error('description')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
|
@ -121,65 +123,74 @@
|
|||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label for="disk">Disk</label>
|
||||
<input value="{{old('disk') ?? 1000}}" id="disk" name="disk"
|
||||
type="number"
|
||||
class="form-control @error('disk') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ old('disk') ?? 1000 }}" id="disk" name="disk" type="number"
|
||||
class="form-control @error('disk') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('disk')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="minimum_credits">Minimum {{ CREDITS_DISPLAY_NAME }} <i
|
||||
data-toggle="popover" data-trigger="hover"
|
||||
data-content="Setting to -1 will use the value from configuration."
|
||||
class="fas fa-info-circle"></i></label>
|
||||
<input value="{{ old('minimum_credits') ?? -1 }}" id="minimum_credits"
|
||||
name="minimum_credits" type="number"
|
||||
class="form-control @error('minimum_credits') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('minimum_credits')
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="io">IO</label>
|
||||
<input value="{{old('io') ?? 500}}" id="io" name="io"
|
||||
type="number"
|
||||
class="form-control @error('io') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ old('io') ?? 500 }}" id="io" name="io" type="number"
|
||||
class="form-control @error('io') is-invalid @enderror" required="required">
|
||||
@error('io')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="databases">Databases</label>
|
||||
<input value="{{old('databases') ?? 1}}" id="databases"
|
||||
name="databases"
|
||||
type="number"
|
||||
class="form-control @error('databases') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ old('databases') ?? 1 }}" id="databases" name="databases"
|
||||
type="number" class="form-control @error('databases') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('databases')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="backups">Backups</label>
|
||||
<input value="{{old('backups') ?? 1}}" id="backups"
|
||||
name="backups"
|
||||
type="number"
|
||||
class="form-control @error('backups') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ old('backups') ?? 1 }}" id="backups" name="backups"
|
||||
type="number" class="form-control @error('backups') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('backups')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="allocations">Allocations</label>
|
||||
<input value="{{old('allocations') ?? 0}}"
|
||||
id="allocations" name="allocations"
|
||||
type="number"
|
||||
class="form-control @error('allocations') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ old('allocations') ?? 0 }}" id="allocations"
|
||||
name="allocations" type="number"
|
||||
class="form-control @error('allocations') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('allocations')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
@ -200,6 +211,11 @@
|
|||
</section>
|
||||
<!-- END CONTENT -->
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
$('[data-toggle="popover"]').popover();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@endsection
|
||||
|
|
|
@ -10,9 +10,10 @@
|
|||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="{{route('home')}}">Dashboard</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{route('admin.products.index')}}">Products</a></li>
|
||||
<li class="breadcrumb-item"><a class="text-muted" href="{{route('admin.products.edit' , $product->id)}}">Edit</a>
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('admin.products.index') }}">Products</a></li>
|
||||
<li class="breadcrumb-item"><a class="text-muted"
|
||||
href="{{ route('admin.products.edit', $product->id) }}">Edit</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
@ -29,22 +30,28 @@
|
|||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
|
||||
@if($product->servers()->count() > 0)
|
||||
@if ($product->servers()->count() > 0)
|
||||
<div class="callout callout-danger">
|
||||
<h4>Editing the resource options will not automatically update the servers on pterodactyl's side!</h4>
|
||||
<p class="text-muted">Automatically updating resource options on pterodactyl side is on my todo list :)</p>
|
||||
<h4>Editing the resource options will not automatically update the servers on pterodactyl's
|
||||
side!</h4>
|
||||
<p class="text-muted">Automatically updating resource options on pterodactyl side is on my
|
||||
todo list :)</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{route('admin.products.update' , $product->id)}}" method="POST">
|
||||
<form action="{{ route('admin.products.update', $product->id) }}" method="POST">
|
||||
@csrf
|
||||
@method('PATCH')
|
||||
<div class="d-flex flex-row-reverse">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" @if($product->disabled) checked @endif name="disabled" class="custom-control-input custom-control-input-danger" id="switch1">
|
||||
<label class="custom-control-label" for="switch1">Disabled <i data-toggle="popover" data-trigger="hover" data-content="Will hide this option from being selected" class="fas fa-info-circle"></i></label>
|
||||
<input type="checkbox" @if ($product->disabled) checked @endif name="disabled"
|
||||
class="custom-control-input custom-control-input-danger" id="switch1">
|
||||
<label class="custom-control-label" for="switch1">Disabled <i data-toggle="popover"
|
||||
data-trigger="hover"
|
||||
data-content="Will hide this option from being selected"
|
||||
class="fas fa-info-circle"></i></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -52,78 +59,74 @@
|
|||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input value="{{$product->name}}" id="name" name="name" type="text"
|
||||
class="form-control @error('name') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ $product->name }}" id="name" name="name" type="text"
|
||||
class="form-control @error('name') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('name')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="price">Price in {{CREDITS_DISPLAY_NAME}}</label>
|
||||
<input value="{{$product->price}}" id="price" name="price"
|
||||
type="number"
|
||||
class="form-control @error('price') is-invalid @enderror"
|
||||
required="required">
|
||||
<label for="price">Price in {{ CREDITS_DISPLAY_NAME }}</label>
|
||||
<input value="{{ $product->price }}" id="price" name="price" type="number"
|
||||
class="form-control @error('price') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('price')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="memory">Memory</label>
|
||||
<input value="{{$product->memory}}" id="memory" name="memory"
|
||||
type="number"
|
||||
class="form-control @error('memory') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ $product->memory }}" id="memory" name="memory" type="number"
|
||||
class="form-control @error('memory') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('memory')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="cpu">Cpu</label>
|
||||
<input value="{{$product->cpu}}" id="cpu" name="cpu"
|
||||
type="number"
|
||||
class="form-control @error('cpu') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ $product->cpu }}" id="cpu" name="cpu" type="number"
|
||||
class="form-control @error('cpu') is-invalid @enderror" required="required">
|
||||
@error('cpu')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="swap">Swap</label>
|
||||
<input value="{{$product->swap}}" id="swap" name="swap"
|
||||
type="number"
|
||||
class="form-control @error('swap') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ $product->swap }}" id="swap" name="swap" type="number"
|
||||
class="form-control @error('swap') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('swap')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">Description <i data-toggle="popover" data-trigger="hover" data-content="This is what the users sees" class="fas fa-info-circle"></i></label>
|
||||
<textarea id="description" name="description"
|
||||
type="text"
|
||||
class="form-control @error('description') is-invalid @enderror"
|
||||
required="required">{{$product->description}}</textarea>
|
||||
<label for="description">Description <i data-toggle="popover"
|
||||
data-trigger="hover" data-content="This is what the users sees"
|
||||
class="fas fa-info-circle"></i></label>
|
||||
<textarea id="description" name="description" type="text"
|
||||
class="form-control @error('description') is-invalid @enderror"
|
||||
required="required">{{ $product->description }}</textarea>
|
||||
@error('description')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
|
@ -131,65 +134,72 @@
|
|||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label for="disk">Disk</label>
|
||||
<input value="{{$product->disk}}" id="disk" name="disk"
|
||||
type="number"
|
||||
class="form-control @error('disk') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ $product->disk }}" id="disk" name="disk" type="number"
|
||||
class="form-control @error('disk') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('disk')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="minimum_credits">Minimum {{ CREDITS_DISPLAY_NAME }} <i
|
||||
data-toggle="popover" data-trigger="hover"
|
||||
data-content="Setting to -1 will use the value from configuration."
|
||||
class="fas fa-info-circle"></i></label>
|
||||
<input value="{{ $product->minimum_credits }}" id="minimum_credits"
|
||||
name="minimum_credits" type="number"
|
||||
class="form-control @error('minimum_credits') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('minimum_credits')
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="io">IO</label>
|
||||
<input value="{{$product->io}}" id="io" name="io"
|
||||
type="number"
|
||||
class="form-control @error('io') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ $product->io }}" id="io" name="io" type="number"
|
||||
class="form-control @error('io') is-invalid @enderror" required="required">
|
||||
@error('io')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="databases">Databases</label>
|
||||
<input value="{{$product->databases}}" id="databases"
|
||||
name="databases"
|
||||
type="number"
|
||||
class="form-control @error('databases') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ $product->databases }}" id="databases" name="databases"
|
||||
type="number" class="form-control @error('databases') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('databases')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="backups">Backups</label>
|
||||
<input value="{{$product->backups}}" id="backups"
|
||||
name="backups"
|
||||
type="number"
|
||||
class="form-control @error('backups') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ $product->backups }}" id="backups" name="backups"
|
||||
type="number" class="form-control @error('backups') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('backups')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="allocations">Allocations</label>
|
||||
<input value="{{$product->allocations}}"
|
||||
id="allocations" name="allocations"
|
||||
type="number"
|
||||
class="form-control @error('allocations') is-invalid @enderror"
|
||||
required="required">
|
||||
<input value="{{ $product->allocations }}" id="allocations"
|
||||
name="allocations" type="number"
|
||||
class="form-control @error('allocations') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('allocations')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
@ -210,6 +220,11 @@
|
|||
</section>
|
||||
<!-- END CONTENT -->
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
$('[data-toggle="popover"]').popover();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@endsection
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="{{route('home')}}">Dashboard</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{route('admin.users.index')}}">Products</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('admin.users.index') }}">Products</a></li>
|
||||
<li class="breadcrumb-item"><a class="text-muted"
|
||||
href="{{route('admin.products.show' , $product->id)}}">Show</a>
|
||||
href="{{ route('admin.products.show', $product->id) }}">Show</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
@ -30,11 +30,15 @@
|
|||
<div class="card-header d-flex justify-content-between">
|
||||
<h5 class="card-title"><i class="fas fa-sliders-h mr-2"></i>Product</h5>
|
||||
<div class="ml-auto">
|
||||
<a data-content="Edit" data-trigger="hover" data-toggle="tooltip" href="{{ route('admin.products.edit', $product->id) }}" class="btn btn-sm btn-info mr-1"><i class="fas fa-pen"></i></a>
|
||||
<form class="d-inline" onsubmit="return submitResult();" method="post" action="{{ route('admin.products.destroy', $product->id) }}">
|
||||
<a data-content="Edit" data-trigger="hover" data-toggle="tooltip"
|
||||
href="{{ route('admin.products.edit', $product->id) }}" class="btn btn-sm btn-info mr-1"><i
|
||||
class="fas fa-pen"></i></a>
|
||||
<form class="d-inline" onsubmit="return submitResult();" method="post"
|
||||
action="{{ route('admin.products.destroy', $product->id) }}">
|
||||
{{ csrf_field() }}
|
||||
{{ method_field("DELETE") }}
|
||||
<button data-content="Delete" data-trigger="hover" data-toggle="tooltip" class="btn btn-sm btn-danger mr-1"><i class="fas fa-trash"></i></button>
|
||||
{{ method_field('DELETE') }}
|
||||
<button data-content="Delete" data-trigger="hover" data-toggle="tooltip"
|
||||
class="btn btn-sm btn-danger mr-1"><i class="fas fa-trash"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -47,9 +51,9 @@
|
|||
<label>ID</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{$product->id}}
|
||||
</span>
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{ $product->id }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -60,9 +64,9 @@
|
|||
<label>Name</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{$product->name}}
|
||||
</span>
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{ $product->name }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -73,9 +77,26 @@
|
|||
<label>Price</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
<i class="fas fa-coins mr-1"></i>{{$product->price}}
|
||||
</span>
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
<i class="fas fa-coins mr-1"></i>{{ $product->price }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<label>Minimum {{ CREDITS_DISPLAY_NAME }}</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
@if ($product->minimum_credits == -1)
|
||||
<i class="fas fa-coins mr-1"></i>{{ $minimum_credits }}
|
||||
@else
|
||||
<i class="fas fa-coins mr-1"></i>{{ $product->minimum_credits }}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -87,9 +108,9 @@
|
|||
<label>Memory</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{$product->memory}}
|
||||
</span>
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{ $product->memory }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -100,9 +121,9 @@
|
|||
<label>CPU</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{$product->cpu}}
|
||||
</span>
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{ $product->cpu }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -113,9 +134,9 @@
|
|||
<label>Swap</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{$product->swap}}
|
||||
</span>
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{ $product->swap }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -126,9 +147,9 @@
|
|||
<label>Disk</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{$product->disk}}
|
||||
</span>
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{ $product->disk }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -139,9 +160,9 @@
|
|||
<label>IO</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{$product->io}}
|
||||
</span>
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{ $product->io }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -152,9 +173,9 @@
|
|||
<label>Databases</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{$product->databases}}
|
||||
</span>
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{ $product->databases }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -165,9 +186,9 @@
|
|||
<label>Allocations</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{$product->allocations}}
|
||||
</span>
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{ $product->allocations }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -178,9 +199,9 @@
|
|||
<label>Created At</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{$product->created_at ? $product->created_at->diffForHumans() : ''}}
|
||||
</span>
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{ $product->created_at ? $product->created_at->diffForHumans() : '' }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -192,9 +213,9 @@
|
|||
<label>Description</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span class="d-inline-block text-truncate">
|
||||
{{$product->description}}
|
||||
</span>
|
||||
<span class="d-inline-block text-truncate">
|
||||
{{ $product->description }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -206,9 +227,9 @@
|
|||
<label>Updated At</label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{$product->updated_at ? $product->updated_at->diffForHumans() : ''}}
|
||||
</span>
|
||||
<span style="max-width: 250px;" class="d-inline-block text-truncate">
|
||||
{{ $product->updated_at ? $product->updated_at->diffForHumans() : '' }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -10,9 +10,10 @@
|
|||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="{{route('home')}}">Dashboard</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{route('servers.index')}}">Servers</a>
|
||||
<li class="breadcrumb-item"><a class="text-muted" href="{{route('servers.create')}}">Create</a>
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('servers.index') }}">Servers</a>
|
||||
<li class="breadcrumb-item"><a class="text-muted"
|
||||
href="{{ route('servers.create') }}">Create</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
@ -32,29 +33,29 @@
|
|||
<h5 class="card-title"><i class="fa fa-server mr-2"></i>Create Server</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="{{route('servers.store')}}">
|
||||
<form method="post" action="{{ route('servers.store') }}">
|
||||
@csrf
|
||||
<div class="form-group">
|
||||
<label for="name">* Name</label>
|
||||
<input id="name" name="name" type="text" required="required"
|
||||
class="form-control @error('name') is-invalid @enderror">
|
||||
class="form-control @error('name') is-invalid @enderror">
|
||||
|
||||
@error('name')
|
||||
<div class="invalid-feedback">
|
||||
Please fill out this field.
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
Please fill out this field.
|
||||
</div>
|
||||
@enderror
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="description">Description</label>
|
||||
<input id="description" name="description" type="text"
|
||||
class="form-control @error('description') is-invalid @enderror">
|
||||
class="form-control @error('description') is-invalid @enderror">
|
||||
|
||||
@error('description')
|
||||
<div class="invalid-feedback">
|
||||
Please fill out this field.
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
Please fill out this field.
|
||||
</div>
|
||||
@enderror
|
||||
|
||||
</div>
|
||||
|
@ -63,13 +64,13 @@
|
|||
<div>
|
||||
|
||||
<select id="node_id" name="node_id" required="required"
|
||||
class="custom-select @error('node_id') is-invalid @enderror">
|
||||
class="custom-select @error('node_id') is-invalid @enderror">
|
||||
|
||||
@foreach($locations as $location)
|
||||
<optgroup label="{{$location->name}}">
|
||||
@foreach($location->nodes as $node)
|
||||
@if(!$node->disabled)
|
||||
<option value="{{$node->id}}">{{$node->name}}</option>
|
||||
@foreach ($locations as $location)
|
||||
<optgroup label="{{ $location->name }}">
|
||||
@foreach ($location->nodes as $node)
|
||||
@if (!$node->disabled)
|
||||
<option value="{{ $node->id }}">{{ $node->name }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</optgroup>
|
||||
|
@ -79,20 +80,20 @@
|
|||
</div>
|
||||
|
||||
@error('node_id')
|
||||
<div class="invalid-feedback">
|
||||
Please fill out this field.
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
Please fill out this field.
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="egg_id">* Server configuration</label>
|
||||
<div>
|
||||
<select id="egg_id" name="egg_id" required="required"
|
||||
class="custom-select @error('egg_id') is-invalid @enderror">
|
||||
@foreach($nests as $nest)
|
||||
<optgroup label="{{$nest->name}}">
|
||||
@foreach($nest->eggs as $egg)
|
||||
<option value="{{$egg->id}}">{{$egg->name}}</option>
|
||||
class="custom-select @error('egg_id') is-invalid @enderror">
|
||||
@foreach ($nests as $nest)
|
||||
<optgroup label="{{ $nest->name }}">
|
||||
@foreach ($nest->eggs as $egg)
|
||||
<option value="{{ $egg->id }}">{{ $egg->name }}</option>
|
||||
@endforeach
|
||||
</optgroup>
|
||||
@endforeach
|
||||
|
@ -100,32 +101,39 @@
|
|||
</div>
|
||||
|
||||
@error('egg_id')
|
||||
<div class="invalid-feedback">
|
||||
Please fill out this field.
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
Please fill out this field.
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="product_id">* Resource Configuration</label>
|
||||
<div>
|
||||
<select id="product_id" name="product_id" required="required"
|
||||
class="custom-select @error('product_id') is-invalid @enderror">
|
||||
@foreach($products as $product)
|
||||
<option value="{{$product->id}}">{{$product->name}}
|
||||
({{$product->description}})
|
||||
</option>
|
||||
class="custom-select @error('product_id') is-invalid @enderror">
|
||||
@foreach ($products as $product)
|
||||
<option value="{{ $product->id }}" @if ($product->minimum_credits == -1 && Auth::user()->credits >= $minimum_credits)
|
||||
@elseif ($product->minimum_credits != -1 && Auth::user()->credits >=
|
||||
$product->minimum_credits)
|
||||
@else
|
||||
disabled
|
||||
@endif
|
||||
>{{ $product->name }}
|
||||
({{ $product->description }})
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@error('product_id')
|
||||
<div class="invalid-feedback">
|
||||
Please fill out this field.
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
Please fill out this field.
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group text-right">
|
||||
<input type="submit" class="btn btn-primary mt-3" value="Submit" onclick="this.disabled=true;this.value='Creating, please wait...';this.form.submit();"
|
||||
<input type="submit" class="btn btn-primary mt-3" value="Submit"
|
||||
onclick="this.disabled=true;this.value='Creating, please wait...';this.form.submit();">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
|
Loading…
Reference in a new issue