mynameiscody07

mynameiscody07

Member Since 3 Months Ago

Experience Points 7,680
Experience
Level
Lessons Completed 76
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

16 Sep
2 months ago

mynameiscody07 left a reply on Correlating Db Entries Directly To A PHP Class

@Snapey That might work as well. Going to play around with that method and the one I linked to in the video from Jeffrey and see how they go.

14 Sep
2 months ago

mynameiscody07 left a reply on Correlating Db Entries Directly To A PHP Class

I think doing something like Jeffrey does in the badges series https://laracasts.com/series/unlocking-badges-workshop/episodes/17 is really what I'm looking for.

mynameiscody07 left a reply on Correlating Db Entries Directly To A PHP Class

Hmm, I'm not sure I represented my problem correctly. With polymorphic relationships I would be using a new table to store each type of game, and in my situation I don't think I want to do that because each game type will in reality have the same columns. They would all be exactly the same. I guess that might be alright but seemed like a better structure would be something like.

Table = game_types Columns = id, name, class where class is related to a php class.

Table = games Columns = id, game_type_id, rules, winner, etc

Does that make more sense?

mynameiscody07 started a new conversation Correlating Db Entries Directly To A PHP Class

I'm not sure how to do this or if what the title says is even the best way to handle my situation but I need some advice. I'll give a quick run down on what I'm trying to do below.

If anyone here is in a bowling league you know that their are all sorts of side games that people play with everyone else in the league including things like, high game, high series, brackets and many more. I'm working on building a system that allows to run all these side games, the current software for these things is ancient looking and not modern at all.

The idea is that users create leagues, they then can add bowlers to the league, each week they can add a new event and inside that event they can add what ever side games they will be running. When someone signs up they can attach the bowler to the games they want to participate in. With this the user can simply then add the bowlers scores in one place and every game they are in will know what to do with it.

Now with all that it brings me to my question. All of these game types have very different rules of how they work so they all need to be their own PHP class or classes to work correctly. How do I correlate entries in say a game_types table to their perspective PHP classes, or how can I correlate the GameType Eloquent Model to the different PHP classes based on a field in the database? There may be a better way to do this but I think by having the all the games in a table I can then use an event_game pivot table to save which games each event is running.

With all that being said in the future as more games are added I would also like some way to do it without necessarily running a new seed to add the new game type to the database, the system should just know. I'm guessing some sort of Service Provider is the answer, I'm just not sure how.

Hope this makes sense and it not just me rambling.