sanjayacloud

sanjayacloud

Member Since 8 Months Ago

Experience Points 3,070
Experience Level 1

1,930 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 3
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

19 Mar
5 days ago

sanjayacloud started a new conversation Old Value Not Work Properly After Validation Run

I am developing a questionnaire page with radio button. I have issue with validation. When user submit form some field checked and required field without checked, after the validation run that checked field old value go to final radio button.

As an example if user click answer one and validation run that clicked answer one not checked it checked answer five, that means final answer.

My code like below.

  <div class="radio">
                            <div class="form-group col-md-12">
                                <input type="radio" id="1" name="q1" value="1" {{ old('q1') ? 'checked' : ''}} >
                                <label for="1">PLL tends to deliver beyond our expectations</label>
                            </div>
                            <div class="form-group col-md-12">
                                <input type="radio" id="2" name="q1" value="2" {{ old('q1') ? 'checked' : ''}}>
                                <label for="2">PLL always meets our expectation levels</label>
                            </div>
                            <div class="form-group col-md-12">
                                <input type="radio" id="3" name="q1" value="3" {{ old('q1') ? 'checked' : ''}}>
                                <label for="3">PLL sometimes meets our expectation levels</label>
                            </div>
                            <div class="form-group col-md-12">
                                <input type="radio" id="4" name="q1" value="4" {{ old('q1') ? 'checked' : ''}}>
                                <label for="4">PLL hardly meets our expectation levels</label>
                            </div>
                            <div class="form-group col-md-12">
                                <input type="radio" id="5" name="q1" value="5" {{ old('q1') ? 'checked' : ''}}>
                                <label for="5">PLL never meets our expectation levels</label>
                            </div>
                        </div>
                    </div>

Anyone has solution for this? Please help me.

18 Mar
6 days ago

sanjayacloud left a reply on Property [q1] Does Not Exist On This Collection Instance.

@CRONIX - Got it. Thank you for your support.

sanjayacloud started a new conversation Property [q1] Does Not Exist On This Collection Instance.

Hi Guys,

I am trying to get data from database and show on my radio button. But when i trying show data, I have got below error. any one the solution for this?

Error " Property [q1] does not exist on this collection instance. "

My code

$data = \App\Question::all()->where('user_id', Auth::user()->id);
   <div class="radio">
                            <div class="form-group col-md-12">
                                <input type="radio" id="1" name="q1" value="1" {{ $data->q1 == '1' ? 'checked' : '' }}>
                                <label for="1">PLL tends to deliver beyond our expectations</label>
                            </div>
                            <div class="form-group col-md-12">
                                <input type="radio" id="2" name="q1" value="2" {{ $data->q1 == '1' ? 'checked' : '' }}>
                                <label for="2">PLL always meets our expectation levels</label>
                            </div>
                            <div class="form-group col-md-12">
                                <input type="radio" id="3" name="q1" value="3" {{ $data->q1 == '3' ? 'checked' : '' }}>
                                <label for="3">PLL sometimes meets our expectation levels</label>
                            </div>
                            <div class="form-group col-md-12">
                                <input type="radio" id="4" name="q1" value="4" {{ $data->q1 == '4' ? 'checked' : '' }}>
                                <label for="4">PLL hardly meets our expectation levels</label>
                            </div>
                            <div class="form-group col-md-12">
                                <input type="radio" id="5" name="q1" value="5" {{ $data->q1 == '5' ? 'checked' : '' }}>
                                <label for="5">PLL never meets our expectation levels</label>
                            </div>
                        </div>

But when im dd(); I got my all data. can anyone help me to resolve this error?

17 Mar
1 week ago

sanjayacloud started a new conversation How To Display Block Form Step If Radio Button Checked

I am creating a form wizard for questionnaire. I want to enable one step if some radio button if checked. I have did with jQuery. but it's not work. my code like below.

<form id="regForm" action="" method="post">
    <div class="tab">
                    <input type="radio" id="test1" name="q4" value="1">
                    <label for="test1">I believe that PLL’s packaging quality is the best in the industry</label>
                    <input type="radio" id="test2" name="q4" value="2">
                    <label for="test2">I believe that there are few players who offer same packaging quality as PLL</label>
    </div>
    <div id="q4_adiv" class="tab">
            <select class="form-control form-control-lg col-md-12" name="q4_a">
                <option value="1">ALFT</option>
                <option value="2">JF packaging</option>
                <option value="3">TuffLine</option>
                <option value="4">ACME</option>
                <option value="5">SELMO</option>
            </select>
    </div>
            <button type="button" id="prevBtn" onclick="nextPrev(-1)">Previous</button>
            <button type="button" id="nextBtn" onclick="nextPrev(1)">Next</button>
            <button tyle="submit" id="bt">Save</button>

    <div style="text-align:center;margin-top:40px;">
        <span class="step"></span>
        <span id="q4_a" class="step"></span>
    </div>
</form>

<script>
    $(function () {
        $("input[name='q4']").click(function () {
            if ($("#test2").is(":checked")) {
                $("#q4_a").css('display', 'block', 'important');
                $("#q4_adiv").css('display', 'block', 'important');
            } else {
                $("#q4_a").css('display', 'none', 'important');
                $("#q4_adiv").css('display', 'none', 'important');
            }
        });
    });
</script>
<script>
    var currentTab = 0; // Current tab is set to be the first tab (0)
    showTab(currentTab); // Display the current tab
    function showTab(n) {
        // This function will display the specified tab of the form...
        var x = document.getElementsByClassName("tab");
        x[n].style.display = "block";
        //... and fix the Previous/Next buttons:
        if (n == 0) {
            document.getElementById("prevBtn").style.display = "none";
        } else {
            document.getElementById("prevBtn").style.display = "inline";
        }
        if (n == (x.length - 1)) {
            document.getElementById("nextBtn").innerHTML = "Submit";
            document.getElementById("bt").style.display = "none";
        } else {
            document.getElementById("nextBtn").innerHTML = "Next";
            document.getElementById("bt").innerHTML = "Save";
        }
        //... and run a function that will display the correct step indicator:
        fixStepIndicator(n)
    }
    function nextPrev(n) {
        // This function will figure out which tab to display
        var x = document.getElementsByClassName("tab");
        // Exit the function if any field in the current tab is invalid:
        // if (n == 1 && !validateForm()) return false;
        // Hide the current tab:
        x[currentTab].style.display = "none";
        // Increase or decrease the current tab by 1:
        currentTab = currentTab + n;
        // if you have reached the end of the form...
        if (currentTab >= x.length) {
            // ... the form gets submitted:
            document.getElementById("regForm").submit();
            return false;
        }
        // Otherwise, display the correct tab:
        showTab(currentTab);
    }
    function validateForm() {
        // This function deals with validation of the form fields
        var x, y, i, valid = true;
        x = document.getElementsByClassName("tab");
        y = x[currentTab].getElementsByTagName("input");
        // A loop that checks every input field in the current tab:
        for (i = 0; i < y.length; i++) {
            // If a field is empty...
            if (y[i].checked == "") {
                // add an "invalid" class to the field:
                y[i].className += " invalid";
                // and set the current valid status to false
                valid = false;
            }
        }
        // If the valid status is true, mark the step as finished and valid:
        if (valid) {
            document.getElementsByClassName("step")[currentTab].className += " finish";
        }
        return valid; // return the valid status
    }
    function fixStepIndicator(n) {
        // This function removes the "active" class of all steps...
        var i, x = document.getElementsByClassName("step");
        for (i = 0; i < x.length; i++) {
            x[i].className = x[i].className.replace(" active", "");
        }
        //... and adds the "active" class on the current step:
        x[n].className += " active";
    }
</script>

Can anyone help me to resolve this problem. I am using w3schools form steps for this form wizard.

Source URL: https://www.w3schools.com/howto/howto_js_form_steps.asp

sanjayacloud started a new conversation How To Display Block Form Step If Radio Button Checked

I am creating a form wizard for questionnaire. I want to enable one step if some radio button if checked. I have did with jQuery. but it's not work. my code like below.

<form id="regForm" action="" method="post">
    <div class="tab">
                    <input type="radio" id="test1" name="q4" value="1">
                    <label for="test1">I believe that PLL’s packaging quality is the best in the industry</label>
                    <input type="radio" id="test2" name="q4" value="2">
                    <label for="test2">I believe that there are few players who offer same packaging quality as PLL</label>
    </div>
    <div id="q4_adiv" class="tab">
            <select class="form-control form-control-lg col-md-12" name="q4_a">
                <option value="1">ALFT</option>
                <option value="2">JF packaging</option>
                <option value="3">TuffLine</option>
                <option value="4">ACME</option>
                <option value="5">SELMO</option>
            </select>
    </div>
            <button type="button" id="prevBtn" onclick="nextPrev(-1)">Previous</button>
            <button type="button" id="nextBtn" onclick="nextPrev(1)">Next</button>
            <button tyle="submit" id="bt">Save</button>

    <div style="text-align:center;margin-top:40px;">
        <span class="step"></span>
        <span id="q4_a" class="step"></span>
    </div>
</form>

<script>
    $(function () {
        $("input[name='q4']").click(function () {
            if ($("#test2").is(":checked")) {
                $("#q4_a").css('display', 'block', 'important');
                $("#q4_adiv").css('display', 'block', 'important');
            } else {
                $("#q4_a").css('display', 'none', 'important');
                $("#q4_adiv").css('display', 'none', 'important');
            }
        });
    });
</script>
<script>
    var currentTab = 0; // Current tab is set to be the first tab (0)
    showTab(currentTab); // Display the current tab
    function showTab(n) {
        // This function will display the specified tab of the form...
        var x = document.getElementsByClassName("tab");
        x[n].style.display = "block";
        //... and fix the Previous/Next buttons:
        if (n == 0) {
            document.getElementById("prevBtn").style.display = "none";
        } else {
            document.getElementById("prevBtn").style.display = "inline";
        }
        if (n == (x.length - 1)) {
            document.getElementById("nextBtn").innerHTML = "Submit";
            document.getElementById("bt").style.display = "none";
        } else {
            document.getElementById("nextBtn").innerHTML = "Next";
            document.getElementById("bt").innerHTML = "Save";
        }
        //... and run a function that will display the correct step indicator:
        fixStepIndicator(n)
    }
    function nextPrev(n) {
        // This function will figure out which tab to display
        var x = document.getElementsByClassName("tab");
        // Exit the function if any field in the current tab is invalid:
        // if (n == 1 && !validateForm()) return false;
        // Hide the current tab:
        x[currentTab].style.display = "none";
        // Increase or decrease the current tab by 1:
        currentTab = currentTab + n;
        // if you have reached the end of the form...
        if (currentTab >= x.length) {
            // ... the form gets submitted:
            document.getElementById("regForm").submit();
            return false;
        }
        // Otherwise, display the correct tab:
        showTab(currentTab);
    }
    function validateForm() {
        // This function deals with validation of the form fields
        var x, y, i, valid = true;
        x = document.getElementsByClassName("tab");
        y = x[currentTab].getElementsByTagName("input");
        // A loop that checks every input field in the current tab:
        for (i = 0; i < y.length; i++) {
            // If a field is empty...
            if (y[i].checked == "") {
                // add an "invalid" class to the field:
                y[i].className += " invalid";
                // and set the current valid status to false
                valid = false;
            }
        }
        // If the valid status is true, mark the step as finished and valid:
        if (valid) {
            document.getElementsByClassName("step")[currentTab].className += " finish";
        }
        return valid; // return the valid status
    }
    function fixStepIndicator(n) {
        // This function removes the "active" class of all steps...
        var i, x = document.getElementsByClassName("step");
        for (i = 0; i < x.length; i++) {
            x[i].className = x[i].className.replace(" active", "");
        }
        //... and adds the "active" class on the current step:
        x[n].className += " active";
    }
