3,350 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
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.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
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 :)
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->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();
// 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.
@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?