Member Since 1 Year Ago
3,850 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.
My guess is that yes, you CAN somehow have Laravel run that for you (depending on how you want it to work) but in order to be more helpful we are going to need to know the specific problems you are running into when trying things. Take a look here to get started: https://wpengine.com/resources/wordpress-laravel/
I considered using ->count() but then I cannot return the other things I need like the user and stat_meta type
Started a new Conversation Unable To Return Counts Of 0 (zero) With Query Builder
Hi there! Hopefully this is an easy one for somebody more eloquent-savvy than myself. With the following query, I am returning info about a user and their team, as well as a count of how many times each particular "stat_meta" type appears in the "basketball_game_events" table. However, when that count returns 0, it just doesn't return anything for that row. I want it to return each "stat_meta" type next to each user/team combo, even if there are 0 "basketball_game_events" to count.
$collection = DB::table('stat_metas') ->select('users.id', 'users.name', 'teams.team_name', 'stat_metas.stat_abr', DB::raw('count(*) as total')) ->leftJoin('basketball_game_events', 'stat_metas.id', '=', 'basketball_game_events.event_type_id') ->leftJoin('users', 'basketball_game_events.player_id', '=', 'users.id') ->leftJoin('user_team_rel', 'users.id', '=', 'user_team_rel.user_id') ->leftJoin('teams', 'user_team_rel.team_id', '=', 'teams.id') ->where('stat_metas.type', '=', 'recorded') ->whereIn('users.id', $players) ->groupBy('users.id', 'users.name', 'teams.team_name', 'stat_metas.stat_abr') ->orderBy('users.name', 'asc') ->orderBy('stat_metas.stat_abr') ->get();
Started a new Conversation Difference Between Queries?
Hi there, I was wondering why these two queries are returning very different counts?
$collection = BasketballGameEvent::select('id')->whereIn('game_id', $games)->whereIn('event_type_id', )->count(); return $collection;
$collection = BasketballGameEvent::whereIn('game_id', $games)->whereIn('event_type_id', )->count(); return $collection;
Note that the only difference is that the "select('id') is missing from the second one. I know that you don't have the dataset, so these numbers don't mean much without that context, but V1 is giving me a count of 331 and V2 is giving me a count of 92?
I am not sure what the select has to do with the count?
Started a new Conversation Variable Class Names Or Secondary Table?
I have a table, 'basketball_game_events', and it is full of, you guessed it, all the things that happened during basketball games (assists, rebounds, etc.). The thing is, some of these events are shot types. Normally, a game event only needs 6 columns to be complete. However, there are 3 additional columns needed if we are talking about a type of shot (2 pointer made/missed, 3 pointed made/missed, you get the picture).
My question, would you all recommend breaking those last three columns off into a different table? On the one hand, it would clean my table up quite a bit and save me from seeing tons of NULL when it isn't needed. On the other, if I did break it off, I would have to do a lot more joins with my queries, and I would still have to have a reference column full of NULLs for none-shots.
I know this is probably largely opinion-based, but... I would love some opinions haha