hunterhawley

hunterhawley

Member Since 1 Month Ago

Experience Points 990
Experience Level 1

4,010 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 6
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.

06 Jul
2 weeks ago

hunterhawley left a reply on Memory Exhaustion, Big Video Files Need Uploaded

Really? Im using FFMpeg through a Symfony Process and it is working great. It took a good bit of configuring but it worked. My only issue with Vimeo is that Im not sure how much customization I can really do.

hunterhawley left a reply on Memory Exhaustion, Big Video Files Need Uploaded

Well, currently I'm having users upload their video files directly to my server so that I can perform FFMpeg transformations on the videos. Is this a bad idea? Should I just upload directly to S3 and then have FFMpeg download them back for each transformation?

hunterhawley started a new conversation Memory Exhaustion, Big Video Files Need Uploaded

Hey y'all!

I've got to get some (potentially) very large files uploaded to my S3 bucket on a Laravel Job I am building out. I am getting the dreaded "Allowed memory size of ### bytes exhausted" error, and I have no interest in increasing the memory limit in php.ini (simply because I don't know how large some of these files will go, and at some point I need to quit running away from these large files by increasing memory_limit to ridiculous levels).

The question is: Does Laravel make chunking this thing easy? Is there a function I am not seeing that I can use?

I know the answer is probably no, but Laravel makes SO many things easy for me, I figured I might ask to see if I was missing something in my Google's.

If this does not exist in Laravel, what should I do? I know that I need to take the file into memory a chunk at a time, but I have no idea where to start on that.

Thanks!

03 Jul
2 weeks ago

