coder222

coder222

Member Since 1 Year Ago

Experience Points
210
Total
Experience

4,790 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
0
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 1
210 XP
Sep
10
1 week ago
Activity icon

Replied to How To Check If Checkbox Is Checked?

For checkbox input the important attributes are:

<input type="checkbox" name="cb_name" value="cb_val" checked="checked" />

When the form is submitted, the value of cb_name will be cb_val whatever its value if the checkbox is checked, if it is not checked then cb_val will not even be set.

Now you can figure out where to put your if(isset(...)) code, instead of in the value attribute it should be outside of it.

<input type="checkbox" name="cb_name" value="1" <?php if ($cb_name == 1) echo 'checked="checked"' ?> />

or if you're using laravel blade template:

<input type="checkbox" name="cb_name" value="1" @if($cb_name == 1) checked="checked" @endif />
Sep
09
2 weeks ago
Activity icon

Replied to Auth And Guest Middleware, How To Have Different Home Route?

Thanks all, I thought this was as easy as changing a property but after some thoughts I think I'll leave it redirecting to one page.

Sep
07
2 weeks ago
Activity icon

Replied to Auth And Guest Middleware, How To Have Different Home Route?

Thanks @jlrdw and @gregupton for your reply.

Ok, that should work when a user is logging in. What about a user who tries to visit a url which is not allowed for him. For example: a visitor who tries to enter member area url or a member tries to enter "/admin", as my understanding these should be intercepted by middleware and redirected to their "home" route, cmiiw.

Activity icon

Started a new Conversation Auth And Guest Middleware, How To Have Different Home Route?

In my app there are some user's roles, let's say visitor, member and admin. I want to have different home route for each role. AFAIK, the home route is defined in RouteServiceProvider, there is only one, maybe I can define more than one but how to make it work with auth or guest middleware?

Jul
28
1 month ago
Activity icon

Replied to Evaluate The Result Of A Promise

Oh okay, I never knew we can return a Promise.reject directly. Always learn new ones. Thanks!

Jul
27
1 month ago
Activity icon

Replied to Evaluate The Result Of A Promise

Thanks @piljac1 for your suggestion. I was thinking so, but then I found that the Promise that has been caught will not be caught anymore (sorry I can't explain it more clear). In this case the axios has the catch, so the error won't go into saveForm's catch. Unless I missed something here.

Jul
25
1 month ago
Activity icon

Replied to Evaluate The Result Of A Promise

Okay, thank you.

Activity icon

Started a new Conversation Evaluate The Result Of A Promise

Hi,

I have this code (Vue methods)

saveForm() {
    axios.post('/post', data)
	.then(response => response.data)   // completed normally
	.catch(err) { console.log(err) }  // error 
},

submitForm() {
	this.saveForm();
        if (result of saveForm) {   
		// do something if saving was successful
        } else {
                // handle error
        }
}

How can I evaluate the result of axios Promise?

Thanks!