daltonamitchell

daltonamitchell

Member Since 4 Years Ago

Roseville, CA

Senior Engineer at Riskalyze

Experience Points 1,650
Experience Level 1

3,350 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 189
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • 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.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    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.

17 Nov
4 years ago

daltonamitchell left a reply on Refresh A Model?

I noticed that but I guess I didn't think my problem through well enough. I never thought about just refreshing the relationship, thanks for clearing that up!

14 Nov
4 years ago

daltonamitchell left a reply on Refresh A Model?

I've got a few different options for rolling your own implementation on SO but it feels like Laravel would already have a built-in method. Maybe it'll be an L5 addition :)

daltonamitchell started a new conversation Refresh A Model?

Hey guys I'm testing some model relationsships and I'm curious if I can refactor my code a bit.

    // Assign User a role
    $user->role()->save($admin);

    // Role should be admin
    $this->assertEquals('admin', $user->role[0]->name);

    // Change Users Role
    $user->role()->updateExistingPivot($admin->id, ['role_id' => $manager->id]);

    // Reload User
    $user = User::find(1);

At the end it seems I have to run a new query to get the updated relationship. Is there anyway to do something like this...

    // Reload User
    $user->reload();

or

    // Reload User
    $user->refresh();

... get updated info after a save? It seems like if I'm using the same ID and everything I shouldn't have to create a new Model instance but maybe this is an instance where I should look into extending the framework for my edge case.

27 Oct
4 years ago

daltonamitchell left a reply on I'm Trying To Do Something Weird... What's The Best Approach?

@zoltanpeto I think your approach might be my best bet. Exporting the data to the new DB doesn't really work because I can't convince them to not use the app while I work on it but I want to phase out old features as soon as the new ones are available to use. I've been watching the series on Commands and I think this may be the way to go.

I'm curious, what Laravel version were you working with? I've decided to use L4.3/5 which allows auto-validation of the FormRequest class. Did you (or would you) do your auth the old-fashioned way or pass in the Guard $auth instance to your command handler and use it to validate both attempts? I'm trying to get a feel for how this is done in the "real" world. I'm the only technical staff at work forums are usually my only place to turn for feedback.

daltonamitchell started a new conversation I'm Trying To Do Something Weird... What's The Best Approach?

So I'm looking for a little direction on a project I'm working on. Without getting too complicated, I'd like the following series of events to take place:

1) A user attempts to login 2) If they don't authenticate, instead of a redirect, check a different mysql server for the credentials they gave 3) If those work, log them in and register a new user with the data from the other server 4) Otherwise, redirect with errors

Basically, I'm trying to rebuild my companies app, including the poorly structured db schema, without taking the old one down just yet. I'm starting with user authentication but if it works I'd like to have to new app copy and restructure data from the old as new features come online.

I'm kind of a noob when it comes to backend development. Is this the kind of stuff you create a command, facade or other new-fangled term for? Maybe it's a stupid idea that I shouldn't be attempting but it would be extremely helpful for my particular case. I'm not looking to cut and paste how to do it, I'd like to know what best practices are for this type of logic so I can go investigate. Maybe a particular Laracast series that can teach me how to build this functionality?