hunterhawley left a reply on Access Relationship From Inside A Where Clause (or However I'm Supposed To Do This)

I think you are on the right track, but I'll have to keep working on this one. I've got a lot going on in my model that needs to be wrangled haha

02 Jul
3 weeks ago

hunterhawley started a new conversation Access Relationship From Inside A Where Clause (or However I'm Supposed To Do This)

Hey y'all! Quick question this morning. I've got two tables: 'stats' and 'stat_metas'. 'stat_metas' holds all the 'meta' information about a stat, like its name, description, that stuff. 'stats' holds actual instances of stats, referenced back to stat_meta (each stat has one stat_meta, each stat_meta has many stats).

I have another model though called Game, where I am working with these two tables. (Game has many stats, you get the picture)

From Game, I am using this to pull the number of times a stat with the stat_meta id of 3 comes up:

$twosMade = $this->hasMany('App\Models\Stat', 'game_id')->where('stat', '3')->count();

Note: 'stat' (as in where('stat', '3')) is the column name in the 'stats' table that references the id on the stat_metas table)

However, instead of using the id from stat_meta, I would like to use the name of the stat. I want to do something like this, however this is obviously wrong:

$twosMade = $this->hasMany('App\Models\Stat', 'game_id')->where('stat->stat_meta->stat_name', '3')->count();

Does anyone have an idea of how this should be approached? I wish I had a visual or something to show, when explaining these Eloquent relationships and whatnot I get pretty confused at times.

hunterhawley left a reply on Queuing File Transformation After File Upload

@JOHNBRAUN - This actually helps a lot. There is a lot to unpack here, so it'll probably take me a bit before I get it running, but I'll post an update on here with any further questions! Thanks a lot John! Nice website too!

hunterhawley left a reply on Should I Use A Helper Function? A Partial View?

@SNAPEY - I was actually asking a friend about this issue yesterday and he told me the same thing. I went ahead and converted everything so that it works in the model now, and whew, it is a LOT nicer now.

01 Jul
3 weeks ago

hunterhawley started a new conversation Should I Use A Helper Function? A Partial View?

Hi there,

I am building a Laravel application where people upload videos of basketball games, and then stats are recorded. So, in the db, I've got a 'stat_metas' table where I store all the different types of basketball statistics (assists, 2 pointers made, etc). I also have a 'stats' table where I keep every recorded stat. Each record holds which "stat_meta" it was, which player did it, which game it happened in, etc.

Now, I am trying to display all of this data in a table, on both a per-game and per-team (teams have multiple games, so a per-team table would be all of the per-game data, aggregated) basis.

I also have some stats (like free throw percentage) that I had to calculate. I put each of those formulas in separate partial views and @included them (I now fear that was a bad idea, but you tell me).

Now, all of this 'worked' for both the calculated and added up stats, but then came time for me to add a totals row at the bottom of this table, and things got REAL messy, REAL quick, in part because I used the partial views I think.

Does anyone have any idea how I can make this work? Should I try using helper functions for each calculated stat?

hunterhawley left a reply on Queuing File Transformation After File Upload

@JOHNBRAUN - Hey John,

This is super helpful. Now the only questions I have are

  1. How do I get $videos ready to send over to the job? Right now (I'm currently just processing this in the controller and now I am converting it) I can do $request->file('video_file'); and then just loop through each file with a foreach. I can't pass $request though, because I get an error that says "serialization of 'closure' is not allowed laravel job"

  2. So, I could put something in the DB that says "in progress" while the video processing is happening, and then change it to "processed" once it is done? Basically what do you call to make something happen upon successful processing?

Thank you so much!

hunterhawley started a new conversation Queuing File Transformation After File Upload

Hey there! I have been Googling around, and was surprised that I couldn't find the answer to this anywhere. I have a form that has a few text/integer fields, and one multi-select file field for videos. Currently, I've got code that will upload everything, put the text fields in the DB, then use FFMPEG to compress and combine every video into one concatenated larger video.

All of this works, my problem is that for any video larger than a minute or two, the FFMPEG process takes FOREVER. So, I've been watching the Laracasts about Queuing. I haven't found anything about how to pass $request data, and when I tried, I was told that serialization was not allowed for that. At this point, I just need to know how to pass my video objects to a job where they can be processed, so that the user doesn't have to sit there and wait. Any thoughts?

23 Jun
1 month ago

hunterhawley left a reply on Order Records By Field, Get Record Before Or After Any Given

Another note on this, I used the $loop variable to assist in this, but I actually had to build an array of all my records first, then loop through again so that the one that came after whichever one I was on was already loaded.

22 Jun
1 month ago

hunterhawley left a reply on Order Records By Field, Get Record Before Or After Any Given

@TRAY2 - Ohhhhhhhhh, wow. That is incredible actually. Thank you so much, this will help me in many more ways than just with this.

hunterhawley started a new conversation Order Records By Field, Get Record Before Or After Any Given

Hey y'all, I've got a model called 'Substitution", and it has a field called 'video_timestamp' which is an integer. I'm ordering them by this field, and cycling through them in a foreach in one of my views, but I would like to be able to get a field from a record that is one record after whichever one I am at in the foreach. For instance:

Record 1: 'video_timestamp' = 100, 'other_field' = 'hello'; Record 2: 'video_timestamp' = 230, 'other_field' = 'there'; Record 3: 'video_timestamp' = 600, 'other_field' = 'world';

So lets say in the foreach statement, I am currently at Record 2. I want to be able to access the 'hello' from Record 1. However, it isn't a given that the ID for Record 1 will be one fewer than Record 2's. So, I am trying to move around only in the orderBy('video_timestamp') list that I created in my controller. How might I go about doing this?

30 May
1 month ago

hunterhawley left a reply on How To Edit Invitation Table Upon User Registration?

Also, I can include any code that will help answer the question, but I think that because this has to do with performing an action as the user registers, my code will be useless to you to answer. I may be wrong though.

hunterhawley started a new conversation How To Edit Invitation Table Upon User Registration?

Hey y'all,

I have followed this tutorial (https://laraveldaily.com/laravel-auth-make-registration-invitation-only/) to create an invitation-only registration system on my application. I have been making my own modifications (for instance, I made it so that I could pre-fill as many or few of the fields as I liked when making the invitation), but I have a working system. There is however one major problem: the tutorial tells you to put a 'registered_at' field in the invitations table, but then never tells you how to fill it once the user registers. I only bring up the tutorial because it gives you an idea of what I based my system off of, I realize that you all can't provide support on someone else's article haha.

So basically, I have an invitations table. The only way a user can get to the register view is with a token that is found in that table. I could probably very easily pass that token to the register view if needed. Is there a way to edit the particular invitation's 'registered_at' field once the user uses it to register?

Thank you!