JoshuaD

JoshuaD

Member Since 5 Months Ago

Experience Points
5,670
Total
Experience

4,330 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
49
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
5,670 XP
Oct
28
22 hours ago
Activity icon

Replied to Inertia Form Validation

Fixed url is fine. Using Ziggy allows you to use named routes as if you would in blade or in your controllers.

Think of a PUT/ PATCH.

this.form.put(route('api.model.update'), this.model));
// http://domain.com/api/model/10

The names won't always be the same as the url. And If you decide you change the url, the name still points to the correct url.

Activity icon

Replied to Inertia Form Validation

When you return the data in your api controller you return a redirect to the page your are on. That pages controller should repopulate the page and pass on any errors to your custom bags. The 302, as odd as it seems, is as intended. There then should be a 2nd xhs after the redirect with all the data and errors.

I'm not at home now, I'll post my code when I return to my den of evil.

Activity icon

Replied to Inertia Form Validation

$request->validateWithBag('addOrder', [
	'url' => 'required|date'
]);
<jet-input-error
	:message="form.error('url')"
	...
/>
this.form.post(
	//Ziggy gives us access to route names, use it the same as you would in Laravel
        route("api.urls.store"), 
        {
          preserveScroll: true,
        }
);

Seeing as it has been a couple days already, you may have already solved this on your own. I found the Jetstream documentation for Inertia to be lacking.

Sep
20
1 month ago
Activity icon

Replied to Compiling Vue 3 With Mix

Thank you! I was having trouble finding out how to migrate to Vuejs 3 within Laravel.

Sep
17
1 month ago
Activity icon

Commented on Composition API: Logic Extraction And Reuse

Have you ever thought to do Bed Time Stories? Your voice is too soothing, I'm drifting away on a cloud.

On a more serious note: Thank you for this series

Aug
06
2 months ago
Activity icon

Replied to Integrity Constraint Violation: 19 NOT NULL Constraint Failed: Threads.channel_id

Thank you, Fillable, I seem to make this mistake once a week and completely forget about it.

Jun
26
4 months ago
Activity icon

Replied to Disable Escaping During Tests

Thank you.

Jun
04
4 months ago
Activity icon

Replied to How To Format Laravel Blade Codes In Visual Studio Code ?

Some things don't work well, for example the layout that comes with --auth.

@if (Route::has('register'))

turns into

<blade
    if|%20(Route%3A%3Ahas(%26%2339%3Bregister%26%2339%3B))>
May
26
5 months ago
Activity icon

Commented on Extracting To View Composers

I spent 30 minutes finding a work around for this, I really need to stop doing that.

He addresses this in the next lesson at ~2 minutes in. If you want to fix it now, this is the code.

View::composer('*', function ($view) {
    $view->with('channels', \App\Channel::all());
});
May
25
5 months ago
Activity icon

Commented on A Thread Should Be Assigned A Channel

I've been using named routes for the path() functions. This caused problems when I was testing

'/threads/' . $thread->channel->id . '/' . $thread->id
//threads/domus/1

against

$thread->path();
//localhost:8000/threads/domus/1

The route function returns the full route including the domain name, Be careful, this ensnared me for longer then I'm willing to admit.

Activity icon

Commented on A Thread Should Be Assigned A Channel

I'm on Laravel 7.

After sending a thread to the POST request, the tests thread doesn't automatically get an ID. Testing a GET request won't work and will give you hell trying to find out why the test isn't passing.

Instead of testing that against a GET request, I'm asking the database directly.

$this->assertDatabaseHas('threads', ['title' => $thread->title]);
May
24
5 months ago
Activity icon

Commented on A User May Publish Threads

On Laravel 7 This

$response = $this->get($thread->path());

Does not work.

The thread we created before the post request doesn't get it's ID updated from the post request we make. We end up making a get request to '/threads/'. I'm still passing the test since that route is showing all threads titles and body's for now, though i thought it was worth mentioning.

If you're using your path method like this

public function path()
{
    return route('threads.show', $this->id);
}

Expect this error

Missing required parameters for [Route: threads.show] [URI: threads/{thread}].

So instead use this for now

public function path()
{
    return '/threads/' . $this->id;
}
May
23
5 months ago
Activity icon

Commented on A User May Respond To Threads

Thank you @lemmon

For others, you should read @bdensmore's reference, it is incredibly informative.

Just to be clear be clear, your code might look similar like this

$this->expectException(AuthenticationException::class);
$this->withoutExceptionHandling();
$this->post(route('replies.store', $this->thread), []);
May
21
5 months ago
Activity icon

Commented on Test-Driving Threads

Tests are used to prove your application is operating as expected. You can use one command and run every test on every function. Imagine manual testing versus clicking a button.

If you want to make changes in the future, you run all your tests and know that you didn't just break the rest of your application. Even if you did break the application, you have test names and functional documentation as to what you just broke.

You have a lot more confidence in shipping your application, less bug reports etc.

It's pretty much standard practice and everyone SHOULD be doing it or learning it.

Activity icon

Commented on Test-Driving Threads

I'm on Laravel 7, Windows 10 and using xampp. Here is the fix i came up with.

Prefix your function names with test

public function test_a_user_can_browse_threads()

In the xampp/php directory, rename the files named phpunit to phpunit-backup.

In the same directory, create a new file called phpunit with the contents of

vendor/bin/phpunit

The phpunit command should now work

If it still does not then you may need to set the xampp/php directory up in your environment variables.

Edit: I just read through the Laravel Docs and all you have to do is run this command

php artisan test
May
18
5 months ago
Activity icon

Replied to Blade Component Render In View Causes "syntax Error, Unexpected 'endif' (T_ENDIF), Expecting End Of File"

For others who landed here for single line components, don't forget to close your component with a slash />