Accept multiple inputs from single field
up vote
-1
down vote
favorite
Hello everyone, i want to accept multiple inputs from single field and
store it in a database as it is a part of my project. i have no idea
how to do it,i have taken an array at the back-end side
view
Enter License Institution<input type="text" name="license" required>
In this this i want to accept multiple licenses.Rest all fields are
working fine and storing data also as expected but it is not accepting
multiple values from license field.
controller
public function registerLawyer(Request $request){
$firstname = $request->get('firstname');
$lastname = $request->get('lastname');
$country = $request->get('country');
$role = $request->get('role');
$dob = $request->get('dob');
$email = $request->get('email');
$pass = $request->get('password');
$aop = $request->get('pracitces');
$licensenum = $request->get('licenseNumber');
$license = $request->get('license');
$user_data = DB::table('users')->insert([
'firstname' => $firstname,
'lastname' => $lastname,
'country' => $country,
'role' => $role,
'dob' => $dob,
'email' => $email,
'password' => $pass,
]);
$user = DB::table('users')->where(['firstname'=>$firstname])->first();
$lawyer_data = DB::table('lawyer')->insert([
'u_id' => $user->id,
'practices' => $aop
]);
$law = DB::table('lawyer')->where(['u_id'=>$user->id])->first(['id']);
if(is_array($license && $license != null) && isset($license)){
$license_data = DB::table('license')->insert([
'lawyer_id' => $law->id,
'licenseno' => $licensenum,
'institution' => $license
]);
}
return redirect('welcome');
}
html database laravel-5.7
add a comment |
up vote
-1
down vote
favorite
Hello everyone, i want to accept multiple inputs from single field and
store it in a database as it is a part of my project. i have no idea
how to do it,i have taken an array at the back-end side
view
Enter License Institution<input type="text" name="license" required>
In this this i want to accept multiple licenses.Rest all fields are
working fine and storing data also as expected but it is not accepting
multiple values from license field.
controller
public function registerLawyer(Request $request){
$firstname = $request->get('firstname');
$lastname = $request->get('lastname');
$country = $request->get('country');
$role = $request->get('role');
$dob = $request->get('dob');
$email = $request->get('email');
$pass = $request->get('password');
$aop = $request->get('pracitces');
$licensenum = $request->get('licenseNumber');
$license = $request->get('license');
$user_data = DB::table('users')->insert([
'firstname' => $firstname,
'lastname' => $lastname,
'country' => $country,
'role' => $role,
'dob' => $dob,
'email' => $email,
'password' => $pass,
]);
$user = DB::table('users')->where(['firstname'=>$firstname])->first();
$lawyer_data = DB::table('lawyer')->insert([
'u_id' => $user->id,
'practices' => $aop
]);
$law = DB::table('lawyer')->where(['u_id'=>$user->id])->first(['id']);
if(is_array($license && $license != null) && isset($license)){
$license_data = DB::table('license')->insert([
'lawyer_id' => $law->id,
'licenseno' => $licensenum,
'institution' => $license
]);
}
return redirect('welcome');
}
html database laravel-5.7
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
Hello everyone, i want to accept multiple inputs from single field and
store it in a database as it is a part of my project. i have no idea
how to do it,i have taken an array at the back-end side
view
Enter License Institution<input type="text" name="license" required>
In this this i want to accept multiple licenses.Rest all fields are
working fine and storing data also as expected but it is not accepting
multiple values from license field.
controller
public function registerLawyer(Request $request){
$firstname = $request->get('firstname');
$lastname = $request->get('lastname');
$country = $request->get('country');
$role = $request->get('role');
$dob = $request->get('dob');
$email = $request->get('email');
$pass = $request->get('password');
$aop = $request->get('pracitces');
$licensenum = $request->get('licenseNumber');
$license = $request->get('license');
$user_data = DB::table('users')->insert([
'firstname' => $firstname,
'lastname' => $lastname,
'country' => $country,
'role' => $role,
'dob' => $dob,
'email' => $email,
'password' => $pass,
]);
$user = DB::table('users')->where(['firstname'=>$firstname])->first();
$lawyer_data = DB::table('lawyer')->insert([
'u_id' => $user->id,
'practices' => $aop
]);
$law = DB::table('lawyer')->where(['u_id'=>$user->id])->first(['id']);
if(is_array($license && $license != null) && isset($license)){
$license_data = DB::table('license')->insert([
'lawyer_id' => $law->id,
'licenseno' => $licensenum,
'institution' => $license
]);
}
return redirect('welcome');
}
html database laravel-5.7
Hello everyone, i want to accept multiple inputs from single field and
store it in a database as it is a part of my project. i have no idea
how to do it,i have taken an array at the back-end side
view
Enter License Institution<input type="text" name="license" required>
In this this i want to accept multiple licenses.Rest all fields are
working fine and storing data also as expected but it is not accepting
multiple values from license field.
controller
public function registerLawyer(Request $request){
$firstname = $request->get('firstname');
$lastname = $request->get('lastname');
$country = $request->get('country');
$role = $request->get('role');
$dob = $request->get('dob');
$email = $request->get('email');
$pass = $request->get('password');
$aop = $request->get('pracitces');
$licensenum = $request->get('licenseNumber');
$license = $request->get('license');
$user_data = DB::table('users')->insert([
'firstname' => $firstname,
'lastname' => $lastname,
'country' => $country,
'role' => $role,
'dob' => $dob,
'email' => $email,
'password' => $pass,
]);
$user = DB::table('users')->where(['firstname'=>$firstname])->first();
$lawyer_data = DB::table('lawyer')->insert([
'u_id' => $user->id,
'practices' => $aop
]);
$law = DB::table('lawyer')->where(['u_id'=>$user->id])->first(['id']);
if(is_array($license && $license != null) && isset($license)){
$license_data = DB::table('license')->insert([
'lawyer_id' => $law->id,
'licenseno' => $licensenum,
'institution' => $license
]);
}
return redirect('welcome');
}
html database laravel-5.7
html database laravel-5.7
asked Nov 22 at 13:47
Prathamesh
58118
58118
add a comment |
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432423%2faccept-multiple-inputs-from-single-field%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432423%2faccept-multiple-inputs-from-single-field%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown