orediggerco

orediggerco

Member Since 4 Years Ago

Denver, CO

Experience Points 7,485
Experience Level 2

2,515 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 147
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.

30 Dec
2 years ago

orediggerco left a reply on Spark Registration Form & Recaptcha

Had to resort back to good 'ol jQuery, but this is one way to make it work:

// In your vue component asset file
data() {
        return {
            recaptcha_key: 'your key',
            form: new SparkForm({
                name: '',
                email: '',
                grecaptcharesponse: null
            })
        };
    },

    methods: {
        create() {
            this.form.grecaptcharesponse = $('#g-recaptcha-response').val();
            Spark.post('/thing/store', this.form)
                .then(result=> {
                    this.form.name = '';
                    this.form.email = '';
                    this.form.grecaptcharesponse = null;
                    grecaptcha.reset();
                })
        },
    },
// in your vue component blade file
<form class="form-horizontal" role="form">
                            {{ csrf_field() }}
                            <div class="form-group" :class="{'has-error': form.errors.hasErrors()}">
                            <!-- Name -->
                                <div class="row p-b-md">
                                    <div class="col-md-10 col-md-offset-1">
                                        <input type="text" class="form-control" name="name" v-model="form.name" autofocus placeholder="Your Name">
                                        <span class="help-block" v-show="form.errors.has('name')">@{{ form.errors.get('name') }}</span>
                                    </div>
                                </div>

                            <!-- Email Address -->
                                <div class="row p-b-md">
                                    <div class="col-md-10 col-md-offset-1">
                                        <input type="email" class="form-control" name="email" v-model="form.email" placeholder="Your Email Address">
                                        <span class="help-block" v-show="form.errors.has('email')">@{{ form.errors.get('email') }}</span>
                                    </div>
                                </div>

                            <!-- reCaptcha -->
                                <div class="row p-b-md">
                                    <div class="col-md-10 col-md-offset-1">
                                        <div class="g-recaptcha col-md-offset-4" :data-sitekey="recaptcha_key"></div>
                                        <span class="help-block" v-show="form.errors.has('grecaptcharesponse')">@{{ form.errors.get('grecaptcharesponse') }}</span>
                                    </div>
                                </div>

                            <!-- Submit Button -->
                                <div class="row">
                                    <div class="col-md-offset-5 col-md-2">
                                        <button type="submit" class="btn btn-primary"
                                                @click.prevent="create"
                                                :disabled="form.busy">
                                            Submit
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </form>

I had to explicitly call grecaptcha.reset(); after my post is successful since this particular form is in a modal, and without it, a user could open the modal and resubmit without re-verifying the captcha.

19 Feb
3 years ago

orediggerco started a new conversation View Team Member's Completed Videos

I really like that we can set up Team accounts and assign/reassign subscriptions over time. As the team leader however it would be great if there were a way to view the lessons that each of my team members have completed and when.

Thanks!

07 Apr
4 years ago

orediggerco left a reply on Object Persistence In A Single Request

Thank you, this is what I was looking for. Should have thought of doing that :smile:

06 Apr
4 years ago

orediggerco started a new conversation Object Persistence In A Single Request

I have a question regarding object persistence in the context of a single server request. I have read a number of posts that helped explain how in php there is no persistence between requests, and that makes sense to me. What I don't quite understand however is how object persistence works during a single request/response.

To illustrate with an example, in the laravel project I'm currently working on I have a model that has an appended attribute that gets its information from a SOAP service call. This information is then displayed in one of many views. While debugging an unrelated issue when first implementing the service calls, I noticed that every time the attribute was referenced, the service was called again resulting in dozens of identical service calls.

For example:

// model.php
// ...
protected array $appends = ['details'];
// ...
public function getDetailsAttribute() {
    return $some_service->call()->to array();
}

// some_view.blade.php
// $model object is available to view
<table>
@foreach ($model->details as $detail)
    <tr><td>{{ $detail }}</td></tr>
@endforeach
</table>

Every time ```php $model->details is referenced, to generate the response for a single client request, a service call is made.

Is there a way to implement extra attributes like this in such a way that a remote service call, database query, etc only has to be made one per request? I am already implementing caching, but I left that our for brevity in the code example. The problem is the same however since instead of a service call, the cache is opened, read, and deserialized every time the attribute is referenced. The cache has obviously helped over doing a service call every time, but I feel like eventually this will cause a performance issue anyway. Especial as we move or cache to redis/memcached instead of local file cache.

Any information would be greatly appreciated!