naykel

naykel

Member Since 1 Year Ago

Experience Points
10,680
Total
Experience

4,320 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
99
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.

Level 3
10,680 XP
Apr
26
3 months ago
Activity icon

Started a new Conversation Help With Mulit Layer Eager Loaded Relationship

I have a few relationships set up to reach into several tables and return a collection of eager loaded data.

studentCourse->belongsTo->Course
course->hasMany->Sections
sections->haveMany->media

In the controller I eager load all the data with

// collection of course data
$courseData = $studentCourse->load('course.sections.media');

This works perfectly but my problem is that I need one final relationship

media->hasMany->studentLesson

When I try to eager load the final relationship it returns all related records, not just the one I need

// This is returning all the related student lessons, not just the relevant one
$courseData = $studentCourse->load('course.sections.media.studentLesson');

This would be the query but I can not figure out where to put it.

SELECT * FROM student_lessons WHERE media_id = $mid and student_course_id = $scid

Any help would be greatly appreciated.

Feb
27
5 months ago
Activity icon

Replied to How To Access Eager Loaded Records From Single Model

Thank you @snapey this was exactly the answer.

Activity icon

Started a new Conversation How To Access Eager Loaded Records From Single Model

I am trying to work out how to access eager loaded when only dealing with a single record.

Here I am querying the database to return a menu named ‘main’ and eager loading the links related to this menu.

$menu =  Menu::where('name', 'main')->with('links')->get();

I want to loop throught and display the links but I can not figure out ho to do it without looping through the single menu first which seems counter productive because there is only one menu.

@foreach ($menu as $m)
    @foreach ($m->links as $l)
        {{ $l->name }}
    @endforeach
@endforeach

I have tried the following but it says that links in not in the collection.

@foreach ($menu->links as $menu)
    {{ $menu->name }}
@endforeach
}

Is there a better way?

Thanks in advance.

Feb
25
5 months ago
Activity icon

Replied to URI Not Working As Expected

Yes, I am looping through a collection and passing in the $page object. I actuall tried to pass in the id before I posted but got the same problem.

I have just gone back to using the named route because this is doing my head in. I have other routes where I have used the URI and they work fine so I will just put this unkown mystery category.

Feb
24
5 months ago
Activity icon

Started a new Conversation URI Not Working As Expected

I have a form and I can not figure out why I can not get the URI to work. I have no problem with the named route but for what ever reason the URI does not work as expected.

Route and Controller Method

Route::patch('/abc/pages/{page}', '[email protected]')->name('abc.pages');

public function update(Page $page){
    dd($page);
}

The named route works fine, exactly as expected it dumps the $page

<form method="POST" action="{{ route('abc.pages',  $page) }}">

However, when using the uri it returns a page not found and throws the $page object into the url

<form method="POST" action="/abc/pages/{{ $page }}">

What am I missing here?