jhull

jhull

Member Since 2 Years Ago

Experience Points
8,130
Total
Experience

1,870 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
76
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.

Level 2
8,130 XP
16 Sep
4 days ago

jhull commented on Generating New Tokens

Would be great to see the next episode of this!

09 Sep
1 week ago

jhull commented on The Skeleton

This works great...but I'm having integrating this with Laravel Spark.

The code recommended in the Web routes does not work, and I can't for the life of me figure out why!

08 Sep
1 week ago

jhull left a reply on Setting Up Vue-Router With Spark 3.0

Did you have to do something special to make it work with dynamic routes? (Like /foo/:id etc.?

I cant seem to get it to work.

jhull started a new conversation Vue-router 404s On Dynamic Route IDs

Brand new install of Laravel 6, VueJS, Spark, etc.

Trying to get dynamic routes to work:

{ path: '/books/:slug', component: Book }

with this in the web.php:

Route::get('/{vue_capture?}', '[email protected]');

And HomeController is:

public function vue() { return view('app'); }

Based on this in Laracasts: Setting up Vue-Router with Spark

and it 404s on any dynamic attempt /books/foo or /books/bar 404s every time.

04 Sep
2 weeks ago

jhull commented on Ignition Is Laravel's Amazing New Error Page

Curious. I was running the dev version of 6 a week or so before release. Still getting "Whoops" page even though php artisan --version tells me I'm running 6.0.0. Any ideas?

06 Apr
5 months ago

jhull started a new conversation Laravel Spark Capture Credit Cards At Time Of Register

The default install of Spark has the user Register first and then choosing Subscription on subsequent screens.

I want to set it up in much the same way that Laracasts has it here, where you do everything at once.

I realize LC doesn’t use Spark, but is there an easy way to convert Spark to this methodology?

27 Nov
9 months ago

jhull left a reply on With Spark 7, The Resume Subscription Doesnt Update On Stripe

Were you able to find a solution? I'm having the same problem.

09 Nov
10 months ago

jhull started a new conversation Laravel Spark 7.0.2 + 5.7.13, Anyone Have It Working?

Working all week to make these two work. Previous install of 6.0 with older version of Laravel worked fine. Trying to create a fresh new app with these products results in all kinds of errors.

First time compiling assets - says it can't because popper.js isn't installed. Fix that and then there are references to a /less folder that doesn't even exist in 5.7.

Maybe Spark didn't upgrade? No. Because there's a new getTranslations method in the SparkTokenProvider and it tries to grab a translation file that doesn't exist anywhere.

Really need to know if someone has been able to make these all work together, or do I need to find something else.

08 Nov
10 months ago

jhull left a reply on Spark API Returning A Login Page Not 401

This has been driving me crazy for days now. App worked great with last year's Laravel/Spark combo. Tried upgrading to latest and greatest this week and now I'm getting 401s.

Even tried base installation Laravel 5.7 and Spark 7.0.2 and put this one route in:

Route::group([
    'middleware' => 'auth:api'
], function () {
    Route::get('/test', function () {
        return ['name' => 'taylor otwell'];
    });
});

and this for home.js:

Vue.component('home', {
    props: ['user'],

    mounted() {
        axios.get('/api/test').then(response => {
            console.log(response.data);
        });
    },
});

And I get 401 Unauthorized in the console and logged out. $usesApi is set to True...

Shouldn't it work with only these two simple modifications? Or am I missing something?

19 Jun
1 year ago

jhull left a reply on Reponse::txt(). Is Possible Laravel 5 Returns A .txt File?

I've spent hours on this, and can't figure out what I'm doing wrong here - I have the exact code above, but when it comes to generating the response from the controller, all I see is the contents of the file in the browser - it's not automatically downloading the file instead.

The first time I click on the download link (which calls the controller that generates the response above) it shows me the contents of the file, no download. Yet, if I refresh the page with the contents - it downloads it as expected.

Can you anyone help explain why that is?

14 Apr
1 year ago

jhull started a new conversation Vue And Laravel Spark Authentication

Trying to find an answer to this...in the Spark docs, we’re told:

So, if you are using Vue, you may simply call your API routes like normal. No additional configuration is necessary to start consuming your API:

And it does, indeed, work. But what if I want to limit an index API call to just those posts that the user owns? (Through a user id column in the posts model).

I know how to do it in Laravel, but can’t seem to find info on how to check the user authentication when making API calls.

Do I just make an Auth call in the API controller? Or is there a specific better way to do it with VueJS?

10 Apr
1 year ago

jhull left a reply on Spark Not Showing Subscription Options

Count me another one as eternally grateful. Installed Lodash to support another feature, only to find Spark blanking out on subscriptions.

Your fix in your write-up worked perfectly!

Thank you.

09 Apr
1 year ago

jhull left a reply on Running `npm Install` On Server Deploy Using Forge

I'm still running into this issue and was wondering if anyone could help me figure out what's going on here.

Now, after running npm run production, committing the results, and pushing to Forge - not only will the changes not be reflected for a couple hours, but now the app won't even open on Safari!

I can get to the home page, but /login and everything else gives me a blank screen -- but only on Safari.

Does anyone have an idea of what this might be or how to fix it? Thank you

24 Jan
1 year ago

jhull left a reply on Spark Subscription Showing Monthly - Should Be Yearly

Uhhh...I actually appreciate you putting this out there. I made the same mistake. Thanks!

15 Dec
1 year ago

jhull left a reply on Fire Event After Team Register

Followed the above exactly to send an API call to email list app, and with Spark I'm getting an error message after the User tries to register (contact provider, the red modal that pops up).

Funny thing is, if I drop the event into a controller it works great:

        $user = $event->user;
        $api_key = '<secret>';

        $client = new Client();
        $url = "https://api.emailprovider.com/subscribe";
        $data = ['email' => $user->email, 'name' => $user->name, 'api_key' => $api_key];

        $response = $client->post($url, ['query' => $data]);

This works great in a controller, but as part of an event listener it's giving me that error in the Register window - with no extra info to try and figure out why.

I have HookRegisteredUser in App\Listeners that looks like the above with this wrapping it:

    public function handle(UserRegistered $event)
    {

and then in my App\Providers\EventServiceProviders.php I have this:

       'Laravel\Spark\Events\Auth\UserRegistered' => [
            'Laravel\Spark\Listeners\Subscription\CreateTrialEndingNotification',
            'App\Listeners\HookRegisteredUser',
        ],

Any ideas where the Error is coming from - in the Console I'm just seeing 500.

14 Dec
1 year ago

jhull left a reply on Running `npm Install` On Server Deploy Using Forge

Hopefully someone can shed some light on this for me-- couple months into Laravel/Forge, I'm noticing that when I do commit and push up, everything is there, the latest version of everything, but its like it doesn't recognize the latest version of app.js.

If I don't do anything, in a couple hours or so (or overnight), I'll come back the next morning and magically it's all fine.

Can someone explain to me why this is happening, and what the best workflow is?

The only add to this is my original install, which was just the latest Laravel, didn't really have this problem. It's only once I did a Laravel/Spark installation, that I've been having this problem with app.js which I assume is something I'm doing wrong during the compiling phase.

02 Dec
1 year ago

jhull left a reply on Bootstrap Styles Not Showing Up In Production Server Of Spark-ed App

I got it to work by running npm install on the production server. Not sure I understand the logic why, if I'm just pushing everything up from local to production, shouldn't that cover it?

01 Dec
1 year ago

jhull started a new conversation Bootstrap Styles Not Showing Up In Production Server Of Spark-ed App

Redid my app with Spark - worked great and looks great local. When I push up to server (Forge) - everything works except for some reason the Bootstrap styles aren't there -

My public/css/app.css is a mixture of tailwind and Bootstrap and I can actually see the styles from Tailwind working their way into the final product - but for some reason, the Bootstrap style--in the same exact file--just don't register.

Any ideas? I've been looking everywhere for an answer...

28 Nov
1 year ago

jhull started a new conversation Str_replace Not Working In Blade With <p> Tags

Why won't this work in my Blade view?

@php
echo str_replace('<p>', '<p class="text-sans">', $str);
@endphp

All I want to do is add a class (Tailwind) to a variable that has already been run through a Markdown method in my controller, but for some reason it won't replace the <p> tags.

14 Nov
1 year ago

jhull started a new conversation 500 Server Error With Axios

Absolutely love Laracasts - only been 6 weeks in and already set up a lot of what I wanted. I'm stuck, so badly stuck, on setting up Subscriptions with Stripe. It looks like some of the tutorial is outdated, or at least, there might be better practices by now.

I'm not getting a 500 error when trying to post with Axios (instead of the $http.post suggested in the video)

I've tried setting up the CSRF token any which way I can, then I find out it's supposed to be all built in - but then I'm not sure where to go. Here is my version of the CheckoutForm.vue:

<template>
            <form action="/subscriptions" method="POST">

            <input type="hidden" name="stripeToken" v-model="stripeToken">
            <input type="hidden" name="stripeEmail" v-model="stripeEmail">

            <select name="plan" v-model="plan">
                <option v-for="plan in plans" :value="plan.id">
                    {{ plan.name }} &mdash; ${{ plan.price / 100 }}
                </option>
            </select>

            <button id="stripeButton" class="btn btn-lg btn-block btn-primary" @click.prevent="subscribe">Get Started</button>
            </form>

</template>

<script>
    export default {
        props: ['plans'],

        data() {
            return {
                stripeEmail: '',
                stripeToken: '',
                plan: 1,
            };
        },

        created() {
            this.stripe = StripeCheckout.configure({
                key: Narrative.stripeKey,
                image: "https://s3.amazonaws.com/assets.narrativefirst.com/images/nflogo-brand.png",
                locale: "auto",
                panelLabel: "Subscribe For",
                token:(token) => {
                    this.stripeToken = token.id;
                    this.stripeEmail = token.email;

                    axios.post('/subscriptions', this.data)
                        .then(
                            response => alert('Complete! Thanks for your payment.'));
                }
            });
        },

        methods: {
            subscribe() {
                let plan = this.findPlanById(this.plan);

                this.stripe.open({
                    name: "The Book",
                    description: plan.name,
                    zipCode: true,
                    amount: plan.price,
                });
            },

            findPlanById(id) {
                return this.plans.find(plan => plan.id == id);
            }
        }
    }
</script>

and then here is the relevant store.blade:

<meta name="csrf-token" content="{{ csrf_token() }}">


    <script>
        var BookStore = {
            csrfToken: "{{ csrf_token() }}",
            stripeKey: "{{ config('services.stripe.key') }}"
        };
    </script>

  </head>

  <body>

    @include('layouts.nav')

    <div class="container-fluid">
      <div class="row">
        <main class="col-sm-12 ml-sm-auto col-md-11 pt-3" role="main"> 
            <div class="col-12">

            <div id="app">

            <article>
                <p>
                    <checkout-form :plans="{{ $plans }}"></checkout-form>
                </p>
            </article>

            </div>

            </div>

        </main>
      </div>
    </div>

also, this is my bootstrap.js which I modified based on other entries here and elsewhere...maybe I messed something up?

window.axios = require('axios');

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

/**
 * Next we will register the CSRF Token as a common header with Axios so that
 * all outgoing HTTP requests automatically have it attached. This is just
 * a simple convenience so we don't have to attach every token manually.
 */

let token = document.head.querySelector('meta[name="csrf-token"]');

if (token) {
    window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
    console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}

Can anyone please help me figure out what is going on here?