tnorthcutt

Experience

4,090

0 Best Reply Awards

  • Member Since 2 Years Ago
  • 45 Lessons Completed
  • 1 Favorite

11th June, 2017

tnorthcutt left a reply on Require.extensions.hasOwnProperty Is Not A Function • 3 months ago

There's a PR on Elixir; hasn't been merged yet: https://github.com/laravel/elixir/pull/723

I downgraded node to 6 in the meantime.

9th June, 2017

tnorthcutt left a reply on Blade Autocompletion (with PHPStorm) • 3 months ago

For anyone else who runs across this in the future, this is relevant: https://blog.jetbrains.com/phpstorm/2017/02/code-completion-in-laravel-blade-templates/

11th January, 2017

tnorthcutt left a reply on Passing Selected Plan To /register Page Via Url Parameters • 8 months ago

Turns out you can pass plan=plan-id as a url parameter – this was fixed in https://github.com/laravel/spark/pull/514/

10th January, 2017

tnorthcutt left a reply on Passing Selected Plan To /register Page Via Url Parameters • 8 months ago

Sorry, I probably wasn't clear.

I do want to show the plans on the landing page, but that's on a separate marketing site. So I've got my marketing site at example.com with the plans shown, and my app at app.example.com.

tnorthcutt started a new conversation Passing Selected Plan To /register Page Via Url Parameters • 8 months ago

I'm wondering if it's possible/reasonable to, instead of displaying all plans on the /register page, allow passing the selected plan in via a url parameter. My use case is that I'd like the plan to be chosen on a sales/landing page, and not display all the choices again on the registration page.

26th August, 2016

tnorthcutt left a reply on Help With Latest And Eloquent Relationships • 1 year ago

Apparently this is intended behavior, so I'll stick to using latest() and getting all scores.

tnorthcutt started a new conversation Help With Latest And Eloquent Relationships • 1 year ago

In my Member model, I have the following:

public function scores()
{
    return $this->hasMany('App\Models\Score');
}

public function latestScore()
{
    return $this->hasMany('App\Models\Score')->latest();
}

And in my MemberController.php I have:

public function index()
{
    $members = $this->memberRepository->all()->load('latestScore');
    return view('members.index')->with('members', $members);
}

Currently, this works, but it results in a query for all the scores for all the members, as opposed to just the latest score for each member:

select * fromscoreswherescores.member_idin ('10', '9') order bycreated_atdesc

I've tried rewriting my latestScore() method and adding e.g. ->limit(1), but this results in a query like:

select * fromscoreswherescores.member_idin ('10', '9') order bycreated_atdesc limit 1

Which means a score is only loaded for one Member. Any suggestions?

29th July, 2016

tnorthcutt left a reply on Changing User Model Name For Spark • 1 year ago

This may help: https://spark.laravel.com/docs/1.0/customization#model-classes

The example given is for changing the namespace, but you could try it.

22nd July, 2016

tnorthcutt left a reply on .gitignore What Should Be Ignored? • 1 year ago

@sg1asgard https://www.gitignore.io/ produces a lock file for Laravel with composer.lock ignored, FWIW.

11th May, 2016

tnorthcutt left a reply on Spark API Says Unauthorized • 1 year ago

Not sure - I'm new to Spark too :). This may be of interest, though. Taken from this thread, which it looks like you've seen.

tnorthcutt left a reply on Spark API Says Unauthorized • 1 year ago

Looks like that route uses the auth:api middleware, so you wouldn't expect it to work when logged out, right? Unless you're passing the token in your request, in which case I'd suggest comparing the request when logged out and when logged in to see what the difference is.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.