</script>

Can anyone help me to resolve this problem. I am using w3schools form steps for this form wizard.

12 Mar
1 week ago

sanjayacloud left a reply on Trying To Get Property Of Non-object

@CRONIX - I did that. Same thing happen again.

sanjayacloud left a reply on Trying To Get Property Of Non-object

@CRONIX - Actually I want to do when new user login in should be show unchecked answers and when return user login should be show what he answered. Now when return user comes it shown and checked answered answer. When new user login in to system show above error. Do you have any idea or do you have any other solution for do this. please help me.

sanjayacloud started a new conversation Trying To Get Property Of Non-object

Hi Friends,

I am developing a questionnaire app. I want do if login use has already answered question, should be show his answer or if that user never answer this questionnaire should be show normal question. But i got below error.

"Trying to get property of non-object" My code like below.

  <form action="{{url('/quiz2Store')}}" method="post">
                @csrf
                <div class="form-row">
                    <?php
                    $data = \App\Question::all()->where('user_id', Auth::user()->id)->first();

                    if (empty($data)){
                        ?>
                        <div class="form-group col-md-6">
                            <input type="hidden" name="id" value="{{Auth::user()->id}}">
                            <input type="radio" id="test1" name="q2" value="1" >
                            <label for="test1">Extremely satisfied</label>
                        </div>
                        <div class="form-group col-md-6">
                            <input type="radio" id="test2" name="q2"  value="2" >
                            <label for="test2">Satisfied</label>
                        </div>
                        <div class="form-group col-md-6">
                            <input type="radio" id="test3" name="q2"  value="3" >
                            <label for="test3">Neutral</label>
                        </div>
                        <div class="form-group col-md-6">
                            <input type="radio" id="test4" name="q2"  value="4">
                            <label for="test4">Dissatisfied</label>
                        </div>
                        <div class="form-group col-md-6">
                            <input type="radio" id="test5" name="q2"  value="5">
                            <label for="test5">Highly dissatisfied</label>
                        </div>
                    <?php
                    } else {
                    ?>

                    <div class="form-group col-md-6">
                        <input type="hidden" name="id" value="{{Auth::user()->id}}">
                        <input type="radio" id="test1" name="q2" value="1" {{$data->q2 == "1" ? 'checked' : ''}}>
                        <label for="test1">Extremely satisfied</label>
                    </div>
                    <div class="form-group col-md-6">
                        <input type="radio" id="test2" name="q2"  value="2" {{$data->q2 == "2" ? 'checked' : ''}}>
                        <label for="test2">Satisfied</label>
                    </div>
                    <div class="form-group col-md-6">
                        <input type="radio" id="test3" name="q2"  value="3" {{$data->q2 == "3" ? 'checked' : ''}}>
                        <label for="test3">Neutral</label>
                    </div>
                    <div class="form-group col-md-6">
                        <input type="radio" id="test4" name="q2"  value="4" {{$data->q2 == "4" ? 'checked' : ''}}>
                        <label for="test4">Dissatisfied</label>
                    </div>
                    <div class="form-group col-md-6">
                        <input type="radio" id="test5" name="q2"  value="5" {{$data->q2 == "5" ? 'checked' : ''}}>
                        <label for="test5">Highly dissatisfied</label>
                    </div>
                    <?php } ?>
                </div>

                <button type="submit" class="btn btn-lg btn-success float-right">Next</button>
            </form>

any one has a solution for this?

02 Mar
3 weeks ago

sanjayacloud started a new conversation How To Get User Login Data In Laravel 5.7

Hello every one.

I want to know, When user is login to the system I want add record to another table. Any one know how to do this thing? As an example when user login I want do insert user id and login time to the another table for future reference.

27 Feb
3 weeks ago

sanjayacloud left a reply on Method Not Allowed When Delete Record In Laravel

@LINDSTROM - You are correct. It's my mistake.

sanjayacloud started a new conversation Method Not Allowed When Delete Record In Laravel

Hello Friends,

I have got some error "Method not allowed " when delete record. My Delete method like this,

 public function destroy(Request $request, $id)
    {
        $data = Product::findOrFail($id);
        $data->delete();
        return redirect('/product/index');
    }

And my for like below,

<form action=""{{url('product/destroy/'.$row->id)}} method="post">
                                                    @csrf
                                                    <button type="submit" class="btn btn-outline-danger btn-block">Delete</button>
                                                </form>

My route like this,

   Route::post('/product/destroy/{id}','[email protected]');

Any one have any idea about this error?

25 Feb
3 weeks ago

sanjayacloud started a new conversation How Do Access-control-allow-origin For Api In Laravel 5.7

Hi Every one,

I am trying to develop a api for my flutter mobile app using laravel. Can I know how to do a access-control-allow-origin for api in laraavel?

11 Feb
1 month ago
07 Feb
1 month ago

sanjayacloud started a new conversation Send Email Using Notification In Laravel 5.4

Hello Friend,

I am trying to send an email to user when user submit a contact form. But I have got "Call to a member function notify() on string" Error. Any one know, How can i fix this issue.

This is my Contact form function.

    public function contactStore(Request $request){
        $validator = Validator::make($request->all(), [
            'name' => 'required',
            'email' => 'required',
            'subject' => 'required',
            'message' => 'required'
        ]);
        if ($validator->fails()) {
            return redirect('contact')
                ->withErrors($validator)
                ->withInput();
        }
        $data = new Contact;
        $data['name'] = $request->name;
        $data['email'] = $request->email;
        $data['subject'] = $request->subject;
        $data['message'] = $request->message;
        $data['emailCopy'] = $request->emailCopy;
        $emailSend = $request->emailCopy;

        $email = array(
            'name' => $request->name,
            'email' => $request->email,
            'subject' => $request->subject,
            'message' => $request->message,
            'emailCopy' =>$request->emailCopy,
        );
        $emailSend->notify(new CustomerNotification($email));
        $data->save();
        return redirect('contact');

    }

And this my notification class.

<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

class CustomerNotification extends Notification
{
    use Queueable;

    public $name;
    public $email;
    public $subject;
    public $message;
    public $emailCopy;

    
    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct($name, $email, $subject, $message, $emailCopy)
    {
        $this->name   = $name;
        $this->email = $email;
        $this->subject = $subject;
        $this->message = $message;
        $this->emailCopy = $emailCopy;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)->subject('Get a Free Sample Pack Today')->markdown('mail.customer-notification', [
            'name' => $this->name,
            'email'   => $this->email,
            'subject'   => $this->subject,
            'message'   => $this->message
        ]);
    }

}

And finally, this is my model.

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;

class Contact extends Model
{
    use Notifiable;
    protected $fillable = ['name', 'email', 'subject', 'message', 'emailCopy'];
}


30 Jan
1 month ago

sanjayacloud left a reply on How To Insert Date Into Table In Laravel

@CRONIX - Actually, I am trying to insert course start date. Any way, I have sorted it now. Thank you guys for your support.

sanjayacloud left a reply on How To Insert Date Into Table In Laravel

@CRONIX - Yes It's same in my form input name attribute.

sanjayacloud started a new conversation How To Insert Date Into Table In Laravel

Hello,

I am trying to insert course date what I choose from my form to table. But there is no data inserted in my course_date column. My controller is like below.

    public function store(Request $request)
    {
        $validator = Validator::make($request->all(), [
            'title' => 'required|max:255',
            'description' => 'required',
            ''
        ]);

        if ($validator->fails()) {
            return redirect('courses/create')
                ->withErrors($validator)
                ->withInput();
        }

        $image= $request->file('feature_image');
        $image_path = Image::make($image);
        $set_img_path = time().$image->getClientOriginalName();
        $image_path->save( public_path().'/images/course/'.$set_img_path);

        $data = new Courses;

        $now = date('Y-m-d H:i'); //Fomat Date and time
        $now = $request->couese_date;
        
        $data['title'] = $request->title;
        $data['description'] = $request->description;
        $data['course_date'] = $now;
        $data['feature_image'] = $set_img_path;
        $data->save();
        return back()->with('status', 'Course Successfully Added');

    }

Here is my model

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Courses extends Model
{
    protected $fillable = ['title', 'description', 'feature_image', 'course_date'];
}

Any one can help me to fix this?

29 Jan
1 month ago

sanjayacloud left a reply on Permission Denied When Delete Image From File Path

@JAWELO - I am in windows. Not the linux OS

sanjayacloud started a new conversation Permission Denied When Delete Image From File Path

Hi Friends,

I am trying to delete a uploaded image file from path in laravel 5.4. But when I trying to delete it I have got following error.

"unlink(E:\xampp\htdocs\project-path\public/images/pages/): Permission denied"

My controller like this

  public function destroy(Request $request, $id)
    {
        $id = decode($id);
        $img =  $request->imgValue;
        $Path = public_path().'/images/pages/'.$img;
       // fclose($Path);
        if(file_exists($Path)){
            unlink($Path);
        }
        if($request->ajax()){

            if(\App\Image::destroy($id)){
                return response()->json(array(
                    'success' => true
                ));
            }
        }else{
            return redirect()->action('[email protected]');
        }

    }

Any one know solution for this error what I got above?

14 Dec
3 months ago

sanjayacloud left a reply on Laravel.log Could Not Be Opened: Failed To Open Stream: Permission Denied

Try this inside your project folder

sudo chown -R $USER:www-data storage sudo chown -R $USER:www-data bootstrap/cache

09 Dec
3 months ago

sanjayacloud left a reply on After Login User, Redirect To Specific Path

@LJLIZARRAGA - What is this hasRole() method?

07 Dec
3 months ago

sanjayacloud left a reply on After Login User, Redirect To Specific Path

@dawgonking not yet. Do you have any idea?

30 Nov
3 months ago

sanjayacloud left a reply on After Login User, Redirect To Specific Path

@DAWGONKING - I have different user level. like user, manager, super admin, how can i handle it?

sanjayacloud started a new conversation After Login User, Redirect To Specific Path

Hello every one. I want redirect when user is login to specific path. Ex: when admin is login I need to redirect /Dashboard. how can I do it.. I try this : https://laravel.com/docs/5.7/authentication. But I fail.. Any one has a any idea.?

25 Nov
3 months ago

sanjayacloud left a reply on After Form Validation All Filled Data Have Been Reset

@AMK - After done this old value thing, I got below error. Any idea about that?

Argument 1 passed to Illuminate\Database\Grammar::parameterize() must be of the type array, string given

24 Nov
4 months ago

sanjayacloud left a reply on Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array, String Given,

