fix post form

This commit is contained in:
Kavalar 2024-07-26 16:26:01 +03:00
parent 53eb536213
commit 89b127fd72
3 changed files with 27 additions and 31 deletions

View File

@ -48,7 +48,7 @@ class UserService
{ {
foreach (User::all()->toArray() as $user) { foreach (User::all()->toArray() as $user) {
$userArr[$user['id']] = $user['username'];; $userArr[$user['id']] = $user['username'];
} }
if (!empty($userArr)) { if (!empty($userArr)) {
return $userArr; return $userArr;

52
composer.lock generated
View File

@ -337,16 +337,16 @@
}, },
{ {
"name": "illuminate/collections", "name": "illuminate/collections",
"version": "v11.16.0", "version": "v11.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/collections.git", "url": "https://github.com/illuminate/collections.git",
"reference": "ba2cf689f7d75315f483334b4efc8c6af1d5159c" "reference": "2be24113fe25ef18be33bbd083ad36bf1e751eb5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/collections/zipball/ba2cf689f7d75315f483334b4efc8c6af1d5159c", "url": "https://api.github.com/repos/illuminate/collections/zipball/2be24113fe25ef18be33bbd083ad36bf1e751eb5",
"reference": "ba2cf689f7d75315f483334b4efc8c6af1d5159c", "reference": "2be24113fe25ef18be33bbd083ad36bf1e751eb5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -388,11 +388,11 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2024-07-15T21:44:45+00:00" "time": "2024-07-23T14:08:10+00:00"
}, },
{ {
"name": "illuminate/conditionable", "name": "illuminate/conditionable",
"version": "v11.16.0", "version": "v11.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/conditionable.git", "url": "https://github.com/illuminate/conditionable.git",
@ -438,16 +438,16 @@
}, },
{ {
"name": "illuminate/container", "name": "illuminate/container",
"version": "v11.16.0", "version": "v11.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/container.git", "url": "https://github.com/illuminate/container.git",
"reference": "49183db6643a7efbe9902ca379b8f8a55c802f88" "reference": "122c62229b209678013c0833793d7cf94d14bbbd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/container/zipball/49183db6643a7efbe9902ca379b8f8a55c802f88", "url": "https://api.github.com/repos/illuminate/container/zipball/122c62229b209678013c0833793d7cf94d14bbbd",
"reference": "49183db6643a7efbe9902ca379b8f8a55c802f88", "reference": "122c62229b209678013c0833793d7cf94d14bbbd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -485,11 +485,11 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2024-07-03T21:04:00+00:00" "time": "2024-07-26T06:12:27+00:00"
}, },
{ {
"name": "illuminate/contracts", "name": "illuminate/contracts",
"version": "v11.16.0", "version": "v11.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/contracts.git", "url": "https://github.com/illuminate/contracts.git",
@ -537,16 +537,16 @@
}, },
{ {
"name": "illuminate/database", "name": "illuminate/database",
"version": "v11.16.0", "version": "v11.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/database.git", "url": "https://github.com/illuminate/database.git",
"reference": "cf816e7e0d08e2a75b233ad061eed85dd8b6b37f" "reference": "3785e0d14d8e427b72db08a9c969d4afdcf21cba"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/database/zipball/cf816e7e0d08e2a75b233ad061eed85dd8b6b37f", "url": "https://api.github.com/repos/illuminate/database/zipball/3785e0d14d8e427b72db08a9c969d4afdcf21cba",
"reference": "cf816e7e0d08e2a75b233ad061eed85dd8b6b37f", "reference": "3785e0d14d8e427b72db08a9c969d4afdcf21cba",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -601,11 +601,11 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2024-07-15T22:28:28+00:00" "time": "2024-07-26T06:18:25+00:00"
}, },
{ {
"name": "illuminate/macroable", "name": "illuminate/macroable",
"version": "v11.16.0", "version": "v11.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/macroable.git", "url": "https://github.com/illuminate/macroable.git",
@ -651,16 +651,16 @@
}, },
{ {
"name": "illuminate/support", "name": "illuminate/support",
"version": "v11.16.0", "version": "v11.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/support.git", "url": "https://github.com/illuminate/support.git",
"reference": "4fd85fffd9a4812386b6e10b2a18272ff9040dbe" "reference": "135bfb40087df34e7eae3ed699e753442f349020"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/support/zipball/4fd85fffd9a4812386b6e10b2a18272ff9040dbe", "url": "https://api.github.com/repos/illuminate/support/zipball/135bfb40087df34e7eae3ed699e753442f349020",
"reference": "4fd85fffd9a4812386b6e10b2a18272ff9040dbe", "reference": "135bfb40087df34e7eae3ed699e753442f349020",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -721,15 +721,15 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2024-07-16T13:48:58+00:00" "time": "2024-07-26T05:48:25+00:00"
}, },
{ {
"name": "itguild/forms", "name": "itguild/forms",
"version": "0.1.1", "version": "0.1.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.itguild.info/ItGuild/forms_bundle.git", "url": "https://git.itguild.info/ItGuild/forms_bundle.git",
"reference": "0f00069165f8eae4271aed6cffdb4b4ecb89c1b8" "reference": "0501718421203f721cfa750d3d703ed613cd72b7"
}, },
"require": { "require": {
"itguild/php-cg-select-v2": "^0.1.0", "itguild/php-cg-select-v2": "^0.1.0",
@ -753,7 +753,7 @@
"email": "apuc06@mail.ru" "email": "apuc06@mail.ru"
} }
], ],
"time": "2024-07-25T09:37:21+00:00" "time": "2024-07-26T13:21:26+00:00"
}, },
{ {
"name": "itguild/php-cg-select-v2", "name": "itguild/php-cg-select-v2",

View File

@ -24,11 +24,7 @@ $form->field(class: \itguild\forms\inputs\Select::class, name: "user_id", params
]) ])
->setLabel("Пользователи") ->setLabel("Пользователи")
->setOptions(\app\services\UserService::createUsernameArr()) ->setOptions(\app\services\UserService::createUsernameArr())
// ->setOptions([\app\services\UserService::createIdArr()[74] => \app\services\UserService::createUsernameArr()[1],
// \app\services\UserService::createUsernameArr()[74],
// \app\services\UserService::createUsernameArr()[82],])
->render(); ->render();
\app\helpers\Debug::prn(\app\services\UserService::createUsernameArr());
?> ?>
<div class="row"> <div class="row">