suhaskunte777

suhaskunte777

Member Since 1 Year Ago

Experience Points
140
Total
Experience

4,860 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
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 1
140 XP
Feb
25
7 months ago
Activity icon

Replied to Where Are You All From?

Maharashtra, India

Activity icon

Started a new conversation How To Use Multi Select Box On Dynamically Add Fields & Jquery .length Function Incorrectly

Hi,

  1. I added function to add remove field set. I can add field set but I am trying to remove field it not work only work on first table row.

  2. I need count of tr in current form so i used jquery .length function but it showing wrong result ( incrementing by 2)

  3. I am working on laravel project where i need to dynamically add field. I know i have to set name='variablename[]'. But how i can do same for multiple select box. In multi select box we already set name='variablename[]' I tried with name='variablename[][]' but i am just getting each option new array.

here is my code snippet

<body>
<div class="container">
    <div class="m-3">
        {!! Form::open(['route' => 'exam.store']) !!}
        {!! Form::token() !!}
        <div class="form-group row">
            {!! Form::label('name', 'Exam Name', ['class' => 'col-sm-2 col-form-label']) !!}
            <div class="col-sm-10">
                {!! Form::text('name', '', ['placeholder'=> 'Exam Name','class' => 'form-control']) !!}
            </div>
        </div>
        <div class="text-center"><i class="btn btn-success fa fa-plus 7x addrow" style="margin-bottom: 20px;"> Add New Title</i></div>
        <table class="inputtable">
            <thead>
            <tr>
                <th scope="col">Title</th>
                <th scope="col">Medium</th>
                <th scope="col"></th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td data-label="title">{!! Form::text("title[]", "", ["placeholder"=> "Title","class" => "form-control"]) !!}</td>
                <td data-label="medium">{!! Form::select("medium[]", ["7" => "A","1" => "B","3" => "C"], null, ["class" => "form-control select2multiple", "multiple"=>"multiple", "required"]) !!}</td>
                <td data-label="Remove"><a href="#" class="remove"><i class="btn btn-danger fa fa-times"></i></a></td>
            </tr>
            </tbody>
        </table>
    </div>
</div>

<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script>
    $('.addrow').on('click', function () {
        addRow();
        alert($("tbody tr").length);
    });
    function addRow() {
        var tr = '<tr>\n' +
            '                <td data-label="title">{!! Form::text("title[]", "", ["placeholder"=> "Title","class" => "form-control"]) !!}</td>\n' +
            '                <td data-label="medium">{!! Form::select("medium[]", ["7" => "A","1" => "B","3" => "C"], null, ["class" => "form-control select2multiple", "multiple"=>"multiple", "required"]) !!}</td>\n' +
            '                <td data-label="remove"><a href="#" class="remove"><i class="btn btn-danger fa fa-times"></i></a></td>\n' +
            '            </tr>';
        $('tbody').append(tr);
    }
    $('.remove').on('click',function () {
        $(this).parent().parent().remove();
    })
</script>
Oct
24
11 months ago
Activity icon

Replied to Undefined Offset: 0 In Foreach Loop

@Cronix as per your advise i search my whole array and i get empty $item['datas'] thats where it showing error. Thanks .....

Oct
23
11 months ago
Activity icon

Replied to Undefined Offset: 0 In Foreach Loop

Thanks for Help. I made mistake in understanding data. Actually I am getting another set of array in my $item['datas'] it need another foreach loop to access it.

print_r($item['datas']);

And it gives me following result. Array ( [0] => Array ( [id] => 2 [pivot] => Array ( [qnode_id] => 1 [qanswer_id] => 2 ) ) ) 0

now with foreach($item['datas'] as value) { print_r($value['id']); }

getting desired result.

Activity icon

Replied to Undefined Offset: 0 In Foreach Loop

Thanks to reply @goatshark I tried again. It working and giving me data when i do dd() in same foreach loop but when i tried without dd() it not working. I also worked on such array in Laravel 5.6 and last month 5.7, their it working properly.

Activity icon

Started a new conversation Undefined Offset: 0 In Foreach Loop

I am gettting issue in foreach loop where i am converting data into array. dd my all data is recieving but in forloop it not working. I am using Laravel 5.7

    "php": "^7.1.3",
    "barryvdh/laravel-debugbar": "^3.2",
    "fideloper/proxy": "^4.0",
    "laravel/framework": "5.7.*",
    "laravel/tinker": "^1.0",
    "laravelcollective/html": "^5.7",
    "sven/artisan-view": "^3.1",
    "way/generators": "^3.0"

hear is my code in controller '''

$node = Qnode::select('id', 'main_id')->with('datas')->get()->toArray(); foreach ($node as $item) {

//this code give me right result 
dd($item['datas'][0]['pivot']['qanswer_id']);

//but here i am getting Undefined Offset:0
        $data[$item['id']] = ['main_id' => $item['main_id'], 'data_id' => $item['datas'][0]['pivot']['qanswer_id']];
    }
    Auth::user()->qnodes()->sync($data);

'''