@SERGIU17 - This is my controller and view

 public function store(Request $request)
    {
        $validator = Validator::make($request->all(), [
            'job' => 'required',
            'ageOfDependent' => 'required| max:3| numeric',
            'creditCard' => 'required',
            'ElectricMedia' => 'required',
            'mediaSpend' => 'required',
            'civilStatus' => 'required',
            'education' => 'required',
            'jobOfDependent' => 'required',
            'creditCardOfDependent' => 'required',
            'children' => 'required',
            'brands' => 'required',
            'superMarket' => 'required',
            'superMarkets' => 'required',
            'governmentBanks' => 'required',
            'privetBanks' => 'required',
            'insurance' => 'required',
            'assets' => 'required',
            'governmentHospitals' => 'required',
            'privetHospitals' => 'required',
        ]);

        if ($validator->fails()) {
            return redirect('questions')
                ->withErrors($validator)
                ->withInput();
        }

       $data = new Question;
       $data["job"] = $request->job;
       $data["jobPosition"] = $request->jobPosition;
       $data["creditCard"] =  $request->creditCard;
       $ElectricMedia = array();
       $ElectricMedia = $request->ElectricMedia;
       $data["ElectricMedia"] = implode(",",  $ElectricMedia );
       $data["mediaSpend"] =$request->mediaSpend;
       $data["civilStatus"] = $request->civilStatus;
       $data["education"] = $request->education;
       $data["ageOfDependent"] = $request->ageOfDependent;
       $data["jobOfDependent"] = $request->jobOfDependent;
       $data["creditCardOfDependent"] = $request->creditCardOfDependent;
       $data["children"] = $request->children;
       $data["ageOfChild_1"] = $request->ageOfChild_1;
       $data["ageOfChild_2"] = $request->ageOfChild_2;
       $data["ageOfChild_3"] = $request->ageOfChild_3;
       $data["ageOfChild_4"] = $request->ageOfChild_4;
       $data["ageOfChild_5"] = $request->ageOfChild_5;
       $data[ "ageOfChild_6"] = $request->ageOfChild_6;
       $data["meals"]= $request->meals;
       $data["holiday"] = $request->holiday;
       $data["savings"] = $request->savings;
       $data["loan"] = $request->loan;
       $data["other"] = $request->other;
       $brands = array();
       $brands = $request->brands;
       $data["brands"] = implode(",", $brands);
       $data["superMarket"] = $request->superMarket;
       $superMarkets = array();
       $superMarkets = $request->superMarkets;
       $data[ "superMarkets"] = implode(",",$superMarkets);
       $governmentBanks = array();
       $governmentBanks = $request->governmentBanks;
       $data["governmentBanks"] = implode(",",$governmentBanks);
       $privetBanks = array();
       $privetBanks = $request->privetBanks;
       $data["privetBanks"] = implode(",",$privetBanks);
       $insurance = array();
       $insurance = $request->insurance;
       $data["insurance"] = implode(",", $insurance);
       $assets = array();
       $assets = $request->assets;
       $data["assets"] = implode(",",$assets);
       $data["carValue"] = $request->carValue;
       $governmentHospitals = array();
       $governmentHospitals = $request->governmentHospitals;
       $data["governmentHospitals"] = implode(",",$governmentHospitals);
       $privetHospitals = array();
       $privetHospitals = $request->privetHospitals;
       $data["privetHospitals"] =implode(",",$privetHospitals);
       $data["created_by"] = Auth::user()->id;
       $data->save();
      return back()->with('success', 'User created successfully.');

    }

 <form id="regForm" action="insert" method="post">
                @csrf
                <h3>ඔබගේ වතගොත</h3>
                <!-- One "tab" for each step in the form: -->
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබගේ රැකියා තත්ත්වය සඳහන් කරන්න?</label>
                        <div class="col-sm-12">
                            <select id="show" class="form-control col-sm-12" name="job[]" required>
                                <option value="" >රැකියාව</option>
                                <option value="රැකියා විරහිත" {{ (collect(old('job'))->contains('රැකියා විරහිත')) ? 'selected':'' }}>රැකියා විරහිත</option>
                                <option value="පූර්ණ කාලීන සේවය" {{ (collect(old('job'))->contains('පූර්ණ කාලීන සේවය')) ? 'selected':'' }}>පූර්ණ කාලීන සේවය</option>
                                <option value="අර්ධ කාලීන සේවය" {{ (collect(old('job'))->contains('අර්ධ කාලීන සේවය')) ? 'selected':'' }}>අර්ධ කාලීන සේවය</option>
                                <option value="ගෘහණියකි" {{ (collect(old('job'))->contains('ගෘහණියකි')) ? 'selected':'' }}>ගෘහණියකි</option>
                            </select>
                        </div>
                    </div>
                    <div id="text_area" class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබ රැකියාවක නියුතු නම් රැකියා තනතුර සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="jobPosition">
                                <option value="නුපුහුණු සේවක" {{ (collect(old('jobPosition'))->contains('නුපුහුණු සේවක')) ? 'selected':'' }}>නුපුහුණු සේවක</option>
                                <option value="විධායක" {{ (collect(old('jobPosition'))->contains('විධායක')) ? 'selected':'' }}>විධායක</option>
                                <option value="කළමණාකරු" {{ (collect(old('jobPosition'))->contains('කළමණාකරු')) ? 'selected':'' }}>කළමණාකරු</option>
                                <option value="ජ්‍යෙෂ්ඨ කළමණාකරු" {{ (collect(old('job'))->contains('ජ්‍යෙෂ්ඨ කළමණාකරු')) ? 'selected':'' }}>ජ්‍යෙෂ්ඨ කළමණාකරු</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබ ක්‍රෙඩිට් කාඩ්පත් පරිහරණය කරනවාද? </label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="creditCard">
                                <option value=""></option>
                                <option value="ඔව්" {{ (collect(old('creditCard'))->contains('ඔව්')) ? 'selected':'' }}>ඔව්</option>
                                <option value="නැත" {{ (collect(old('creditCard'))->contains('නැත')) ? 'selected':'' }}>නැත</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබ භාවිතා කරන විද්‍යුත් මාධ්‍ය සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                        
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="ElectricMedia[]" multiple="multiple">
                                <option value=""></option>
                                <option value="වයිබර්" {{ (collect(old('ElectricMedia'))->contains('වයිබර්')) ? 'selected':'' }}>වයිබර්</option>
                                <option value="වට්ස් ඇප්" {{ (collect(old('ElectricMedia'))->contains('වට්ස් ඇප්')) ? 'selected':'' }}>වට්ස් ඇප්</option>
                                <option value="ෆේස්බුක්" {{ (collect(old('ElectricMedia'))->contains('ෆේස්බුක්')) ? 'selected':'' }}>අෆේස්බුක්</option>
                                <option value="යූ ටියුබ්" {{ (collect(old('ElectricMedia'))->contains('යූ ටියුබ්')) ? 'selected':'' }}>යූ ටියුබ්</option>
                                <option value="Gossip Lanka" {{ (collect(old('ElectricMedia'))->contains('Gossip Lanka')) ? 'selected':'' }}>Gossip Lanka</option>
                                <option value="Hiru News" {{ (collect(old('ElectricMedia'))->contains('Hiru News')) ? 'selected':'' }}>Hiru News</option>
                                <option value="Ada Derana" {{ (collect(old('ElectricMedia'))->contains('Ada Derana')) ? 'selected':'' }}>Ada Derana</option>
                                <option value="Linked in" {{ (collect(old('ElectricMedia'))->contains('Linked in')) ? 'selected':'' }}>Linked in</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබ විද්‍යුත් මාධ්‍යය නිරත වන කාලසීමාව සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="mediaSpend">
                                <option value=""></option>
                                <option value="දවසකට මිනිත්තු 0 - 30 " {{ (collect(old('mediaSpend'))->contains('දවසකට මිනිත්තු 0 - 30')) ? 'selected':'' }}>දවසකට මිනිත්තු 0 - 30 </option>
                                <option value="දවසකට මිනිත්තු 30 - පැය 1" {{ (collect(old('mediaSpend'))->contains('දවසකට මිනිත්තු 30 - පැය 1')) ? 'selected':'' }}>දවසකට මිනිත්තු 30 - පැය 1</option>
                                <option value="දවසකට පැය 1 - 2 " {{ (collect(old('mediaSpend'))->contains('දවසකට පැය 1 - 2 ')) ? 'selected':'' }}>දවසකට පැය 1 - 2 </option>
                                <option value="දවසකට පැය  2 වඩා වැඩි" {{ (collect(old('mediaSpend'))->contains('දවසකට පැය  2 වඩා වැඩි')) ? 'selected':'' }}>දවසකට පැය  2 වඩා වැඩි</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබගේ විවාහක අවිවාහක බව සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="civilStatus">
                                <option value=""></option>
                                <option value="අවිවාහක"  {{ (collect(old('civilStatus'))->contains('අවිවාහක')) ? 'selected':'' }}>අවිවාහක</option>
                                <option value="විවාහක" {{ (collect(old('civilStatus'))->contains('විවාහක')) ? 'selected':'' }}>විවාහක</option>
                                <option value="වැන්දඹු" {{ (collect(old('civilStatus'))->contains('වැන්දඹු')) ? 'selected':'' }}>වැන්දඹු</option>
                                <option value="දික්කසාද" {{ (collect(old('civilStatus'))->contains('දික්කසාද')) ? 'selected':'' }}>දික්කසාද</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබගේ අධ්‍යාපන මට්ටම සඳහන් කරන්න </label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="education">
                                <option value=""></option>
                                <option value="5 ශ්‍රේණිය දක්වා" {{ (collect(old('education'))->contains('5 ශ්‍රේණිය දක්වා')) ? 'selected':'' }}>5 ශ්‍රේණිය දක්වා</option>
                                <option value="8 ශ්‍රේණිය දක්වා" {{ (collect(old('education'))->contains('8 ශ්‍රේණිය දක්වා')) ? 'selected':'' }}>8 ශ්‍රේණිය දක්වා</option>
                                <option value="සාමාන්‍ය පෙළ දක්වා" {{ (collect(old('education'))->contains('සාමාන්‍ය පෙළ දක්වා"')) ? 'selected':'' }}>සාමාන්‍ය පෙළ දක්වා</option>
                                <option value="උසස් පෙළ දක්වා" {{ (collect(old('education'))->contains('උසස් පෙළ දක්වා')) ? 'selected':'' }}>උසස් පෙළ දක්වා</option>
                                <option value="වෘත්තීය මට්ටම දක්වා" {{ (collect(old('education'))->contains('වෘත්තීය මට්ටම දක්වා')) ? 'selected':'' }}>වෘත්තීය මට්ටම දක්වා</option>
                                <option value="පශ්චාත් උපාධිය" {{ (collect(old('education'))->contains('පශ්චාත් උපාධිය')) ? 'selected':'' }}>පශ්චාත් උපාධිය </option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <p class="mt-md-4">කලත්රයාගේ (ස්වාමියා / භාර්යාවගේ) - තොරතුරු:-</p>
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 ">කලත්රයාගේ වයස</label>
                        <div class="col-sm-12">
                            <input type="number"  class="form-control" name="ageOfDependent" value="{{old('ageOfDependent')}}" required autofocus>

                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">කලත්රයාගේ රැකියා තත්ත්වය  සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="jobOfDependent">
                                <option value=""></option>
                                <option value="නුපුහුණු සේවක" {{ (collect(old('jobOfDependent'))->contains('නුපුහුණු සේවක')) ? 'selected':'' }}>නුපුහුණු සේවක</option>
                                <option value="විධායක"  {{ (collect(old('jobOfDependent'))->contains('විධායක')) ? 'selected':'' }}>විධායක</option>
                                <option value="කළමණාකරු"  {{ (collect(old('jobOfDependent'))->contains('කළමණාකරු')) ? 'selected':'' }}>කළමණාකරු</option>
                                <option value="ජ්යෙෂ්ඨ කළමණාකරු"  {{ (collect(old('jobOfDependent'))->contains('ජ්යෙෂ්ඨ කළමණාකරු')) ? 'selected':'' }}>ජ්යෙෂ්ඨ කළමණාකරු</option>
                                <option value="ව්යාපාර හිමිකරු"  {{ (collect(old('jobOfDependent'))->contains('ව්යාපාර හිමිකරු')) ? 'selected':'' }}>ව්යාපාර හිමිකරු</option>
                                <option value="ගෘහණියකි" {{ (collect(old('jobOfDependent'))->contains('ගෘහණියකි')) ? 'selected':'' }}>ගෘහණියකි</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ක්‍රෙඩිට් කාඩ්පත් පරිහරණය කරනවාද ?</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="creditCardOfDependent">
                                <option value=""></option>
                                <option value="ඔව්" {{ (collect(old('creditCardOfDependent'))->contains('ඔව්')) ? 'selected':'' }}>ඔව්</option>
                                <option value="නැත" {{ (collect(old('creditCardOfDependent'))->contains('නැත')) ? 'selected':'' }}>නැත</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">දරුවන් ගණන</label>
                        <div class="col-sm-12">
                            <select id="child" class="form-control col-sm-12" name="children">
                                <option value="">දරුවන් ගණන</option>
                                <option value="0" {{ (collect(old('children'))->contains('0')) ? 'selected':'' }}>0</option>
                                <option value="1" {{ (collect(old('children'))->contains('1')) ? 'selected':'' }}>1</option>
                                <option value="2" {{ (collect(old('children'))->contains('2')) ? 'selected':'' }}>2</option>
                                <option value="3" {{ (collect(old('children'))->contains('3')) ? 'selected':'' }}>3</option>
                                <option value="4" {{ (collect(old('children'))->contains('4')) ? 'selected':'' }}>4</option>
                                <option value="5" {{ (collect(old('children'))->contains('5')) ? 'selected':'' }}>5</option>
                                <option value="6" {{ (collect(old('children'))->contains('6')) ? 'selected':'' }}>6</option>
                            </select>
                        </div>
                        <div id="c1" class="form-group col-md-6 mt-md-3">
                            <label>පලමු දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_1" class="form-control" value="{{old('ageOfChild_1')}}">
                        </div>
                        <div id="c2" class="form-group col-md-6 mt-md-3">
                            <label >දෙවන දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_2" class="form-control" value="{{old('ageOfChild_2')}}">
                        </div>
                        <div id="c3" class="form-group col-md-6">
                            <label>තුන්වන දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_3" class="form-control" value="{{old('ageOfChild_3')}}">
                        </div>
                        <div id="c4" class="form-group col-md-6">
                            <label >හතරවන දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_4" class="form-control" value="{{old('ageOfChild_4')}}">
                        </div>
                        <div id="c5" class="form-group col-md-6">
                            <label>පස්වන දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_5" class="form-control" value="{{old('ageOfChild_5')}}">
                        </div>
                        <div id="c6" class="form-group col-md-6">
                            <label >සයනව දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_6" class="form-control" value="{{old('ageOfChild_6')}}">
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <p class="mt-md-5">මාසික ගෘහස්ථ වියදම</p>

                    <p id="error" class="text-danger"></p>
                    <div class="form-group row">
                        <div  class="form-group col-md-6 mt-md-3">
                            <label>ආහාර </label>
                            <input type="number" id="meals" name="meals" class="form-control" value="0">
                        </div>
                        <div class="form-group col-md-6 mt-md-3">
                            <label >නිවාඩුව ගතකරන්න </label>
                            <input type="number" id="holiday" name="holiday" class="form-control" value="0">
                        </div>
                        <div class="form-group col-md-6 mt-md-3">
                            <label>ඉතිරි කිරීම්  </label>
                            <input type="number" id="savings" name="savings" class="form-control" value="0">
                        </div>
                        <div class="form-group col-md-6 mt-md-3">
                            <label >ණය ගෙවිම </label>
                            <input type="number" id="loan" name="loan" class="form-control" value="0">
                        </div>
                        <div class="form-group col-md-6 mt-md-3">
                            <label >අනික්</label>
                            <input type="number" id="other" name="other" class="form-control" value="0">
                        </div>
                        <div class="form-group col-md-6 mt-md-3">
                            <p class="text-success mt-md-5" id="t"></p>
                        </div>

                    </div>
                    <div class="form-group row">
                        <div class="form-group col-md-6 mt-md-3">
                            <button type="button" class="btn btn-outline-warning" id="all" onclick="calculate()">එකතුව</button>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <p class="text-warning">ඔබගෙ මාසික වියදම් එකතුව 100% සමන වියයුතුයි</p>
                            <p class="text-warning">එකතුව බලගනීමට අවශ්‍යනම් එකතුව button එක මත click කරන්න</p>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබ වැඩිපුර මිලදී ගන්නා වෙළෙඳ නාමයන් සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple " name="brands[]" multiple="multiple" required>
                                <option value=""></option>
                                <option value="එළිෆන්ට් හවුස් සොසේජස්" {{ (collect(old('brands'))->contains('එළිෆන්ට් හවුස් සොසේජස්')) ? 'selected':'' }}>එළිෆන්ට් හවුස් සොසේජස්</option>
                                <option value="එළිෆන්ට් හවුස් සිසිල් බීම" {{ (collect(old('brands'))->contains('එළිෆන්ට් හවුස් සිසිල් බීම')) ? 'selected':'' }}>එළිෆන්ට් හවුස් සිසිල් බීම</option>
                                <option value="එළිෆන්ට් හවුස් අයිස්ක්‍රීම්" {{ (collect(old('brands'))->contains('එළිෆන්ට් හවුස් අයිස්ක්‍රීම්')) ? 'selected':'' }}>එළිෆන්ට් හවුස් අයිස්ක්‍රීම් </option>
                                <option value="ඇන්කර්" {{ (collect(old('brands'))->contains('ඇන්කර්')) ? 'selected':'' }}>ඇන්කර්</option>
                                <option value="ඇස්ට්‍රා" {{ (collect(old('brands'))->contains('ඇස්ට්‍රා')) ? 'selected':'' }}>ඇස්ට්‍රා</option>
                                <option value="රින්" {{ (collect(old('brands'))->contains('රින්')) ? 'selected':'' }}>රින්</option>
                                <option value="සර්ෆෙක්සල්" {{ (collect(old('brands'))->contains('සර්ෆෙක්සල්')) ? 'selected':'' }}>සර්ෆෙක්සල්</option>
                                <option value="දීවා" {{ (collect(old('brands'))->contains('දීවා')) ? 'selected':'' }}>දීවා</option>
                                <option value="නෙස්ටමෝල්ට්" {{ (collect(old('brands'))->contains('නෙස්ටමෝල්ට්')) ? 'selected':'' }}>නෙස්ටමෝල්ට්</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබ වැඩිපුර බඩු මිලදී ගන්නා ස්ථානය සඳහන් කරන්න (බොහෝ විට)</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="superMarket" required>
                                <option value=""></option>
                                <option value="කීල්ස් සුපර්" {{ (collect(old('superMarket'))->contains('කීල්ස් සුපර්')) ? 'selected':'' }}>කීල්ස් සුපර්</option>
                                <option value="කාගීල්ස්" {{ (collect(old('superMarket'))->contains('කාගීල්ස්')) ? 'selected':'' }}>කාගීල්ස්</option>
                                <option value="ආර්පිකෝ" {{ (collect(old('superMarket'))->contains('ආර්පිකෝ')) ? 'selected':'' }}>ආර්පිකෝ</option>
                                <option value="ලාෆ්" {{ (collect(old('superMarket'))->contains('ලාෆ්')) ? 'selected':'' }}>ලාෆ්</option>
                                <option value="සතොස" {{ (collect(old('superMarket'))->contains('සතොස')) ? 'selected':'' }}>සතොස</option>
                                <option value="කෝප් සුපර්" {{ (collect(old('superMarket'))->contains('කෝප් සුපර්')) ? 'selected':'' }}>කෝප් සුපර්</option>
                                <option value="තොග ගබඩාව" {{ (collect(old('superMarket'))->contains('තොග ගබඩාව')) ? 'selected':'' }}>තොග ගබඩාව</option>
                                <option value="සිල්ලර බඩු වෙළෙඳසැලෙන්" {{ (collect(old('superMarket'))->contains('සිල්ලර බඩු වෙළෙඳසැලෙන්')) ? 'selected':'' }}>සිල්ලර බඩු වෙළෙඳසැලෙන්</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබ බඩු මිලදී ගන්නා ස්ථානය සඳහන් කරන්න (වෙනත්)</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="superMarkets[]" multiple="multiple" required>
                                <option value=""></option>
                                <option value="කීල්ස් සුපර්" {{ (collect(old('superMarkets'))->contains('කීල්ස් සුපර්')) ? 'selected':'' }}>කීල්ස් සුපර්</option>
                                <option value="කාගීල්ස්" {{ (collect(old('superMarkets'))->contains('කාගීල්ස්')) ? 'selected':'' }}>කාගීල්ස්</option>
                                <option value="ආර්පිකෝ" {{ (collect(old('superMarkets'))->contains('ආර්පිකෝ')) ? 'selected':'' }}>ආර්පිකෝ</option>
                                <option value="ලාෆ්" {{ (collect(old('superMarkets'))->contains('ලාෆ්')) ? 'selected':'' }}>ලාෆ්</option>
                                <option value="සතොස" {{ (collect(old('superMarkets'))->contains('සතොස')) ? 'selected':'' }}>සතොස</option>
                                <option value="කෝප් සුපර්" {{ (collect(old('superMarkets'))->contains('කෝප් සුපර්')) ? 'selected':'' }}>කෝප් සුපර්</option>
                                <option value="තොග ගබඩාව" {{ (collect(old('superMarkets'))->contains('තොග ගබඩාව')) ? 'selected':'' }}>තොග ගබඩාව</option>
                                <option value="සිල්ලර බඩු වෙළෙඳසැලෙන්" {{ (collect(old('superMarkets'))->contains('සිල්ලර බඩු වෙළෙඳසැලෙන්')) ? 'selected':'' }}>සිල්ලර බඩු වෙළෙඳසැලෙන්</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">ඔබ වැඩි වශයෙන් ගණුදෙනු කරන්නේ පහත සඳහන් කුමන බැංකු සමගද?
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">රජයේ</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="governmentBanks[]" multiple="multiple" required>
                                <option value=""></option>
                                <option value="BOC" {{ (collect(old('governmentBanks'))->contains('BOC')) ? 'selected':'' }}>BOC</option>
                                <option value="Peoples Bank" {{ (collect(old('governmentBanks'))->contains('Peoples Bank')) ? 'selected':'' }}>Peoples Bank</option>
                                <option value="NSB" {{ (collect(old('governmentBanks'))->contains('NSB')) ? 'selected':'' }}>NSB</option>
                            </select>

                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">පෞද්ගලික</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="privetBanks[]" multiple="multiple" required>
                                <option value=""></option>
                                <option value="සම්පත් බැංකුව" {{ (collect(old('privetBanks'))->contains('සම්පත් බැංකුව')) ? 'selected':'' }}>සම්පත් බැංකුව</option>
                                <option value="කොමර්ෂල් බැංකුව" {{ (collect(old('privetBanks'))->contains('කොමර්ෂල් බැංකුව')) ? 'selected':'' }}>කොමර්ෂල් බැංකුව</option>
                                <option value="සෙලාන් බැංකුව" {{ (collect(old('privetBanks'))->contains('සෙලාන් බැංකුව')) ? 'selected':'' }}>සෙලාන් බැංකුව</option>
                                <option value="හැටන් නැෂනල් බැංකුව" {{ (collect(old('privetBanks'))->contains('හැටන් නැෂනල් බැංකුව')) ? 'selected':'' }}>හැටන් නැෂනල් බැංකුව</option>
                                <option value="NTB" {{ (collect(old('privetBanks'))->contains('NTB')) ? 'selected':'' }}>NTB</option>
                                <option value="NDB" {{ (collect(old('privetBanks'))->contains('NDB')) ? 'selected':'' }}>NDB</option>
                                <option value="DFCC" {{ (collect(old('privetBanks'))->contains('DFCC')) ? 'selected':'' }}>DFCC</option>
                                <option value="වෙනත්" {{ (collect(old('privetBanks'))->contains('වෙනත්')) ? 'selected':'' }}>වෙනත්</option>
                            </select>

                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3"> ඔබ භාවිතා කරන ජීවිත රක‍ෂණ සමාගම් මොනවාද? </label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="insurance[]" multiple="multiple" required>
                                <option value=""></option>
                                <option value="කිසිවක් නැත" {{ (collect(old('insurance'))->contains('කිසිවක් නැත')) ? 'selected':'' }}>කිසිවක් නැත</option>
                                <option value="යූනියන් ඇෂුවරන්ස්" {{ (collect(old('insurance'))->contains('යූනියන් ඇෂුවරන්ස්')) ? 'selected':'' }}>යූනියන් ඇෂුවරන්ස්</option>
                                <option value="ෙලින්කෝ ඉන්ෂූවරන්ස්" {{ (collect(old('insurance'))->contains('ෙලින්කෝ ඉන්ෂූවරන්ස්')) ? 'selected':'' }}>සෙලින්කෝ ඉන්ෂූවරන්ස්</option>
                                <option value="ශ්‍රී ලංකා ඉන්ෂූවරන්ස්" {{ (collect(old('insurance'))->contains('ශ්‍රී ලංකා ඉන්ෂූවරන්ස්')) ? 'selected':'' }}>ශ්‍රී ලංකා ඉන්ෂූවරන්ස් </option>
                                <option value="AIA" {{ (collect(old('insurance'))->contains('AIA')) ? 'selected':'' }}>AIA</option>
                                <option value="වෙනත්" {{ (collect(old('insurance'))->contains('වෙනත්')) ? 'selected':'' }}>වෙනත්</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබගේ කල්පවත්නා භාණ්ඩ හිමිකම සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple show1" name="assets[]" multiple="multiple" required>
                                <option value=""></option>
                                <option value="ෆි්‍රජ්" {{ (collect(old('assets'))->contains('ෆි්‍රජ්')) ? 'selected':'' }}>ෆි්‍රජ්</option>
                                <option value="කාර්" {{ (collect(old('assets'))->contains('කාර්')) ? 'selected':'' }}>කාර්</option>
                                <option value="රූපවාහිනී" {{ (collect(old('assets'))->contains('රූපවාහිනී')) ? 'selected':'' }}>රූපවාහිනී</option>
                                <option value="රෙදි සෝදන යන්ත්‍ර" {{ (collect(old('assets'))->contains('රෙදි සෝදන යන්ත්‍ර')) ? 'selected':'' }}>රෙදි සෝදන යන්ත්‍ර</option>
                                <option value="Cable TV" {{ (collect(old('assets'))->contains('Cable TV')) ? 'selected':'' }}>Cable TV</option>
                                <option value="මෝටර් සයිකල්" {{ (collect(old('assets'))->contains('මෝටර් සයිකල්')) ? 'selected':'' }}>මෝටර් සයිකල්</option>
                                <option value="ලැප්ටොප්" {{ (collect(old('assets'))->contains('ලැප්ටොප්')) ? 'selected':'' }}>ලැප්ටොප්</option>
                                <option value="Gas cooker" {{ (collect(old('assets'))->contains('Gas cooker')) ? 'selected':'' }}>Gas cooker</option>
                                <option value="Micro Wave" {{ (collect(old('assets'))->contains('Micro Wave')) ? 'selected':'' }}>Micro Wave</option>
                            </select>
                        </div>
                    </div>
                    <div id="text_area1" class="form-group row">
                        <label class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ කරයේ වටිනාකම</label>
                        <div class="col-sm-12">
                            <select id="show1" class="form-control col-sm-12" name="carValue">
                                <option value="මිලියන  3 ට අඩු" {{ (collect(old('carValue'))->contains('මිලියන  3 ට අඩු')) ? 'selected':'' }}>මිලියන  3 ට අඩු</option>
                                <option value="මිලියන 3 ත් 10 අතර" {{ (collect(old('carValue'))->contains('මිලියන 3 ත් 10 අතර')) ? 'selected':'' }}>මිලියන 3 ත් 10 අතර</option>
                                <option value="මිලියන 10 ට වැඩි" {{ (collect(old('carValue'))->contains('මිලියන 10 ට වැඩි')) ? 'selected':'' }}>මිලියන 10 ට වැඩි</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබගේ වෛද්‍ය අවශ්‍යතා සඳහා භාවිතා කරන ස්ථාන සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="governmentHospitals[]" multiple="multiple" required>
                                <option value=""></option>
                                <option value="රජයේ රෝහල්" {{ (collect(old('governmentHospitals'))->contains('රජයේ රෝහල්')) ? 'selected':'' }}>රජයේ රෝහල්</option>
                                <option value="පෞද්ගලික සාත්තු නිවාස" {{ (collect(old('governmentHospitals'))->contains('පෞද්ගලික සාත්තු නිවාස')) ? 'selected':'' }}>පෞද්ගලික සාත්තු නිවාස</option>
                                <option value="පවුලේ වෛද්‍යවරයා" {{ (collect(old('governmentHospitals'))->contains('පවුලේ වෛද්‍යවරයා')) ? 'selected':'' }}>පවුලේ වෛද්‍යවරයා </option>
                                <option value="ආයුර්වේද රෝහල්" {{ (collect(old('governmentHospitals'))->contains('ආයුර්වේද රෝහල්')) ? 'selected':'' }}>ආයුර්වේද රෝහල්</option>
                            </select>

                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">පෞද්ගලික රෝහල් </label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="privetHospitals[]" multiple="multiple" required>
                                <option value=""></option>
                                <option value="ආසිරි" {{ (collect(old('privetHospitals'))->contains('ආසිරි')) ? 'selected':'' }}>ආසිරි</option>
                                <option value="ඩර්ඩන්ස්" {{ (collect(old('privetHospitals'))->contains('ඩර්ඩන්ස්')) ? 'selected':'' }}>ඩර්ඩන්ස්</option>
                                <option value="ලංකා" {{ (collect(old('privetHospitals'))->contains('ලංකා')) ? 'selected':'' }}>ලංකා</option>
                                <option value="නවලෝක" {{ (collect(old('privetHospitals'))->contains('නවලෝක')) ? 'selected':'' }}>නවලෝක</option>
                                <option value="හේමාස්" {{ (collect(old('privetHospitals'))->contains('හේමාස්')) ? 'selected':'' }}>හේමාස්</option>
                            </select>

                        </div>
                    </div>
                </div>
                <div style="overflow:auto;">
                    <div style="float:right;">
                        <button type="button" id="prevBtn" onclick="nextPrev(-1)">Previous</button>
                        <button type="button" id="nextBtn" onclick="nextPrev(1)">Next</button>
                    </div>
                </div>
                <!-- Circles which indicates the steps of the form: -->
                <div style="text-align:center;margin-top:40px;">
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                </div>
            </form>

