Member Since 1 Year Ago

Experience Points

4,270 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
Best Reply Awards
Best Reply
  • 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.


    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.


    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 3
10,730 XP
7 months ago
Activity icon

Replied to Three Way Relationship Or Relationship With A Relationship?

@ROERJO - That's what I'm going to so.

I looked at the Pivot model source, and it just inherits from the main Model with an extra Pivot trait, but I'm guessing that's what's used behind the scenes anyway, so by defining my own that inherits from that it shouldn't be much of a performance hit.

Activity icon

Replied to Three Way Relationship Or Relationship With A Relationship?

@SHEZ1983 - It's more like:

  1. shops can do x services
  2. Some services are available for only some brands, but not others, (still on the Cars example, a garage needs computer software from Ford to turn off your Ford's Check Engine light, so they might offer "Turn off Check Engine Light" for Ford, but not Chevy).

Someone in Slack pointed me at the fact that when making the "wasteful" providesService model I would probably be extending a Illuminate\Database\Eloquent\Relations\Pivot object, which I'm guessing is used behind the scenes anyway, so it's less wasteful than I had thought. I'm going to give that a shot and see how it works.

Activity icon

Replied to Three Way Relationship Or Relationship With A Relationship?

@ROERJO - I looked at hasManyThrough, and it doesn't seem to quite work. If I take the "wasteful" approach of making a ProvidesService model then I'll be able to use hasManyThrough to get the brands that a Shop can service, which may be useful.

7 months ago
Activity icon

Started a new conversation Three Way Relationship Or Relationship With A Relationship?

I'm puzzling over how to set up this relationship in Laravel, (I'm converting a legacy app):

I have Repair Shops, which provide different types of repairs, on different brands of vehicles.

For example, Shop A might repair Brakes but not Exhaust Systems for Ford vehicles. Shops are required to say what services they provide, (Exhaust repair), but adding a brand is optional. I have Shop, Service, and Brand tables in the DB. Shop and Service have a belongsToMany relationship using the provides_service pivot table. In the legacy system I have a 3-way pivot table to specify what Services can be done to each Brand in each Shop.

Laravel doesn't seem to do 3-way relationships well, (or does it? If so, point me there!). So, I feel like it would make sense to create a belongsToMany between the provides_service relation and the Brand. So, is there a way to set up a relationship between a Model and another Relationship in Laravel, or do I have to create a ProvidesService model? Creating a ProvidesService model seems wasteful, but I'm not sure what else to do here.

11 months ago
Activity icon

Replied to Output An Exact String In Blade Template

So it looks like I could subclass Illuminate\Notifications\ChannelManager, overriding the createMailDriver() method, and instead of using an instance of MailChannel, use a subclass of MailChannel. Then I could override the MailChannel::buildMessage() method and do the replacement in there, because it's passed as the callback that the Mailer calls to process the message one last time before it's sent.

So now the question becomes: How do I tell Laravel to use my custom ChannelManager class instead of Illuminate\Notifications\ChannelManager?

(There's also an "is it worth it" question).

Activity icon

Replied to Output An Exact String In Blade Template

I tried inlining & had the same problem.

I could put in my own placeholders but can't figure out where to put them once the inlining is done. Do you know if there's an event that happens just before a Notification is sent via E-mail? Ideally I could get the SwiftMessage, or at least something that happens after the message content is completely ready.

Activity icon

Replied to Output An Exact String In Blade Template

Hi! The <% %> won't eve be parsed by PHP, I want them to exist in the HTML when it gets sent to Sendgrid, where they'll grep the HTML and replace the <% %> part with the correct unsubscribe link.

I did try @verbatim and it didn't work.

I found what's happening. When using Markdown messages, the CSS is inlined by the CssToInlineStyles class. The method it uses is parsing the HTML string PHP's built-in DOMDocument, doing inlining on the DOM nodes using DOMDocument methods, then using DOMDocument::saveHTML() to get an updated HTML string. When parsing the input string DOMDocument sees the <%, thinks it's a non-existent HTML tag, and ignores it, so when the ->saveHTML() call happens later the <% %> isn't gone, (because it isn't in the DOMDocument internal representation of the document). I tested it by writing a CSS "inliner" that just passes the HTML string straight through - and the <% %> tags come out fine - but also the CSS isn't inlined, and it looks like it would be nearly impossible to implement a custom inliner in the Markdown class without a whole lot of work, (although if you know an easy way, I'm interested).

I think the path of least resistance is: 1) Do nothing right now and let SendGrid add their uglier unsubscribe links to the end of my HTML message, then 2) Use actual Mailable instances for the messages I want to use. They don't appear to pass through the same CSS inlining process, and even if they do I should have more control over them.

Activity icon

Replied to Output An Exact String In Blade Template

It's not in the page source - see the comments in the first code block above for the output in the page source.

I have found where it's being stripped - it's happening when the CSS is inlined. I haven't found how to fix it yet, though.

Activity icon

Started a new conversation Output An Exact String In Blade Template

I am trying to add replacement tags for Sendgrid, (they look like this: <%asm_preferences_url%>), to my Blade template that's used in HTML E-mails. However, they are getting removed, (maybe because they look like invalid HTML tags).

Is there a way to tell Laravel or Blade, “hey, output this string exactly as it is and leave it alone”? I have tried ed `{!! '<%asm_preferences_url%>' but it gets stripped out. With th `{{ '<%asm_preferences_url%> the < and > get turned into HTML entities, which are not recognized by Sendgrid.

Things I've tried:

<p>{!! '<%asm_preferences_url%>' !!}</p>  // becomes <p></p>
<p>{{ '<%asm_preferences_url%>' }}</p>    // becomes <p>&lt;%asm_preferences_url%&gt;</p>  
<p><%asm_preferences_url%></p>            // becomes <p></p>

Desired output:


When I look at the compiled blade template it contains this, (when using the first method under "Things I've tried" above):

<?php echo '<%asm_preferences_url%>'; ?>

Which seems correct, so the string must be removed after compilation.

Activity icon

Replied to Wordpress Front-end & Laravel In A Subfolder Issues

More detail would help. What happens, and what’s the problem exactly?

For example, if you go to does it work as expected?

How about If not, what happens?