benbowler

benbowler

Member Since 9 Months Ago

Experience Points 140
Experience Level 1

4,860 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 Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

10 Oct
7 months ago

benbowler left a reply on Subscription Isnt Working On Spark

Actually it's not even the product id it's the plan id within a product.

You create a product, then a price plan and it's that id. If you let Stripe create the ids it will look like plan_XXXXXXXXXXXX.

I just spent half an hour looking at this so thought I'd contribute to anyone out there at the same point in future.

08 Oct
7 months ago

benbowler left a reply on Upload Profile Image To S3 Bucket

The issue with this is that the file is uploaded with put rather than storePublicaly so it won't be default be publicly accessible.

07 Oct
7 months ago

benbowler left a reply on Accessing Homestead/Vagrant Site From Different Device On Same Network

@5pArxz Good solution, you don't actually need to update the hosts file for that to work. You can just hit [LOCAL NETWORK IP]:8000. Easy :)

24 Aug
8 months ago

benbowler started a new conversation UserRegistered Event Looses All Data Except Tax_code When Passed To Listener

I've created a Laravel Listener on the UserRegistered event to link up some data to the users account based on their email. I've hit a bit of a wall however. I broadly followed this Stack Overflow post and created a nice Listener pretty easily. -> https://stackoverflow.com/questions/36975310/how-to-hook-into-spark-events-on-register

However, when I pull in the User $user object in the Listeners constructor, all it contains is the tax code, even though if I debug from within the RegisterController.php file the full user object is passed to the event.

My Listener:

<?php

namespace App\Listeners\Auth;

use Illuminate\Support\Facades\Log;

// use App\Events\Laravel\Spark\Events\Auth\UserRegistered;
use Laravel\Spark\Events\Auth\UserRegistered;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Contact;
use App\Message;
use App\User;

use Illuminate\Queue\SerializesModels;

class LinkExistingMessagesAndContacts
{
    use SerializesModels;

    /**
     * The user instance.
     *
     * @var \Illuminate\Contracts\Auth\Authenticatable
     */
    public $user;

    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(User $user)
    {
        Log::info('$user at the __construct level');
        Log::info($user);
        // Create the user object
        $this->user = $user;
    }

    /**
     * Handle the event.
     *
     * @param  UserRegistered  $event
     * @return void
     */
    public function handle(UserRegistered $event)
    {
        // Link the existing messages and contacts with this email
        // This makes sure that the users Inbox and Sent messages sections are
        // correctly filled on registration

        // TODO - wait to call this event until the email is validated.
        // Users could potentially sign up with emails that aren't theres to
        // gain unauthorised access to files and messages without this verification
        $user_id = $this->user->id;
        $email = $this->user->email;

        Log::info('$this->user at the LinkExistingMessagesAndContacts level'); // ($this->user));
        Log::info($this->user);

        // Link existing Messages
        Message::where("email", $email)->update(array('user_id' => $user_id));

        // Link existing Contact
        Contact::where("email", $email)->update(array('user_id' => $user_id));

        // TODO create historic Spark notifications for each inbox and sent item

    }
}

The debug output:

[2018-08-24 09:41:02] local.INFO: $user at register controller level
[2018-08-24 09:41:02] local.INFO: {"name":"Fron","email":"[email protected]","uri":"from","last_read_announcements_at":{"date":"2018-08-24 09:41:02.651979","timezone_type":3,"timezone":"UTC"},"trial_ends_at":"2018-09-03 09:41:02","updated_at":"2018-08-24 09:41:02","created_at":"2018-08-24 09:41:02","id":22,"tax_rate":0}
[2018-08-24 09:41:02] local.INFO: $user at the __construct level
[2018-08-24 09:41:02] local.INFO: {"tax_rate":0}
[2018-08-24 09:41:02] local.INFO: $this->user at the LinkExistingMessagesAndContacts level
[2018-08-24 09:41:02] local.INFO: {"tax_rate":0}