Files
ProxyPanel/resources/views/components/admin/form/container.blade.php
BrettonYe ad3662cda0 🚀 Refactor Blade
- Optimize Blade JavaScript code.
- Refactored multiple admin controllers for improved validation, error handling, and query efficiency.
- Added ProxyConfig trait to centralize proxy configuration options.
- Updated NodeStatusDetection to use model relationships for heartbeat checks.
- Improved category, label, and country management logic and error logging.
- Added new Blade components for admin UI and updated language files and assets for better localization and frontend support.
- Bug fixed & introduced more bug :)
2026-01-30 20:04:17 +08:00

40 lines
868 B
PHP

@props([
'style' => 'horizontal',
'route' => null,
'method' => 'POST',
'model' => null,
'handler' => null,
'enctype' => false,
])
@php
$formAttributes = ['class' => 'form-' . e($style)];
if ($route) {
$formAttributes['action'] = e($route);
}
$formAttributes['method'] = $method === 'GET' ? 'GET' : 'POST';
if ($handler) {
$formAttributes['onsubmit'] = 'return ' . e($handler);
}
if ($enctype) {
$formAttributes['enctype'] = 'multipart/form-data';
}
@endphp
<form {!! implode(
' ',
array_map(
function ($key, $value) {
return $key . '="' . $value . '"';
},
array_keys($formAttributes),
$formAttributes,
),
) !!}>
@if (!in_array($method, ['GET', 'POST']))
@method($method)
@endif
@csrf
{!! $slot !!}
</form>