sanjayacloud started a new conversation Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array, String Given,

Anyone know about this error?

"Argument 1 passed to Illuminate\Database\Grammar::parameterize() must be of the type array, string given,"

I got this when i insert data to db.

sanjayacloud left a reply on After Form Validation All Filled Data Have Been Reset

@AMK - Yes. I am watching now. Thanks. you are very friendly..

sanjayacloud left a reply on After Form Validation All Filled Data Have Been Reset

@AMK - It's do like this

 <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3 mt-md-3">ඔබගේ රැකියා තත්ත්වය සඳහන් කරන්න?</label>
                        <div class="col-sm-12">
                            <select id="show" class="form-control col-sm-12" name="job" required>
                                <option value="" >රැකියාව</option>
                                <option value="රැකියා විරහිත" {{ (collect(old('options'))->contains('රැකියා විරහිත')) ? 'selected':'' }}>රැකියා විරහිත</option>
                                <option value="පූර්ණ කාලීන සේවය" {{ (collect(old('options'))->contains('පූර්ණ කාලීන සේවය')) ? 'selected':'' }}>පූර්ණ කාලීන සේවය</option>
                                <option value="අර්ධ කාලීන සේවය" {{ (collect(old('options'))->contains('අර්ධ කාලීන සේවය')) ? 'selected':'' }}>අර්ධ කාලීන සේවය</option>
                                <option value="ගෘහණියකි" {{ (collect(old('options'))->contains('ගෘහණියකි')) ? 'selected':'' }}>ගෘහණියකි</option>
                            </select>
                        </div>
                    </div>

