Updated IPsController create variable names & added seed box to input

Updated IPsController create variable names & added seed boxes to select input
This commit is contained in:
cp6 2022-11-09 15:05:55 +11:00
parent b7c02fc4fa
commit 43d22f8e16
2 changed files with 17 additions and 10 deletions

View File

@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use App\Models\DNS;
use App\Models\IPs;
use App\Models\Reseller;
use App\Models\SeedBoxes;
use App\Models\Server;
use App\Models\Shared;
use Illuminate\Http\Request;
@ -21,10 +22,11 @@ class IPsController extends Controller
public function create()
{
$Servers = Server::all();
$Shareds = Shared::all();
$Resellers = Reseller::all();
return view('ips.create', compact(['Servers', 'Shareds', 'Resellers']));
$servers = Server::all();
$shareds = Shared::all();
$resellers = Reseller::all();
$seed_boxes = SeedBoxes::all();
return view('ips.create', compact(['servers', 'shareds', 'resellers', 'seed_boxes']));
}
public function store(Request $request)

View File

@ -32,19 +32,24 @@
<div class="input-group">
<div class="input-group-prepend"><span class="input-group-text">Service</span></div>
<select class="form-control" name="service_id">
@foreach ($Servers as $server)
@foreach ($servers as $server)
<option value="{{ $server['id'] }}">
{{ $server['hostname'] }} (VPS)
{{ $server['hostname'] }} (Server)
</option>
@endforeach
@foreach ($Shareds as $shared)
@foreach ($shareds as $shared)
<option value="{{ $shared['id'] }}">
{{ $shared['main_domain'] }} (shared)
{{ $shared['main_domain'] }} (Shared)
</option>
@endforeach
@foreach ($Resellers as $reseller)
@foreach ($resellers as $reseller)
<option value="{{ $reseller['id'] }}">
{{ $reseller['main_domain'] }} (reseller)
{{ $reseller['main_domain'] }} (Reseller)
</option>
@endforeach
@foreach ($seed_boxes as $seed_box)
<option value="{{ $seed_box['id'] }}">
{{ $seed_box['title'] }} (Seed box)
</option>
@endforeach
</select></div>