Maximus1

Member Since 1 Year Ago

Experience Points
770
Total
Experience

4,230 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 your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

  • Community Pillar

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

Level 1
770 XP
Dec
09
1 month ago
Activity icon

Replied to How To Display A Value In The First Column Of A Generated Table?

I already used your recommended method in the code I sent. It is not the solution.

Activity icon

Started a new Conversation How To Display A Value In The First Column Of A Generated Table?

This is the table => https://imgur.com/a/E4dwRmY

When I apply the code below it displays same score across the parts. What I want is for it to display score from the database only under the first part(i.e Part1). The other parts will be manually inputted. The Parts (the columns) are dynamically generated which means they can be 3, 4 or 5 parts but I only want to automatically display the score for the first part. The ids of the column parts are dynamic as well since they are generated.

                                             <thead>
                        <tr>
                            <th colspan="{{$parts_numbers + 1}}"></th> 
                        </tr>
                        <tr>
                            @foreach($part_form as $part)
                            <th>{{$part->title}}</th>
                            @endforeach
                        </tr>
                    </thead>
                    <tbody>                        
                        @php $colspan = 3; $counter = 0;  @endphp
                        @foreach($students as $student)                       
                        @foreach($part_form as $part)
                            <td>
                                <div>
                                <input type="hidden" name="score_setup_ids[]" value="{{$part->id}}">
                                <?php
                                 $part_score = App\MyScores::where([['class_id', $part->class_id], ['subject_id', $part->subject_id], ['exam_id', $exam->id], ['student_id', $student->id]])->first();
                                ?>
                                <input class="primary-input marks_input" type="number" step="any" name="marks[{{$student->id}}][{{$part->id}}]" value="{{!empty($part_score->mark)?$part_score->mark:0}}">
                                </div>                                
                            </td>
                            @endforeach
                        @endforeach
Nov
25
1 month ago
Activity icon

Replied to How To Update An Existing Array Of Items

Great! @marianomoreyra It worked. Perfecto! Can you please explain the logic behind your solution?

Nov
24
2 months ago
Activity icon

Replied to How To Update An Existing Array Of Items

Your solution didn't work

Activity icon

Replied to How To Update An Existing Array Of Items

Thank you @marianomoreyra . I tried your solution but it gave this error

  Illuminate \ Database \ QueryException
Array to string conversion (SQL: update `questionanswer`
Activity icon

Started a new Conversation How To Update An Existing Array Of Items

I am trying to add marks to questions answered by a specific student. It is an array of existing questions and answers and i want to add marks to them.

When i add the marks and save , i get this error "BadMethodCallException Method Illuminate\Database\Eloquent\Collection::save does not exist."

This is my view

 <?php $i = 1; ?>
                                    @foreach($questions as $question)
                                    @if ($i > 1) @endif
 
                                    <tr>
                                    <td width="60%">
								  <ul class="list-group">
								  <li class="list-group-item"><label class="control-label"><strong>Question {{ $i }}<br />{{$question->question}}</strong></label>					
								<div class="col-sm-12">
								<input type="hidden" name="questions[{{ $i }}]" value="{{ $question->id }}"><br>
                                <div class="input-effect">
                                                <textarea class="primary-input form-control{{ $errors->has('result') ? ' is-invalid' : '' }}" cols="0" rows="5" name="result[{{ $question->id }}]">{{$question->result}}</textarea>
                                            </div>
                                            <?php $i++; ?>
								</div>
                                        </td>
                                    <td width="20%" class="text-right">
                                        <div class="mt-20">
                                            <input type="number" name="mark[{{ $question->id }}]" value="{{$question->mark}}">
                                        </div>
                                        <div>
                                                <textarea class="primary-input form-control{{ $errors->has('reason') ? ' is-invalid' : '' }}" cols="0" rows="3" name="reason[{{ $question->id }}]"></textarea>
                                            </div>
                                    </td>                                    
                                        </tr>
                                    @endforeach

This is controller to store the marks

public function MarkStore(Request $request)
   {

      $questions = QuestionAnswer::where('quiz', 1)->where('user', 1)
                              ->get();
           
               $questions->mark = $request->input('mark');
               $questions->reason = $request->input('reason');
               $questions->save();
   } 

How do i store the marks without errors?

Oct
13
3 months ago
Oct
12
3 months ago
Activity icon

Started a new Conversation How To Get Minimum Value Without Zero?

With this function, i get the lowest number but strangely it captured 0 as the lowest number in some cases. How do i make it ignore 0?

 ``` public static function MinNumber($group_id, $segment_id){
    
    try {
        $post = Position::where([
            ['group_id',$group_id],
            ['segment_id',$segment_id]
            ])->orderBy('position_number', 'ASC')->first();

            return $post;
    } catch (\Exception $e) {
        $post=[];
        return $post;
    }
}        ```
Activity icon

Replied to How To Sum Carbon Converted Dates?

Please why is @silencebringer solution bad?

Activity icon

Replied to How To Sum Carbon Converted Dates?

It worked.. Final solution provided by @silencebringer and one time solution by @michaloravec both worked.. Many thanks.

Activity icon

Replied to How To Sum Carbon Converted Dates?

Thank you @michaloravec . So close but it only gave the age of the last member and not the sum of all the member's ages.

Activity icon

Replied to How To Sum Carbon Converted Dates?

i am after sum of every members age

Activity icon

Replied to How To Sum Carbon Converted Dates?

"This could have worked but rather than give a sum of all members age , it only results to the age of the last member. In other words, just one member's age is displayed."

Activity icon

Replied to How To Sum Carbon Converted Dates?

I have the adjusted code but its not working.

  ``` $membersage = Member::where('members.id', '=', $request->member)
    ->where('active_status', 1)           
    ->sum(function ($member) {
        return \Carbon\Carbon::parse($member->date_of_birth)->age;
    }); ```

No errors but just blank

Oct
11
3 months ago
Activity icon

Replied to How To Sum Carbon Converted Dates?

Thank you @silencebringer . Your solution did not work .

It gave this error :

``` ParseError
    syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')' ```
Activity icon

Started a new Conversation How To Sum Carbon Converted Dates?

I can convert date of births in db to AGE using carbon like so \Carbon\Carbon::parse('members.date_of_birth')->age

but how do i sum AGE from date of births. This is my controller

     ``` $membersage = Member::where('members.id', '=', $request->member)
        ->where('active_status', 1)           
        ->sum(\Carbon\Carbon::parse('members.date_of_birth')->age);  ```  

This did not work.