sanjayacloud left a reply on Array To String Conversion (SQL: Insert Into `questions

@SNAPEY - Thanks. I done with it using implode() method..

sanjayacloud left a reply on Array To String Conversion (SQL: Insert Into `questions

@CRONIX - I done with it using implode() method..

sanjayacloud left a reply on After Form Validation All Filled Data Have Been Reset

@AMK - Yes. I need after validation fail. all my old value should be there.

sanjayacloud started a new conversation After Form Validation All Filled Data Have Been Reset

Hi friend, I am trying do a form validation. The form validation is successfully done. but when form is validated, my all filed data has been reset. Any one know the solution for that. My controller and view like below

 public function store(Request $request)
    {
        $validator = Validator::make($request->all(), [
            'job' => 'required',
            'ageOfDependent' => 'required| max:2| numeric',
            'creditCard' => 'required',
            'ElectricMedia' => 'required',
            'mediaSpend' => 'required',
            'civilStatus' => 'required',
            'education' => 'required',
            'jobOfDependent' => 'required',
            'creditCardOfDependent' => 'required',
            'children' => 'required',
            'brands' => 'required',
            'superMarket' => 'required',
            'superMarkets' => 'required',
            'governmentBanks' => 'required',
            'privetBanks' => 'required',
            'insurance' => 'required',
            'assets' => 'required',
            'governmentHospitals' => 'required',
            'privetHospitals' => 'required',
        ]);

        if ($validator->fails()) {
            return redirect('questions')
                ->withErrors($validator)
                ->withInput();
        }

       $data = new Question;
       $data["job"] = $request->job;
       $data["jobPosition"] = $request->jobPosition;
       $data["creditCard"] =  $request->creditCard;
       $ElectricMedia = array();
       $ElectricMedia = $request->ElectricMedia;
       $data["ElectricMedia"] = implode(",",  $ElectricMedia );
       $data["mediaSpend"] =$request->mediaSpend;
       $data["civilStatus"] = $request->civilStatus;
       $data["education"] = $request->education;
       $data["ageOfDependent"] = $request->ageOfDependent;
       $data["jobOfDependent"] = $request->jobOfDependent;
       $data["creditCardOfDependent"] = $request->creditCardOfDependent;
       $data["children"] = $request->children;
       $data["ageOfChild_1"] = $request->ageOfChild_1;
       $data["ageOfChild_2"] = $request->ageOfChild_2;
       $data["ageOfChild_3"] = $request->ageOfChild_3;
       $data["ageOfChild_4"] = $request->ageOfChild_4;
       $data["ageOfChild_5"] = $request->ageOfChild_5;
       $data[ "ageOfChild_6"] = $request->ageOfChild_6;
       $data["meals"]= $request->meals;
       $data["holiday"] = $request->holiday;
       $data["savings"] = $request->savings;
       $data["loan"] = $request->loan;
       $data["other"] = $request->other;
       $brands = array();
       $brands = $request->brands;
       $data["brands"] = implode(",", $brands);
       $data["superMarket"] = $request->superMarket;
       $superMarkets = array();
       $superMarkets = $request->superMarkets;
       $data[ "superMarkets"] = implode(",",$superMarkets);
       $governmentBanks = array();
       $governmentBanks = $request->governmentBanks;
       $data["governmentBanks"] = implode(",",$governmentBanks);
       $privetBanks = array();
       $privetBanks = $request->privetBanks;
       $data["privetBanks"] = implode(",",$privetBanks);
       $insurance = array();
       $insurance = $request->insurance;
       $data["insurance"] = implode(",", $insurance);
       $assets = array();
       $assets = $request->assets;
       $data["assets"] = implode(",",$assets);
       $data["carValue"] = $request->carValue;
       $governmentHospitals = array();
       $governmentHospitals = $request->governmentHospitals;
       $data["governmentHospitals"] = implode(",",$governmentHospitals);
       $privetHospitals = array();
       $privetHospitals = $request->privetHospitals;
       $data["privetHospitals"] =implode(",",$privetHospitals);
       $data["created_by"] = Auth::user()->id;
       $data->save();
      return back()->with('success', 'User created successfully.');

    }
 <form id="regForm" action="insert" method="post">
                @csrf
                <h3>ඔබගේ වතගොත</h3>
                <!-- One "tab" for each step in the form: -->
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ රැකියා තත්ත්වය සඳහන් කරන්න?</label>
                        <div class="col-sm-12">
                            <select id="show" class="form-control col-sm-12" name="job" required>
                                <option value="" >රැකියාව</option>
                                <option value="රැකියා විරහිත">රැකියා විරහිත</option>
                                <option value="පූර්ණ කාලීන සේවය">පූර්ණ කාලීන සේවය</option>
                                <option value="අර්ධ කාලීන සේවය">අර්ධ කාලීන සේවය</option>
                                <option value="ගෘහණියකි">ගෘහණියකි</option>
                            </select>
                        </div>
                    </div>
                    <div id="text_area" class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ රැකියාවක නියුතු නම් රැකියා තනතුර සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="jobPosition">
                                <option value="නුපුහුණු සේවක">නුපුහුණු සේවක</option>
                                <option value="විධායක">විධායක</option>
                                <option value="කළමණාකරු">කළමණාකරු</option>
                                <option value="ජ්‍යෙෂ්ඨ කළමණාකරු">ජ්‍යෙෂ්ඨ කළමණාකරු</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ ක්‍රෙඩිට් කාඩ්පත් පරිහරණය කරනවාද? </label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="creditCard">
                                <option value=""></option>
                                <option value="ඔව්">ඔව්</option>
                                <option value="නැත">නැත</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ භාවිතා කරන විද්‍යුත් මාධ්‍ය සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="ElectricMedia[]" multiple="multiple">
                                <option value=""></option>
                                <option value="රවයිබර්">වයිබර්</option>
                                <option value="වට්ස් ඇප්">වට්ස් ඇප්</option>
                                <option value="ෆේස්බුක්">අෆේස්බුක්</option>
                                <option value="යූ ටියුබ්">යූ ටියුබ්</option>
                                <option value="Gossip Lanka">Gossip Lanka</option>
                                <option value="Hiru News">Hiru News</option>
                                <option value="Ada Derana">Ada Derana</option>
                                <option value="Linked in">Linked in</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ විද්‍යුත් මාධ්‍යය නිරත වන කාලසීමාව සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="mediaSpend">
                                <option value=""></option>
                                <option value="දවසකට මිනිත්තු 0 - 30 ">දවසකට මිනිත්තු 0 - 30 </option>
                                <option value="දවසකට මිනිත්තු 30 - පැය 1">දවසකට මිනිත්තු 30 - පැය 1</option>
                                <option value="දවසකට පැය 1 - 2 ">දවසකට පැය 1 - 2 </option>
                                <option value="දවසකට පැය  2 වඩා වැඩි">දවසකට පැය  2 වඩා වැඩි</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ විවාහක අවිවාහක බව සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="civilStatus">
                                <option value=""></option>
                                <option value="අවිවාහක">අවිවාහක</option>
                                <option value="විවාහක">විවාහක</option>
                                <option value="වැන්දඹු">වැන්දඹු</option>
                                <option value="දික්කසාද">දික්කසාද</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ අධ්‍යාපන මට්ටම සඳහන් කරන්න </label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="education">
                                <option value=""></option>
                                <option value="5 ශ්‍රේණිය දක්වා">5 ශ්‍රේණිය දක්වා</option>
                                <option value="8 ශ්‍රේණිය දක්වා">8 ශ්‍රේණිය දක්වා</option>
                                <option value="සාමාන්‍ය පෙළ දක්වා">සාමාන්‍ය පෙළ දක්වා</option>
                                <option value="උසස් පෙළ දක්වා">උසස් පෙළ දක්වා</option>
                                <option value="වෘත්තීය මට්ටම දක්වා">වෘත්තීය මට්ටම දක්වා</option>
                                <option value="පශ්චාත් උපාධිය ">පශ්චාත් උපාධිය </option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">කලත්රයාගේ (ස්වාමියා / භාර්යාවගේ) - තොරතුරු:-
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">කලත්රයාගේ වයස</label>
                        <div class="col-sm-12">
                            <input type="number" class="form-control" name="ageOfDependent" required autofocus>

                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">කලත්රයාගේ රැකියා තත්ත්වය  සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="jobOfDependent">
                                <option value=""></option>
                                <option value="නුපුහුණු සේවක">නුපුහුණු සේවක</option>
                                <option value="විධායක">විධායක</option>
                                <option value="කළමණාකරු">කළමණාකරු</option>
                                <option value="ජ්යෙෂ්ඨ කළමණාකරු">ජ්යෙෂ්ඨ කළමණාකරු</option>
                                <option value="ව්යාපාර හිමිකරු">ව්යාපාර හිමිකරු</option>
                                <option value="ගෘහණියකි">ගෘහණියකි</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ක්‍රෙඩිට් කාඩ්පත් පරිහරණය කරනවාද ?</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="creditCardOfDependent">
                                <option value=""></option>
                                <option value="ඔව්">ඔව්</option>
                                <option value="නැත">නැත</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">දරුවන් ගණන</label>
                        <div class="col-sm-12">
                            <select id="child" class="form-control col-sm-12" name="children">
                                <option value="">දරුවන් ගණන</option>
                                <option value="0">0</option>
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                            </select>
                        </div>
                        <div id="c1" class="form-group col-md-6 mt-md-3">
                            <label>පලමු දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_1" class="form-control">
                        </div>
                        <div id="c2" class="form-group col-md-6 mt-md-3">
                            <label >දෙවන දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_2" class="form-control">
                        </div>
                        <div id="c3" class="form-group col-md-6">
                            <label>තුන්වන දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_3" class="form-control" >
                        </div>
                        <div id="c4" class="form-group col-md-6">
                            <label >හතරවන දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_4" class="form-control">
                        </div>
                        <div id="c5" class="form-group col-md-6">
                            <label>පස්වන දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_5" class="form-control" >
                        </div>
                        <div id="c6" class="form-group col-md-6">
                            <label >සයනව දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_6" class="form-control">
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <p class="mt-md-5">මාසික ගෘහස්ථ වියදම</p>
                    <p class="text-success" id="t"></p>
                    <p id="error"></p>
                    <div class="form-group row">
                        <div  class="form-group col-md-6 mt-md-3">
                            <label>ආහාර </label>
                            <input type="number" id="meals" name="meals" class="form-control" value="0">
                        </div>
                        <div class="form-group col-md-6 mt-md-3">
                            <label >නිවාඩුව ගතකරන්න </label>
                            <input type="number" id="holiday" name="holiday" class="form-control" value="0">
                        </div>
                        <div class="form-group col-md-6 mt-md-3">
                            <label>ඉතිරි කිරීම්  </label>
                            <input type="number" id="savings" name="savings" class="form-control" value="0">
                        </div>
                        <div class="form-group col-md-6 mt-md-3">
                            <label >ණය ගෙවිම </label>
                            <input type="number" id="loan" name="loan" class="form-control" value="0">
                        </div>
                        <div class="form-group col-md-6 mt-md-3">
                            <label >අනික්</label>
                            <input type="number" id="other" name="other" class="form-control" value="0">
                        </div>

                    </div>
                    <div class="form-group row">
                        <div class="form-group col-md-6 mt-md-3">
                            <button type="button" class="btn btn-outline-warning" id="all" onclick="calculate()">එකතුව</button>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ වැඩිපුර මිලදී ගන්නා වෙළෙඳ නාමයන් සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="brands[]" multiple="multiple">
                                <option value=""></option>
                                <option selected value="එළිෆන්ට් හවුස් සොසේජස්">එළිෆන්ට් හවුස් සොසේජස්</option>
                                <option value="එළිෆන්ට් හවුස් සිසිල් බීම">එළිෆන්ට් හවුස් සිසිල් බීම</option>
                                <option value="එළිෆන්ට් හවුස් අයිස්ක්‍රීම්  ">එළිෆන්ට් හවුස් අයිස්ක්‍රීම්   </option>
                                <option value="ඇන්කර්">ඇන්කර්</option>
                                <option value="ඇස්ට්‍රා">ඇස්ට්‍රා</option>
                                <option value="රින්">රින්</option>
                                <option value="සර්ෆෙක්සල්">සර්ෆෙක්සල්</option>
                                <option value="දීවා">දීවා</option>
                                <option value="නෙස්ටමෝල්ට්">නෙස්ටමෝල්ට්</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ වැඩිපුර බඩු මිලදී ගන්නා ස්ථානය සඳහන් කරන්න (බොහෝ විට)</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="superMarket">
                                <option value=""></option>
                                <option value="කීල්ස් සුපර්">කීල්ස් සුපර්</option>
                                <option value="කාගීල්ස්">කාගීල්ස්</option>
                                <option value="ආර්පිකෝ">ආර්පිකෝ</option>
                                <option value="ලාෆ්">ලාෆ්</option>
                                <option value="සතොස">සතොස</option>
                                <option value="කෝප් සුපර්">කෝප් සුපර්</option>
                                <option value="තොග ගබඩාව">තොග ගබඩාව</option>
                                <option value="සිල්ලර බඩු වෙළෙඳසැලෙන්">සිල්ලර බඩු වෙළෙඳසැලෙන්</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ බඩු මිලදී ගන්නා ස්ථානය සඳහන් කරන්න (වෙනත්)</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="superMarkets[]" multiple="multiple">
                                <option value=""></option>
                                <option selected value="කීල්ස් සුපර්">කීල්ස් සුපර්</option>
                                <option value="කාගීල්ස්">කාගීල්ස්</option>
                                <option value="ආර්පිකෝ">ආර්පිකෝ</option>
                                <option value="ලාෆ්">ලාෆ්</option>
                                <option value="සතොස">සතොස</option>
                                <option value="කෝප් සුපර්">කෝප් සුපර්</option>
                                <option value="තොග ගබඩාව">තොග ගබඩාව</option>
                                <option value="සිල්ලර බඩු වෙළෙඳසැලෙන්">සිල්ලර බඩු වෙළෙඳසැලෙන්</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">ඔබ වැඩි වශයෙන් ගණුදෙනු කරන්නේ පහත සඳහන් කුමන බැංකු සමගද?
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">රජයේ</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="governmentBanks[]" multiple="multiple" required>
                                <option  value=""></option>
                                <option selected value="BOC">BOC</option>
                                <option value="Peoples Bank">Peoples Bank</option>
                                <option value="NSB">NSB</option>
                            </select>

                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">පෞද්ගලික</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="privetBanks[]" multiple="multiple" required>
                                <option value=""></option>
                                <option selected value="සම්පත් බැංකුව">සම්පත් බැංකුව</option>
                                <option value="කොමර්ෂල් බැංකුව">කොමර්ෂල් බැංකුව</option>
                                <option value="සෙලාන් බැංකුව">සෙලාන් බැංකුව</option>
                                <option value="හැටන් නැෂනල් බැංකුව">හැටන් නැෂනල් බැංකුව</option>
                                <option value="NTB">NTB</option>
                                <option value="NDB">NDB</option>
                                <option value="DFCC">DFCC</option>
                                <option value="වෙනත්">වෙනත්</option>
                            </select>

                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3"> ඔබ භාවිතා කරන ජීවිත රක‍ෂණ සමාගම් මොනවාද? </label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="insurance[]" multiple="multiple" required>
                                <option value=""></option>
                                <option selected value="කිසිවක් නැත">කිසිවක් නැත</option>
                                <option value="යූනියන් ඇෂුවරන්ස්">යූනියන් ඇෂුවරන්ස්</option>
                                <option value="ෙලින්කෝ ඉන්ෂූවරන්ස්">සෙලින්කෝ ඉන්ෂූවරන්ස්</option>
                                <option value="ශ්‍රී ලංකා ඉන්ෂූවරන්ස්">ශ්‍රී ලංකා ඉන්ෂූවරන්ස් </option>
                                <option value="AIA">AIA</option>
                                <option value="වෙනත්">වෙනත්</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ කල්පවත්නා භාණ්ඩ හිමිකම සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple show1" name="assets[]" multiple="multiple" required>
                                <option value=""></option>
                                <option selected value="ෆි්‍රජ්">ෆි්‍රජ්</option>
                                <option value="කාර්">කාර්</option>
                                <option value="රූපවාහිනී">රූපවාහිනී</option>
                                <option value="රෙදි සෝදන යන්ත්‍ර">රෙදි සෝදන යන්ත්‍ර</option>
                                <option value="Cable TV">Cable TV</option>
                                <option value="මෝටර් සයිකල්">මෝටර් සයිකල්</option>
                                <option value="ලැප්ටොප්">ලැප්ටොප්</option>
                                <option value="Gas cooker">Gas cooker</option>
                                <option value="Micro Wave">Micro Wave</option>
                            </select>
                        </div>
                    </div>
                    <div id="text_area1" class="form-group row">
                        <label class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ කරයේ වටිනාකම</label>
                        <div class="col-sm-12">
                            <select id="show1" class="form-control col-sm-12" name="carValue">
                                <option value="මිලියන  3 ට අඩු">මිලියන  3 ට අඩු</option>
                                <option value="මිලියන 3 ත් 10 අතර">මිලියන 3 ත් 10 අතර</option>
                                <option value="මිලියන 10 ට වැඩි">මිලියන 10 ට වැඩි</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ වෛද්‍ය අවශ්‍යතා සඳහා භාවිතා කරන ස්ථාන සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="governmentHospitals[]" multiple="multiple" required>
                                <option value=""></option>
                                <option value="රජයේ රෝහල්">රජයේ රෝහල්</option>
                                <option value="පෞද්ගලික සාත්තු නිවාස">පෞද්ගලික සාත්තු නිවාස</option>
                                <option value="පවුලේ වෛද්‍යවරයා ">පවුලේ වෛද්‍යවරයා </option>
                                <option value="ආයුර්වේද රෝහල්">ආයුර්වේද රෝහල්</option>
                            </select>

                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">පෞද්ගලික රෝහල් </label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="privetHospitals[]" multiple="multiple" required>
                                <option value=""></option>
                                <option selected value="ආසිරි">ආසිරි</option>
                                <option value="ඩර්ඩන්ස්">ඩර්ඩන්ස්</option>
                                <option value="ලංකා">ලංකා</option>
                                <option value="නවලෝක">නවලෝක</option>
                                <option value="හේමාස්">හේමාස්</option>
                            </select>

                        </div>
                    </div>
                </div>
                <div style="overflow:auto;">
                    <div style="float:right;">
                        <button type="button" id="prevBtn" onclick="nextPrev(-1)">Previous</button>
                        <button type="button" id="nextBtn" onclick="nextPrev(1)">Next</button>
                    </div>
                </div>
                <!-- Circles which indicates the steps of the form: -->
                <div style="text-align:center;margin-top:40px;">
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                </div>
            </form>

sanjayacloud left a reply on Array To String Conversion (SQL: Insert Into `questions

@CRONIX - i have plain it store in single column as array.how can I store it?

sanjayacloud left a reply on Array To String Conversion (SQL: Insert Into `questions

@AMK - It does not work. same error given..

22 Nov
4 months ago

sanjayacloud left a reply on Array To String Conversion (SQL: Insert Into `questions

@AMK - Thanks. I wil check and let you know.

sanjayacloud left a reply on Array To String Conversion (SQL: Insert Into `questions

@JLRDW - That is I am trying to ask,"Are you use credit card" not the credit card details. Ok. I need how to insert array type data in column.

sanjayacloud left a reply on Array To String Conversion (SQL: Insert Into `questions

@CRONIX - @cronix i have plain it store in single column as array.how can I store it?

sanjayacloud started a new conversation Array To String Conversion (SQL: Insert Into `questions

I got above error when I insert the data.

This is my blade

   <form id="regForm" action="insert" method="post">
                @csrf
                <h3>ඔබගේ වතගොත</h3>
                <!-- One "tab" for each step in the form: -->
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ රැකියා තත්ත්වය සඳහන් කරන්න?</label>
                        <div class="col-sm-12">
                            <select id="show" class="form-control col-sm-12" name="job">
                                <option >රැකියාව</option>
                                <option  value="රැකියා විරහිත">රැකියා විරහිත</option>
                                <option value="පූර්ණ කාලීන සේවය">පූර්ණ කාලීන සේවය</option>
                                <option value="අර්ධ කාලීන සේවය">අර්ධ කාලීන සේවය</option>
                                <option value="ගෘහණියකි">ගෘහණියකි</option>
                            </select>
                        </div>
                    </div>
                    <div id="text_area" class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ රැකියාවක නියුතු නම් රැකියා තනතුර සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="jobPosition">
                                <option value="නුපුහුණු සේවක">නුපුහුණු සේවක</option>
                                <option value="විධායක">විධායක</option>
                                <option value="කළමණාකරු">කළමණාකරු</option>
                                <option value="ජ්‍යෙෂ්ඨ කළමණාකරු">ජ්‍යෙෂ්ඨ කළමණාකරු</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ ක්‍රෙඩිට් කාඩ්පත් පරිහරණය කරනවාද? </label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="creditCard">
                                <option value="ඔව්">ඔව්</option>
                                <option value="නැත">නැත</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ භාවිතා කරන විද්‍යුත් මාධ්‍ය සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="ElectricMedia[]" multiple="multiple">
                                <option selected value="රවයිබර්">වයිබර්</option>
                                <option value="වට්ස් ඇප්">වට්ස් ඇප්</option>
                                <option value="ෆේස්බුක්">අෆේස්බුක්</option>
                                <option value="යූ ටියුබ්">යූ ටියුබ්</option>
                                <option value="Gossip Lanka">Gossip Lanka</option>
                                <option value="Hiru News">Hiru News</option>
                                <option value="Ada Derana">Ada Derana</option>
                                <option value="Linked in">Linked in</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ විද්‍යුත් මාධ්‍යය නිරත වන කාලසීමාව සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="mediaSpend">
                                <option value="දවසකට මිනිත්තු 0 - 30 ">දවසකට මිනිත්තු 0 - 30 </option>
                                <option value="දවසකට මිනිත්තු 30 - පැය 1">දවසකට මිනිත්තු 30 - පැය 1</option>
                                <option value="දවසකට පැය 1 - 2 ">දවසකට පැය 1 - 2 </option>
                                <option value="දවසකට පැය  2 වඩා වැඩි">දවසකට පැය  2 වඩා වැඩි</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ විවාහක අවිවාහක බව සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="civilStatus">
                                <option value="අවිවාහක">අවිවාහක</option>
                                <option value="විවාහක">විවාහක</option>
                                <option value="වැන්දඹු">වැන්දඹු</option>
                                <option value="දික්කසාද">දික්කසාද</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ අධ්‍යාපන මට්ටම සඳහන් කරන්න </label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="education">
                                <option value="5 ශ්‍රේණිය දක්වා">5 ශ්‍රේණිය දක්වා</option>
                                <option value="8 ශ්‍රේණිය දක්වා">8 ශ්‍රේණිය දක්වා</option>
                                <option value="සාමාන්‍ය පෙළ දක්වා">සාමාන්‍ය පෙළ දක්වා</option>
                                <option value="උසස් පෙළ දක්වා">උසස් පෙළ දක්වා</option>
                                <option value="වෘත්තීය මට්ටම දක්වා">වෘත්තීය මට්ටම දක්වා</option>
                                <option value="පශ්චාත් උපාධිය ">පශ්චාත් උපාධිය </option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">කලත්රයාගේ (ස්වාමියා / භාර්යාවගේ) - තොරතුරු:-
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">කලත්රයාගේ වයස</label>
                        <div class="col-sm-12">
                            <input type="number" class="form-control" name="ageOfDependent">
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">කලත්රයාගේ රැකියා තත්ත්වය  සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="jobOfDependent">
                                <option value="නුපුහුණු සේවක">නුපුහුණු සේවක</option>
                                <option value="විධායක">විධායක</option>
                                <option value="කළමණාකරු">කළමණාකරු</option>
                                <option value="ජ්යෙෂ්ඨ කළමණාකරු">ජ්යෙෂ්ඨ කළමණාකරු</option>
                                <option value="ව්යාපාර හිමිකරු">ව්යාපාර හිමිකරු</option>
                                <option value="ගෘහණියකි">ගෘහණියකි</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ක්‍රෙඩිට් කාඩ්පත් පරිහරණය කරනවාද ?</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="creditCardOfDependent">
                                <option value="ඔව්">ඔව්</option>
                                <option value="නැත">නැත</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">දරුවන් ගණන</label>
                        <div class="col-sm-12">
                            <select id="child" class="form-control col-sm-12" name="children">
                                <option selected value="0">0</option>
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                            </select>
                        </div>
                        <div id="c1" class="form-group col-md-6 mt-md-3">
                            <label>පලමු දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_1" class="form-control" >
                        </div>
                        <div id="c2" class="form-group col-md-6 mt-md-3">
                            <label >දෙවන දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_2" class="form-control">
                        </div>
                        <div id="c3" class="form-group col-md-6">
                            <label>තුන්වන දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_3" class="form-control" >
                        </div>
                        <div id="c4" class="form-group col-md-6">
                            <label >හතරවන දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_4" class="form-control">
                        </div>
                        <div id="c5" class="form-group col-md-6">
                            <label>පස්වන දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_5" class="form-control" >
                        </div>
                        <div id="c6" class="form-group col-md-6">
                            <label >සයනව දරුවාගේ වයස</label>
                            <input type="number" name="ageOfChild_6" class="form-control">
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <p class="mt-md-5">මාසික ගෘහස්ථ වියදම</p>
                    <p class="text-success" id="t"></p>
                    <p id="error"></p>
                    <div class="form-group row">
                        <div  class="form-group col-md-6 mt-md-3">
                            <label>ආහාර </label>
                            <input type="number" id="meals" name="meals" class="form-control" value="0">
                        </div>
                        <div class="form-group col-md-6 mt-md-3">
                            <label >නිවාඩුව ගතකරන්න </label>
                            <input type="number" id="holiday" name="holiday" class="form-control" value="0">
                        </div>
                        <div class="form-group col-md-6 mt-md-3">
                            <label>ඉතිරි කිරීම්  </label>
                            <input type="number" id="savings" name="savings" class="form-control" value="0">
                        </div>
                        <div class="form-group col-md-6 mt-md-3">
                            <label >ණය ගෙවිම </label>
                            <input type="number" id="loan" name="loan" class="form-control" value="0">
                        </div>
                        <div class="form-group col-md-6 mt-md-3">
                            <label >අනික්</label>
                            <input type="number" id="other" name="other" class="form-control" value="0">
                        </div>

                    </div>
                    <div class="form-group row">
                        <div class="form-group col-md-6 mt-md-3">
                            <button type="button" class="btn btn-outline-warning" id="all" onclick="calculate()">එකතුව</button>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ වැඩිපුර මිලදී ගන්නා වෙළෙඳ නාමයන් සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="brands[]" multiple="multiple">
                                <option selected value="එළිෆන්ට් හවුස් සොසේජස්">එළිෆන්ට් හවුස් සොසේජස්</option>
                                <option value="එළිෆන්ට් හවුස් සිසිල් බීම">එළිෆන්ට් හවුස් සිසිල් බීම</option>
                                <option value="එළිෆන්ට් හවුස් අයිස්ක්‍රීම්  ">එළිෆන්ට් හවුස් අයිස්ක්‍රීම්   </option>
                                <option value="ඇන්කර්">ඇන්කර්</option>
                                <option value="ඇස්ට්‍රා">ඇස්ට්‍රා</option>
                                <option value="රින්">රින්</option>
                                <option value="සර්ෆෙක්සල්">සර්ෆෙක්සල්</option>
                                <option value="දීවා">දීවා</option>
                                <option value="නෙස්ටමෝල්ට්">නෙස්ටමෝල්ට්</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ වැඩිපුර බඩු මිලදී ගන්නා ස්ථානය සඳහන් කරන්න (බොහෝ විට)</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12" name="superMarket">
                                <option value="කීල්ස් සුපර්">කීල්ස් සුපර්</option>
                                <option value="කාගීල්ස්">කාගීල්ස්</option>
                                <option value="ආර්පිකෝ">ආර්පිකෝ</option>
                                <option value="ලාෆ්">ලාෆ්</option>
                                <option value="සතොස">සතොස</option>
                                <option value="කෝප් සුපර්">කෝප් සුපර්</option>
                                <option value="තොග ගබඩාව">තොග ගබඩාව</option>
                                <option value="සිල්ලර බඩු වෙළෙඳසැලෙන්">සිල්ලර බඩු වෙළෙඳසැලෙන්</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබ බඩු මිලදී ගන්නා ස්ථානය සඳහන් කරන්න (වෙනත්)</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="superMarkets[]" multiple="multiple">
                                <option selected value="කීල්ස් සුපර්">කීල්ස් සුපර්</option>
                                <option value="කාගීල්ස්">කාගීල්ස්</option>
                                <option value="ආර්පිකෝ">ආර්පිකෝ</option>
                                <option value="ලාෆ්">ලාෆ්</option>
                                <option value="සතොස">සතොස</option>
                                <option value="කෝප් සුපර්">කෝප් සුපර්</option>
                                <option value="තොග ගබඩාව">තොග ගබඩාව</option>
                                <option value="සිල්ලර බඩු වෙළෙඳසැලෙන්">සිල්ලර බඩු වෙළෙඳසැලෙන්</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">ඔබ වැඩි වශයෙන් ගණුදෙනු කරන්නේ පහත සඳහන් කුමන බැංකු සමගද?
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">රජයේ</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="governmentBanks[]" multiple="multiple">
                                <option selected value="BOC">BOC</option>
                                <option value="Peoples Bank">Peoples Bank</option>
                                <option value="NSB">NSB</option>
                            </select>

                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">පෞද්ගලික</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="privetBanks[]" multiple="multiple">
                                <option selected value="සම්පත් බැංකුව">සම්පත් බැංකුව</option>
                                <option value="කොමර්ෂල් බැංකුව">කොමර්ෂල් බැංකුව</option>
                                <option value="සෙලාන් බැංකුව">සෙලාන් බැංකුව</option>
                                <option value="හැටන් නැෂනල් බැංකුව">හැටන් නැෂනල් බැංකුව</option>
                                <option value="NTB">NTB</option>
                                <option value="NDB">NDB</option>
                                <option value="DFCC">DFCC</option>
                                <option value="වෙනත්">වෙනත්</option>
                            </select>

                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3"> ඔබ භාවිතා කරන ජීවිත රක‍ෂණ සමාගම් මොනවාද? </label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="insurance[]" multiple="multiple">
                                <option selected value="කිසිවක් නැත">කිසිවක් නැත</option>
                                <option value="යූනියන් ඇෂුවරන්ස්">යූනියන් ඇෂුවරන්ස්</option>
                                <option value="ෙලින්කෝ ඉන්ෂූවරන්ස්">සෙලින්කෝ ඉන්ෂූවරන්ස්</option>
                                <option value="ශ්‍රී ලංකා ඉන්ෂූවරන්ස්">ශ්‍රී ලංකා ඉන්ෂූවරන්ස් </option>
                                <option value="AIA">AIA</option>
                                <option value="වෙනත්">වෙනත්</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ කල්පවත්නා භාණ්ඩ හිමිකම සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple show1" name="assets[]" multiple="multiple">
                                <option selected value="ෆි්‍රජ්">ෆි්‍රජ්</option>
                                <option value="කාර්">කාර්</option>
                                <option value="රූපවාහිනී">රූපවාහිනී</option>
                                <option value="රෙදි සෝදන යන්ත්‍ර">රෙදි සෝදන යන්ත්‍ර</option>
                                <option value="Cable TV">Cable TV</option>
                                <option value="මෝටර් සයිකල්">මෝටර් සයිකල්</option>
                                <option value="ලැප්ටොප්">ලැප්ටොප්</option>
                                <option value="Gas cooker">Gas cooker</option>
                                <option value="Micro Wave">Micro Wave</option>
                            </select>
                        </div>
                    </div>
                    <div id="text_area1" class="form-group row">
                        <label class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ කරයේ වටිනාකම</label>
                        <div class="col-sm-12">
                            <select id="show1" class="form-control col-sm-12" name="carValue">
                                <option value="මිලියන  3 ට අඩු">මිලියන  3 ට අඩු</option>
                                <option value="මිලියන 3 ත් 10 අතර">මිලියන 3 ත් 10 අතර</option>
                                <option value="මිලියන 10 ට වැඩි">මිලියන 10 ට වැඩි</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ වෛද්‍ය අවශ්‍යතා සඳහා භාවිතා කරන ස්ථාන සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="governmentHospitals[]" multiple="multiple">
                                <option selected value="රජයේ රෝහල්">රජයේ රෝහල්</option>
                                <option value="පෞද්ගලික සාත්තු නිවාස">පෞද්ගලික සාත්තු නිවාස</option>
                                <option value="පවුලේ වෛද්‍යවරයා ">පවුලේ වෛද්‍යවරයා </option>
                                <option value="ආයුර්වේද රෝහල්">ආයුර්වේද රෝහල්</option>
                            </select>

                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">පෞද්ගලික රෝහල් </label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="privetHospitals[]" multiple="multiple">
                                <option selected value="ආසිරි">ආසිරි</option>
                                <option value="ඩර්ඩන්ස්">ඩර්ඩන්ස්</option>
                                <option value="ලංකා">ලංකා</option>
                                <option value="නවලෝක">නවලෝක</option>
                                <option value="හේමාස්">හේමාස්</option>
                            </select>

                        </div>
                    </div>
                </div>
                <div style="overflow:auto;">
                    <div style="float:right;">
                        <button type="button" id="prevBtn" onclick="nextPrev(-1)">Previous</button>
                        <button type="button" id="nextBtn" onclick="nextPrev(1)">Next</button>
                    </div>
                </div>
                <!-- Circles which indicates the steps of the form: -->
                <div style="text-align:center;margin-top:40px;">
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                    <span class="step"></span>
                </div>
            </form>

sanjayacloud left a reply on Form Validation In Select Box

@TISUCHI - @tisuchi I try like below. but it's not work..

 $request->validate([

            'job' => 'required|array|min:1',

            'jobPosition' => 'required|array|min:1',

            'governmentHospitals' => 'required|array|min:1'

     ]);

sanjayacloud started a new conversation Form Validation In Select Box

Can anyone explain about the form validation with select box. my blade like below.

        <div class="tab">
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">ඔබගේ වෛද්‍ය අවශ්‍යතා සඳහා භාවිතා කරන ස්ථාන සඳහන් කරන්න</label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="governmentHospitals[]" multiple="multiple">
                                <option selected value="රජයේ රෝහල්">රජයේ රෝහල්</option>
                                <option value="පෞද්ගලික සාත්තු නිවාස">පෞද්ගලික සාත්තු නිවාස</option>
                                <option value="පවුලේ වෛද්‍යවරයා ">පවුලේ වෛද්‍යවරයා </option>
                                <option value="ආයුර්වේද රෝහල්">ආයුර්වේද රෝහල්</option>
                            </select>

                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="colFormLabelSm" class="col-sm-12 col-form-label col-form-label-sm mb-md-3">පෞද්ගලික රෝහල් </label>
                        <div class="col-sm-12">
                            <select class="form-control col-sm-12 js-example-basic-multiple" name="privetHospitals[]" multiple="multiple">
                                <option selected value="ආසිරි">ආසිරි</option>
                                <option value="ඩර්ඩන්ස්">ඩර්ඩන්ස්</option>
                                <option value="ලංකා">ලංකා</option>
                                <option value="නවලෝක">නවලෝක</option>
                                <option value="හේමාස්">හේමාස්</option>
                            </select>

                        </div>
                    </div>
                </div>