panthro

Member Since 1 Year Ago

Experience Points
870
Total
Experience

4,130 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
870 XP
Mar
21
1 month ago
Activity icon

Replied to Remember Me On Log In?

Thanks, makes sense!

Activity icon

Started a new Conversation Remember Me On Log In?

Can someone explain to me how remember me i supposed to work on a form.

I have a log in form, if I do not check remember me, no remember_me token exists next to my user in the database.

Alternatively, if I check remember me, a remember_me token appears next to my user in the database.

So it appears to be working properly from a technical perspective.

But what is suppose to happen from a user perspective?

  • I have cleared all cookies for my site.
  • I log in without checking remember me.
  • There is no remember_me token in the database.
  • I close the browser down.
  • Open the browser and my site still thinks I'm logged in.

What is supposed to be happening? Should the site not think I'm logged out?

Mar
11
1 month ago
Activity icon

Replied to Creating A Feed - Create Dedicated Table Or Use A View?

But if you made a model for a view then you could just eager load those relationships - no?

Activity icon

Replied to Creating A Feed - Create Dedicated Table Or Use A View?

Thanks for the advice, if I needed to update a view it would only be in one place.

If I was to use polymorphic on their own dedicated table, something like feed table, then every time I inserted a row into an underlying table, I would also have to update the parent relationship on the feed table.

Is this what you would suggest doing.

@sr57 suggests a view, which would manage that aspect for me.

I'm really stuck here with which direction to go and appreciate your answers so far.

Activity icon

Started a new Conversation Creating A Feed - Create Dedicated Table Or Use A View?

I need to build a feed for an initial set of 3 underlying tables, yet more may come later.

As far as I can see I have two options:

Create a MySQL view of a union of the 3 tables (or do a union at run time), access this via it's own model. Or...

When I save a row to an underlying table, also save a row to a feed table that has a polymorphic relation to one of the 3 underlying tables.

Which would be the best performance wise?

Mar
07
2 months ago
Activity icon

Replied to Get Attribute Inside Model?

Thanks for all your help, I discovered the reason that $this->column is not working was because I was using eager loading, works without it, unfortunately, I need eager loading, so back to having a re-think of how to dynamically load poly relationships

Mar
06
2 months ago
Activity icon

Started a new Conversation Get Attribute Inside Model?

I have a table that has a column type.

I wish to set my polymorphic relationship based on this type.

I therefore need access to the rows type inside the model:

 public function getMorphClass()
    {
        return $this->type;
    }

But the above returns null.

How can I get each row's type inside the model?

Feb
28
2 months ago
Activity icon

Replied to Pass Paginated Data To Alpine? (same Issue Also Applies To Vue)

Does anyone know what magic happens to collections in a view as per my above post?

Feb
26
2 months ago
Activity icon

Replied to Pass Paginated Data To Alpine? (same Issue Also Applies To Vue)

Thanks - so does something magical happen to collections in blade views when output into blade as per my first example: <div x-data="{ items: {{ $users }} }">

Activity icon

Replied to Pass Paginated Data To Alpine? (same Issue Also Applies To Vue)

Thanks for your reply.... do you know why I can pass in all yet not paginated items without an encode?

Activity icon

Started a new Conversation Pass Paginated Data To Alpine? (same Issue Also Applies To Vue)

I get my model

$users = User::all();

Pass to my view:

return view('pages.user.index')
        ->with('users', $users);

But now I want to pass into alpine:

<div x-data="{ items: {{ $users }} }">

That all works!

But if I do:

$users = User::paginate(20);

Then:

<div x-data="{ items: {{ $users->items() }} }">

I get:

htmlspecialchars() expects parameter 1 to be string, array given

How can I pass a paginated set of data into alpine?

Dec
27
4 months ago
Activity icon

Replied to Creating A Feed Of Underlying Tables?

Thank you @sr57, does any one else have an opinion?

Dec
23
4 months ago
Activity icon

Started a new Conversation Creating A Feed Of Underlying Tables?

I have 3 tables, book, film and music. I want to present this data individually, as in a list of books and as a feed of all three types.

I cannot decide which route to take to implement the feed...

a) Create a MySQL view, based on a union of the three tables above. I'd then read this and it would automatically update when the underlying tables update. The view would have some null columns as the 3 underlying tables do not have completely the same set of fields.

OR

b) Create a feed table with a one to one polymorphic relationship to either book, film and music. When I add a row to one of the underlying tables, I must create the reference on the parent feed table.

It's also worth noting that with either option when loading, I would still need to access the underlying book, film or music table as I would want to get all feed items (book, film or music) and eager load additional relationships defined on the book, film or music tables, for example, comments.

Any advice is appreciated.