File: /var/www/html/owlcrm/resources/views/users/plan/edit.blade.php
@extends('adminlte::page')
@section('title', 'Dashboard')
@section('content_header')
<h1>Plan</h1>
<small>Manage Plan</small>
@stop
@section('content')
<div class="card card-dark">
<div class="card-header">
<h3 class="card-title"> Edit Plan</h3>
</div>
@if (session('error'))
<h6 class="alert alert-danger">
{{ session('error') }}
</h6>
@endif
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<form method="POST" id="edit_plan" role="form" action="{{ route('plan.update', $plan->id) }}"
class="jqueryValidation">
@csrf
@method('PATCH')
<div class="card-body">
<div class=" form-group">
<label for="icon">Icon</label>
<x-adminlte-input class="form-control" id="icon" name="icon" placeholder="Enter Icon"
value="{{ $plan->icon }}" required />
</div>
<div class=" form-group">
<label for="name">Name</label>
<x-adminlte-input class="form-control" id="name" name="name" placeholder="Enter Name"
value="{{ $plan->name }}" required />
</div>
<div class=" form-group">
<label for="key">Key</label>
<x-adminlte-input class="form-control" id="key " name="key" placeholder="Enter Key"
value="{{ $plan->key }}" required />
</div>
<div class=" form-group">
<label for="description">Description</label>
<textarea class="form-control" id="description" name="description" rows="4" placeholder="Enter Description"
required>{{ old('description', $plan->description) }}</textarea>
</div>
<div class="form-group">
<label for="interval"> interval </label>
<select name="interval" id="interval" class="form-control">
<option value="">--Select--</option>
@foreach (App\Models\Plan::plan_interval as $key => $plan_interval)
<option value="{{ $key }}" {{ $plan->interval == $key ? 'selected' : '' }}>
{{ $plan_interval }}</option>
@endforeach
</select>
</div>
<div class=" form-group">
<label for="price">Price</label>
<x-adminlte-input type="number" class="form-control" id="price " name="price"
placeholder="Enter Price" step="0.01" value="{{ $plan->price }}" required />
</div>
<div class=" form-group">
<label for="key">Trial Days</label>
<x-adminlte-input type="number" class="form-control" id="trial_days " name="trial_days"
placeholder="Enter Trial Days" value="{{ $plan->trial_days }}" required />
</div>
<div class="form-group">
<input type="checkbox" id="is_test" name="is_test" value="1"
{{ old('is_test') == 1 ? 'seleted' : '' }}>
<label for="is_test">Is Test</label>
</div>
<div class="form-group">
<input type="checkbox" id="is_active" name="is_active" value="1"
{{ old('is_active') == 1 ? 'seleted' : '' }}>
<label for="is_active">Is Active</label>
</div>
<div class="card-footer d-flex justify-content-end">
<a href="{{ route('plan.index') }}" class="btn btn-danger mx-1">Cancel</a>
<button type="submit" class="btn btn-dark mx-1">Update</button>
</div>
</form>
</div>
@stop