benjackson

benjackson

Member Since 3 Years Ago

Experience Points 42,990
Experience Level 9

2,010 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 418
Lessons
Completed
Best Reply Awards 1
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.

23 Nov
1 year ago
22 Nov
1 year ago

benjackson started a new conversation How To Push A Component Onto List Of Dynamic Components

I have a set of items which I'm displaying in a v-for list, and each list item is a component.

<component v-for="(item, index) in feed"
                        :is="item.type"
                        v-bind:data="item"
                        v-bind:list="list"
                        v-bind:index="index"
                        v-bind:key="item.id"></component>

Another component on the page has an event listener waiting for some user input. Is there a way I can take the data, push it into my array of items, and have it new up the vue component?

Something like:

this.feed.push(new Component(data) )

but in a Vuejs friendly way?

05 Jul
1 year ago

benjackson left a reply on Setup The Website On First Time Access

If you add a boolean to your users table, called say 'hasCompletedSetup' you can check for this using middleware when a user logs in, and redirect them appropriately.

30 May
2 years ago

benjackson started a new conversation Email Unsubscribe Bug

@JeffreyWay Just thought I'd let you know I noticed when I'm unsubscribing from a discussion I had previously wanted to be notified about, I'm unsubscribed from the last in the list, rather than the one I selected.

Great work otherwise!

benjackson left a reply on How To Post Data To A Protected Route Using Axios And Vue

You're not missing anything, normally with ajax you need to include a token, as you have with the api routes.

But with the default configuration that you get out of the box, you get the authenticated user added to every request, including ajax requests. It's added for you.

benjackson left a reply on How To Post Data To A Protected Route Using Axios And Vue

If your web-based version of the app is using Laravel's views with vue, then the normal auth middleware will work. The authentication/session details are read from the cookie.

28 May
2 years ago

benjackson started a new conversation ReflectionException Repository Does Not Exist

Hey All,

This one has been bugging me for hours, I can't see what I'm missing. I have an interface

<?php 

namespace App\Contracts\Repositories;

interface UserFeedRespository
{
    public function getFeedForUser();
}

with its implementation

<?php

namespace App\Repositories;

use App\Contracts\Repositories\UserFeedRespository as UserFeedRespositoryContract;

class UserFeedRepository implements UserFeedRespositoryContract
{
    
    public function getFeedForUser()
    {
        
    }
}

I've added a binding to my AppServiceProvider:

$services = [
            'App\Contracts\Repositories\UserFeedRespository' => 'App\Repositories\UserFeedRepository',
        ];

        foreach ($services as $key => $value) {
            $this->app->bind($key, $value);
        }

and yet my controller is throwing a RefectionException Class App\Contracts\Repositories\UserFeedRepository does not exist.

<?php

namespace App\Http\Controllers;

use Auth;
use Illuminate\Http\Request;
use App\Contracts\Repositories\UserFeedRepository;

class HomeController extends Controller
{
    
    protected $feedRepository;

    public function __construct(UserFeedRepository $feedRepository)
    {
        $this->feedRepository = $feedRepository;
    }
    
    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $userCars = Auth::user()->vehicles()->get();
        
        return view('application.home', [
            'cars' => $userCars,
        ]);
    }

    public function getFeed(UserFeedRepositoryInterface $feedRepository)
    {
        $feed = $this->feedRepository->getFeedForUser();
        return $feed;
    }
}

I've tried composer's dump-autoload, but no luck. Can anyone see an obvious gotcha?

05 May
2 years ago

benjackson started a new conversation Sites Using Spark

Has anyone seen a Laravel Spark application being used in the wild? Just curious to see what people are using it to build!

21 Mar
2 years ago

benjackson left a reply on Bootstrap Wizard

Take a look at the v-if on the "Submit" button. It should give you a clue!

17 Oct
2 years ago

benjackson left a reply on Spark Multiple Billing Accounts

If your using stripe, you could dynamically set the API key when you make a charge, so the payment is directed to the right account.

11 Oct
2 years ago

benjackson left a reply on Chaining Filters In Vue 2.0?

After some work I came to a solution that uses lodash and some method decorating to chain the filters. Here's my solution if anyone finds this useful:

''' computed: { filteredJobs: function() { return this.filterIndustry(this.filterJobType(this.jobs)) } },

methods: { filterIndustry(jobs) { if ($.isEmptyObject(this.industries)) { return jobs }

            if (!$.isEmptyObject(this.industries)) {
                var self = this
                
                return _.filter(jobs, function(job) { 
                    return _.chain(job.industry)
                            .map('name')
                            .intersection(self.industries)
                            .size()
                            .gt(0)
                            .value() 
                }); 
            }
        },
        filterJobType(jobs) {
            if ($.isEmptyObject(this.jobtype)) {
                return jobs
            }

            if (!$.isEmptyObject(this.jobtype)) {
                var self = this
                return _.filter(jobs, function(job) {
                    return _.includes(self.jobtype, job.job_type)
                })
            }
        },
06 Oct
2 years ago

benjackson started a new conversation Chaining Filters In Vue 2.0?

So according to the documentation, the filter feature is gone from vue 2.0, and the recommended approach would be computed properties. How would one go about chaining these? For example, I need to filter a set of records according to some user selections:

The Html:

<input type="checkbox" id="design" value="Design" v-model="industries">
<label for="design">Design</label>
<input type="checkbox" id="development" value="Development" v-model="industries">
<label for="development">Development</label>

{{ industries }}

<input type="checkbox" id="fulltime" value="fulltime" v-model="jobtype">
<label for="fulltime">Full Time</label>
<input type="checkbox" id="parttime" value="parttime" v-model="jobtype">
<label for="parttime">Part Time</label>

{{ jobtype }}

<tr v-for="job in filteredjobs">
<!-- ID -->
<td style="vertical-align: middle;">{{ job.id }}</td>
<!-- Title -->
<td style="vertical-align: middle;">{{ job.title }}</td>
<!-- Type -->
<td style="vertical-align: middle;">{{ job.job_type }}</td>
<td style="vertical-align: middle;">
             <div v-for="industry in job.industry">{{ industry.name }}</div>
</td>

and then vue:

data() {
            return {
                jobs: [],
                industries: [],
        jobtype: [],
               }
        },

computed: {
        filteredJobs: function() {

        }
}

How do I filter Jobs by the chosen Industries and Jobtypes?

04 Oct
2 years ago

benjackson left a reply on [Laravel 5.3] Error On Gulp Execution

@sailingdeveloper @lcf8381595 I hit the same issue as you guys. Turns out

 npm install buble-loader

fixes the issue. Source: https://github.com/laravel/elixir/issues/643.

23 Feb
3 years ago

benjackson left a reply on Factory() Undefined

Ok, Nevermind! Not as fresh of an install as I thought. Required 5.1 or higher.

benjackson started a new conversation Factory() Undefined

Just trying to set up a couple of Model factories, this is on a fresh install. The factory() method is coming back undefined in my Seed file, and in Artisan Tinker too.

Here's the seeder:

use Illuminate\Database\Seeder;
use App\Models\Client;
use Faker\Provider;

class TestSeederTableSeeder extends Seeder
{
    public function run()
    {
        factory(Client::class, 10)->create();  
    }
}

I thought this was a global function?