JacobFHolland

JacobFHolland

Member Since 2 Months Ago

Experience Points
8,500
Total
Experience

1,500 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
79
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

Level 2
8,500 XP
Oct
13
1 week ago
Activity icon

Awarded Best Reply on SQLSTATE[HY000] [2006] MySQL Server Has Gone Away

Yeah I have a standard HDD which is probably the difference we are experiencing. For those of you who are googling and reading form the future (hello future people) I resolved this issue by modifying my MySQL config file.

I changed max_allowed_packet under [mysqld] to 10M though, depending on the size of the data you are passing who knows you may need more. 10mb in a single MySQL field is a lot of data though so if you are passing more than that into a single field maybe its time to re-evaluate what your process is

I did also add default_authentication_plugin=mysql_native_password to the same section as per the advice of the article linked above. Though, I don't think that actually resolved or changed anything. That was the first thing I tried and it didn't actually work until I changed the max_allowed_packet to be larger. I am leaving it in there since it doesn't seem to hurt anything and I am not curious to find out how everything behaves if I remove it. 99.99% sure the packet size was what fixed it.

EDIT: Just to further clarify so you aren't going "ok well that fixes it by why did it fix it". I believe what was happening was that my Job was pretty dang large. Not only was it a lengthy complex operation itself but the dataset it ultimately needed to process through was very large. MySQL could not physically enter all the information required into the payload field of the Jobs table because there was a limitation on the size of what could be stored in a MySQL field. Bumping that size up allowed me to store my Job properly in the Jobs table.

Activity icon

Replied to SQLSTATE[HY000] [2006] MySQL Server Has Gone Away

Yeah I have a standard HDD which is probably the difference we are experiencing. For those of you who are googling and reading form the future (hello future people) I resolved this issue by modifying my MySQL config file.

I changed max_allowed_packet under [mysqld] to 10M though, depending on the size of the data you are passing who knows you may need more. 10mb in a single MySQL field is a lot of data though so if you are passing more than that into a single field maybe its time to re-evaluate what your process is

I did also add default_authentication_plugin=mysql_native_password to the same section as per the advice of the article linked above. Though, I don't think that actually resolved or changed anything. That was the first thing I tried and it didn't actually work until I changed the max_allowed_packet to be larger. I am leaving it in there since it doesn't seem to hurt anything and I am not curious to find out how everything behaves if I remove it. 99.99% sure the packet size was what fixed it.

EDIT: Just to further clarify so you aren't going "ok well that fixes it by why did it fix it". I believe what was happening was that my Job was pretty dang large. Not only was it a lengthy complex operation itself but the dataset it ultimately needed to process through was very large. MySQL could not physically enter all the information required into the payload field of the Jobs table because there was a limitation on the size of what could be stored in a MySQL field. Bumping that size up allowed me to store my Job properly in the Jobs table.

Activity icon

Replied to SQLSTATE[HY000] [2006] MySQL Server Has Gone Away

So to confirm, I just moved to SQLite to test it. The job processes just fine. However it adds entries at like 1/1000th of the speed that it was adding entries to MySQL. Is it supposed to be slow? I have to enter 40,000 entries and that would've normally been done at (somewhat close to) 100 records per second on MySQL. SQlite is going roughly 10 records or less a second.

EDIT: Also if it is processing the Job TablePlus seems to repeatedly lose its connection to the database file while it is in mid-entry. This does not seem like a better way to go about it. I feel like I should be fixing the MySQL problem rather than creating new different problems.

Activity icon

Replied to SQLSTATE[HY000] [2006] MySQL Server Has Gone Away

So would you recommend I just move to Redis or something? Is this just a limitation of MySQL? Just looking for a practical solution to this problem. I have never used Redis before but I am sure it can't be that hard to swap over.

Activity icon

Replied to SQLSTATE[HY000] [2006] MySQL Server Has Gone Away

Also it does appear that my payload is being generated properly just from looking at the error. https://i.imgur.com/OAIxHRy.png

Activity icon

Started a new Conversation SQLSTATE[HY000] [2006] MySQL Server Has Gone Away

Running into an error when I try and run a Job. It only happens occasionally while processing the job (usually when the data being processed is large).

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Through some googling I found this article: https://laravel-news.com/laravel-and-mysql-8-fixing-mysql-server-has-gone-away-error

Which, seems geared to Linux users. Right now I am using XAMPP on Windows. So I opened my XAMPP user control panel, opened the Config file for MySQL. Added to my config file

[mysqld]
default_authentication_plugin=mysql_native_password

Restarted the Laravel server, XAMPP, MySQL. And I am still getting this error.

I know the Job functions properly with small amount of data (234 entries into the database through the job works fine, 9,000 entries does not). So I am assuming this is not a problem with the actual code inside the Job class I have. Previously while making a different job that mostly did the same thing (yay troubleshooting!) I never had received this error and the Job was able to process 40,000 entries.

I am assuming that I am getting this error because it is timing out while trying to create the payload for the job? Just not sure what's going on here.

Sep
22
4 weeks ago
Activity icon

Replied to Laravel Claims A Model Is Not Found (but It Definitely Exists)

Thank you so much for the quick response! You were right. Probably should've occurred to me. Working now! :)

Activity icon

Started a new Conversation Laravel Claims A Model Is Not Found (but It Definitely Exists)

I am currently following the TDD birdbox videos and am experiencing an issue with Laravel claiming that the Project model cannot be found. I am on the very start of it doing my first test. I have confirmed up until the part where you need to make the Model, and everything functions as it should in the video until then.

ProjectsTest.php


namespace Tests\Feature;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;

class ProjectsTest extends TestCase
{
    use WithFaker, RefreshDatabase;

    /** @test */
    public function user_can_create_a_project()
    {
        //Disables Exception Handling so routes can be ignored temporarily
        $this->withoutExceptionHandling();

        //Create an array of fields to check in the table
        $attributes = [
            'title'=> $this->faker->sentence,
            'description' => $this->faker->paragraph
        ];

        //Make POST request to route
        $this->post('/projects',$attributes);

        //Assert Database has the fields in the table
        $this->assertDatabaseHas('projects',$attributes);
    }
}

web.php


use Illuminate\Support\Facades\Route;


Route::get('/', function () {
    return view('welcome');
});

Route::post('/projects', function(){
	//validate
	
	//persist
	App\Project::create(request(['title', 'description']));

	//redirect
});

Project.php


namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Project extends Model
{
    use HasFactory;

    
}

And I am getting the error in PHPUnit


There was 1 error:

1) Tests\Feature\ProjectsTest::user_can_create_a_project
Error: Class 'App\Project' not found

I can very clearly see that Project.php is in my app\Models folder as created by the command line. Any ideas?