thirtythree

thirtythree

Member Since 4 Years Ago

Experience Points 14,290
Experience Level 3

710 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 143
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.

07 Feb
2 years ago

thirtythree left a reply on How To Limit Access To A Free Plan?

Yes ok. I do have a method which deals with this in the rest of my app - it looks up the users' plan if current_billing_plan is not set.

The problem I have here then, is that I'm not sure how the booted method in the SparkServiceProvider gets the chosen plan from the "Update Subscription" form. It just returns null, and I'm not sure where to start looking to fix that.

06 Feb
2 years ago

thirtythree started a new conversation How To Limit Access To A Free Plan?

I've successfully set up some plan-switch limits with Spark::checkPlanEligibilityUsing. However, I have a few Free plans (also defined in Stripe) and this function never seems to fire upon switching to those plans (Beta & Free).

My user with 12 domains, can not switch to Lite ($5) but can switch to Free ($0).

        Spark::checkPlanEligibilityUsing(function ($user, $plan) {
            if ($plan->name == 'Beta' && count($user->domains) > 1000) {
                throw IneligibleForPlan::because('You have too many domains.');
            }
            elseif ($plan->name == 'Free' && count($user->domains) > 5) {
                throw IneligibleForPlan::because('You have too many domains.');
            }
            elseif ($plan->name == 'Lite' && count($user->domains) > 10) {
                throw IneligibleForPlan::because('You have too many domains.');
            }
            elseif ($plan->name == 'Basic' && count($user->domains) > 50) {
                throw IneligibleForPlan::because('You have too many domains.');
            }
            elseif ($plan->name == 'Pro' && count($user->domains) > 250) {
                throw IneligibleForPlan::because('You have too many domains.');
            }
            elseif ($plan->name == 'Enterprise' && count($user->domains) > 1000) {
                throw IneligibleForPlan::because('You have too many domains.');
            }
            return true;
        });
13 Dec
2 years ago

thirtythree left a reply on Form Validation: Custom Error Message With Input Value

Nevermind. Got it. It would be nice to have something like :value work as a place-holder across the board.

This is what I ended up with;

namespace App\Services;

use Illuminate\Validation\Validator as BaseValidator;
use Illuminate\Support\Arr;

class CustomValidator extends BaseValidator
{
    protected function validateUniqueName($attribute, $value, $parameters)
    {
        // make use of parent validator validateUnique method.
        return $this->validateUnique($attribute, $value, $parameters);
    }

    protected function replaceUniqueName($message, $attribute, $rule, $parameters)
    {
        // parent class $data attribute contains all the validated values.
        $name = Arr::get($this->data, $attribute);
        return str_replace([':value'], [$name], $message);
    }
}

And in my AppServiceProvider;

Validator::resolver(function($translator, $data, $rules, $messages)
        {
            return new \App\Services\CustomValidator($translator, $data, $rules, $messages);
        });

thirtythree left a reply on Form Validation: Custom Error Message With Input Value

Thanks pmall. Excuse my ignorance, but how would I reference the parent method there?

12 Dec
2 years ago

thirtythree left a reply on Form Validation: Custom Error Message With Input Value

Bit of a bump.

Did you ever find a solution? I too have the same requirement and I'm struggling to find a solution.