drehimself

Web Developer at Laracasts

Member Since 7 Years Ago

Toronto, Canada

Experience Points
94,570
Total
Experience

430 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
1013
Lessons
Completed
Best Reply Awards
13
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 19
94,570 XP
May
06
2 days ago
Activity icon

Commented on Notify All Voters

In a later video (don't remember which one), I make it so that creator of the idea automatically votes for any new ideas they create (so they should get an email too).

Activity icon

Commented on In-App Back Button

It's not a requirement of the app, so I probably won't add it.

Depending on the platform, adding that feature is pretty straightforward. For example, for twitter you can go to: https://publish.twitter.com and select "Twitter Buttons." You can customize it from there and copy/paste the code into your site.

Apr
30
1 week ago
Activity icon

Replied to VSCODE And Navigating To Controllers/Models/Views...

Be sure to make use of the Command Palette in VS Code. The shortcut is command + p (or ctrl if you are on Windows). Probably the most useful shortcut in any code editor.

Episode here: https://laracasts.com/series/visual-studio-code-for-php-developers/episodes/3

Apr
26
1 week ago
Activity icon

Commented on Status Filters Tests

Awesome! Another reason why Livewire is awesome, testing with it is very straightforward.

The setup phase of the tests is repetitive/messy up to this point, I didn't make use of factory states like I should have. I did a video on refactoring the tests, which should be available soon.

Activity icon

Commented on Search Filter

The latest version of Tailwind now has blend modes: https://tailwindcss.com/docs/mix-blend-mode.

Can use the class mix-blend-luminosity

Apr
24
2 weeks ago
Activity icon

Commented on Other Filters

Yep, Jeffrey's approach is a good option.

Also checkout Coder's Tape approach by using Pipelines: https://www.youtube.com/watch?v=7XqEJO-wt7s

I'll see if I can eventually refactor this in a video, as it is getting quite messy with all the filters.

Apr
21
2 weeks ago
Activity icon

Commented on Status Filters Tests

Yep, PHP Namespace Resolover as @andreich1980 said.

I map it to a different keybind though, I use Shift + F1.

I have an entire video of most of my vscode extensions/plugins: https://laracasts.com/series/setup-a-mac-for-development-from-scratch/episodes/5

Activity icon

Commented on Status Filters Tests

I did a "Refactoring Tests" episode to clean up the tests a lot. Should be available a few episodes from now. Mostly making use of factories and states more as my tests up to this point are a bit of a mess 😅

I didn't make use of the "for" and "forUser" methods as I honestly didn't know about them until now. It would have cleaned up the tests even more.

Apr
20
2 weeks ago
Activity icon

Commented on Initial Setup And Design

Tailwind Intellisense for VSCode: https://tailwindcss.com/docs/intellisense

Apr
19
2 weeks ago
Activity icon

Commented on The Back Button Bug When Voting

Great tip!

Activity icon

Commented on Voting For Ideas

A caching/redis layer would definitely be a good first step to reduce the number of database queries if our site had a good amount of traffic. Not sure if I'll get to this, but will consider it!

Activity icon

Commented on Initial Setup And Design

This particular tool is Zeplin. It's what Adrian (Laracasts Designer) uses to handoff his designs to get ready for development: https://zeplin.io/

You can't actually design in it, you design in a design app like Figma or Sketch and publish it to Zeplin.

I personally use Figma when I dabble in design.

Activity icon

Commented on Initial Setup And Design

Check out Laravel Valet if you're on a Mac: https://laravel.com/docs/8.x/valet

Activity icon

Commented on Creating Ideas

In this case, it does work like a traditional form submit since I'm doing a redirect (which is a full page refresh).

Since I'm already using Livewire everywhere else, might as well use it. There are a few small pros that Livewire adds.

  • Real-time validation
  • Disables submit button when form submitted. Can easily add loading spinner.
  • Nice testing utilities
Apr
12
3 weeks ago
Activity icon

Commented on Voting For Ideas

Yes, can go either way in my opinion. If you had a high-traffic site, going from say 3 votes to 500 votes when you click the vote button might look a bit weird.

Activity icon

Commented on Voting For Ideas

Agree, I think I eventually changed it in the code.

Apr
05
1 month ago
Activity icon

Commented on Creating Ideas

Ah yes, definitely the better (more secure) approach.

Activity icon

Commented on Add Statuses

Yes, agreed it's extremely fragile.

I think removing that particular assertion is fine as it will cause failing tests if the HTML for the badge is ever changed.

Or you could do something like this to just test the Livewire component directly. Essentially, all it's testing is if the $idea gets passed into the Livewire component. But if it gives you confidence, then consider keeping it.

/** @test */
public function single_idea_badge_shows_correctly_on_show_page()
{
    $user = User::factory()->create();

    $categoryOne = Category::factory()->create(['name' => 'Category 1']);

    $statusOpen = Status::factory()->create(['id' => 2, 'name' => 'Considering', 'classes' => 'bg-purple text-white']);

    $idea = Idea::factory()->create([
        'user_id' => $user->id,
        'category_id' => $categoryOne->id,
        'status_id' => $statusOpen->id,
        'title' => 'My First Idea',
        'description' => 'Description of my first idea',
    ]);

    $component = Livewire::test(IdeaShow::class, [
        'idea' => $idea,
        'votesCount' => 4,
    ]);

    $this->assertEquals('Considering', $component->idea->status->name);
    $this->assertEquals('bg-purple text-white', $component->idea->status->classes);
}

My tests are pretty messy, I admit that I do get anxious to move onto the next feature instead of cleaning up my tests. Maybe I'll do an episode or two on refactoring the tests.

Apr
02
1 month ago
Activity icon

Commented on Idea Model And Migrations

Probably php intelliphense.

Video here on all my VSCode settings/extensions: https://laracasts.com/series/setup-a-mac-for-development-from-scratch/episodes/5

Apr
01
1 month ago
Activity icon

Awarded Best Reply on Difference Between Forge And Envoyer?

Forge helps you build and manage servers with all the necessary software that most Laravel apps require (web server, database, redis, etc). It has a basic deploy feature, but there is going to be some downtime when pushing new code up to your production app. It can be anywhere from a few seconds to minutes, depending on the size of your app.

Envoyer is a tool that allows for no downtime when deploying. It's not specific to Laravel apps.

They have features that integrate nicely with one another, but both are not required.

I personally use both and love them. For any "real" apps that have actual users, I use Envoyer. For any demo projects, I just use Forge.

Activity icon

Replied to Difference Between Forge And Envoyer?

It's mostly just importing your existing Forge servers into Envoyer.

Check out: https://docs.envoyer.io/1.0/projects/servers.html#importing-laravel-forge-servers

Activity icon

Replied to Difference Between Forge And Envoyer?

Forge helps you build and manage servers with all the necessary software that most Laravel apps require (web server, database, redis, etc). It has a basic deploy feature, but there is going to be some downtime when pushing new code up to your production app. It can be anywhere from a few seconds to minutes, depending on the size of your app.

Envoyer is a tool that allows for no downtime when deploying. It's not specific to Laravel apps.

They have features that integrate nicely with one another, but both are not required.

I personally use both and love them. For any "real" apps that have actual users, I use Envoyer. For any demo projects, I just use Forge.

Mar
31
1 month ago
Activity icon

Replied to Laravel/React Embedded Or Separated?

Like with everything in webdev.... It depends 😅

If you know your app is only going to be used in the browser, I personally think having one project/repo is easier to code/maintain. You can use tools like Inertia to make the UX feel like a single-page app and the end-user won't notice the difference.

If your app can be used outside of a browser (like a mobile app), it makes sense to split out the project into multiple repos. A repo for each client (web app as a single page app, mobile app) and a repo for the backend API. This approach can also be beneficial for large teams that are separated into backend and frontend teams.

I'm personally more comfortable with the first option, as most of the apps I build are just CRUD-based and live in the browser only.

Mar
30
1 month ago
Activity icon

Replied to What Is The Best Way To Learn Laravel?

There's so much content available between Laracasts, YouTube, blog posts, etc. It's easy to fall into the trap of just watching videos and not actually writing code (I certainly did this when I first started Laravel). I think that's the most important thing, just sit down and actually start writing code. Even if you're just following along with a tutorial, you're writing code and learning how things work.

I'm a fan of building simple things like blog sites or todo lists. A lot of people say that that's boring but when you're still new and trying to learn things, they make for excellent starter projects in my opinion. If you're following a tutorial, do it once following along and then do it again without following along (until you get stuck). Then do it again.

There's a new Laravel 8 from scratch series, maybe try following along with that to get started.

Good luck!

Activity icon

Commented on Introduction And Demo

Yeah, I didn't show it in this demo because I wasn't done at that point.

It's working now and even includes the query string. Just finished recording it, should be available soon!

Mar
29
1 month ago
Activity icon

Commented on Play Up And Down The Neck

I've been patiently waiting for the launch of Guitarcasts for years 🎸

One can only play Wonderwall so many times...

Drag Racing

Activity icon

Awarded Best Reply on Vue 3 Date Time Format In Moment.js ?

Computer properties in Vue can't take in parameters. Change it to a method instead.

Moment is fine, but I usually use date-fns these days: https://date-fns.org/

If I just need to do something simple, I may not even use a library at all.

Activity icon

Commented on Testing: Showing Ideas

Oops, yeah I meant to make it more dynamic and use the const I made instead.

$ideaEleven = Idea::find(Idea::PAGINATION_COUNT + 1);

Should have used better variable names too like $ideaOnFirstPage and $ideaOnSecondPage

Activity icon

Commented on Testing: Showing Ideas

Ah yes, could yes that instead as well.

Activity icon

Replied to Vue 3 Date Time Format In Moment.js ?

Probably still easier to use a library in this case.

If you weren't you could make use of the Date Object in vanilla JS

const dateObject = new Date('2021-03-29T13:56:16.000000Z')

dateObject.getFullYear() // 2021
dateObject.getMonth() // 2
dateObject.getDate() // 29

Again, not the easiest for a few reasons.

  • getMonth() is 0 based so you have to add 1 to it
  • You'd have to add a leading zero to getMonth and getDate
Activity icon

Replied to Vue 3 Date Time Format In Moment.js ?

Computer properties in Vue can't take in parameters. Change it to a method instead.

Moment is fine, but I usually use date-fns these days: https://date-fns.org/

If I just need to do something simple, I may not even use a library at all.

Activity icon

Replied to Vue 3 Date Time Format In Moment.js ?

The error says "Cannot convert object to primitive value"

Looks like moment is expecting a date value in string format, but you are passing in an object. Try passing in a string and hopefully that works.

Mar
28
1 month ago
Activity icon

Commented on Idea Model And Migrations

The main reason I'm using the package is so I don't have to worry about changing the slug name when there are two (or more) ideas with the same title.

This logic shouldn't be very difficult to implement ourselves, but this package is very simple to use and does everything automatically.

Mar
25
1 month ago
Mar
24
1 month ago
Activity icon

Commented on Introduction And Demo

Hmm, probably won't be adding a feature like that as the comment system will be VERY basic from what I see.

I have a really old, but still somewhat relevant video on real-time notifications on my YT channel: https://www.youtube.com/watch?v=pjK0VMTCtVg

Activity icon

Commented on Toggle Visibility With Alpine

Good tip, it would definitely be more optimal this way.

Mar
23
1 month ago
Activity icon

Commented on Idea Cards

Just tried it out, looking good so far! Will try to make use of it going forward.

Mar
22
1 month ago
Activity icon

Commented on Idea Cards

Not sure, but I've probably tried and it doesn't work very well.

What are you using that automatically fixes indentation for blade files?

Activity icon

Commented on Idea Cards

Yeah, probably better to not have it within the button.

Activity icon

Commented on Idea Cards

Babysittercasts

Mar
19
1 month ago
Activity icon

Commented on Introduction And Demo

Thanks! I might not take that much time to explain what I'm doing, as this is a real-world look at how I personally approach writing code for an app. If you get stuck, take some time to learn about that topic elsewhere (or here on Laracasts) and then dive back in.

Activity icon

Commented on Introduction And Demo

This is also my favourite type of content to make, even more so if the end result is actually used in production.

Activity icon

Commented on Introduction And Demo

I saw that too and wasn't really sure why this one "replaces" that one. I personally don't use TDD that much and for most of this series, the testing is done after the fact.

Nonetheless, that series is still accessible in its "archived" state.

Mar
11
1 month ago
Activity icon

Commented on CLI Tooling

I personally used Sequel Ace's "export" function to export it from my old computer, then import it on my new one. Worked great with no issues.

Mar
02
2 months ago
Activity icon

Awarded Best Reply on Notification System In Laravel Project?

Laravel's broadcasting system is excellent and provides a lot of options: https://laravel.com/docs/broadcasting

Laravel's event system handles the scenario you are mentioning.

You're going to have to also make use of Laravel Echo for the front-end portion and showing the notifications to users.

A free alternative to Pusher is the laravel-websockets package: https://github.com/beyondcode/laravel-websockets. Definitely more to setup on the server. I usually reach for Pusher first, as its free tier is quite generous with up to 100 concurrent users and there isn't any complex server setup.

I have a really old video on setting everything up. It's still somewhat relevant though to help you get started: https://www.youtube.com/watch?v=pjK0VMTCtVg

Mar
01
2 months ago
Activity icon

Commented on Subscriptions

Great to hear, will definitely make for a better experience while in development.

Activity icon

Commented on Breeze Overview And Usage

I don't have plans to do an Inertia version for Breeze/Jetstream but there should eventually be a general Inertia.js series here on Laracasts.

This series is exactly what you're describing. An overview of the "starter packs" for auth in Laravel. If you're still confused about some of the topics, maybe go back and re-visit some of those concepts. For example, a lot of people are not familiar with blade components and their syntax (there's a series on them here on Laracasts).

It might be Inertia that you're still not too familiar with. While you wait for the Inertia series, definitely check out their excellent documentation but more importantly the demo "Ping CRM" app they have. Install it locally then take a look at the code and Vue components they have to piece it all together.

Feb
25
2 months ago
Activity icon

Commented on Introduction And Styling

No reason, just a bad habit. Should definitely leverage any html5 tags when it makes sense. You can use a table as well and is probably the more accessible choice. For me, I just used divs to make it easier to style.