Lars-Janssen

Lars-Janssen

Member Since 4 Years Ago

Tilburg

Experience Points
151,205
Total
Experience

3,795 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
944
Lessons
Completed
Best Reply Awards
47
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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 31
151,205 XP
Apr
29
1 month ago
Activity icon

Replied to Testing Jobs

@achatzi thx, but not really a fan of that. I don't always want to fire a job.

Activity icon

Started a new Conversation Testing Jobs

Hi,

I've fire 2 jobs in a listener:

$payment = CreateSubscriptionPaymentJob::dispatchNow($subscription);

CreateSubscriptionOrderJob::dispatch($payment);

Now I want to test this. Currently I have this:

/** @test */
public function test_jobs_are_fired()
{
    $this->expectsJobs([
        CreateSubscriptionPaymentJob::class,
        CreateSubscriptionOrderJob::class
    ]);


    event(new SubscriptionVerified());
}

The problem is that a CreateSubscriptionOrderJob job expects a $payment. Because the handle method of the job is never executed no payment is returned. I get this error in my test:

TypeError: Argument 1 passed to App\Jobs\Order\CreateSubscriptionOrderJob::__construct() must be an instance of Domain\Payment\Models\Payment, null given, called in 

Any idea how I can test both jobs are fired ?

Activity icon

Replied to Laravel Job Dispatch Now

@achatzi you are right sorry about that haha, had a mistake in my tests. Thx for helping!

Activity icon

Replied to Laravel Job Dispatch Now

@achatzi hey thanks for helping. dispatchNow is a method in a trait I'm implementing. It does the following:

 /**
     * Dispatch a job to its appropriate handler in the current process.
     *
     * @param  mixed  $job
     * @return mixed
     */
    public function dispatchNow($job)
    {
        return app(Dispatcher::class)->dispatchNow($job);
    }

The method getPayment() is a method I've implemented in my job that returns a payment. Your example does not work unfortunately.

Activity icon

Started a new Conversation Laravel Job Dispatch Now

Hi,

I'm trying to get a return value from a Laravel Job:

$job = new CreateSubscriptionPaymentJob($subscription);

$this->dispatchNow($job);

CreateSubscriptionOrderJob::dispatch(
    $job->getPayment()
);

But when I dd('test'); in the handle method from the CreateSubscriptionPaymentJob:

public function handle(): void
{
    dd('test');
}

It never shows up! I'm testing this with a php unit test. My QUEUE_CONNECTION is set to sync, so nothing is being queued.

What could be going on here?

Apr
20
1 month ago
Apr
19
1 month ago
Activity icon

Started a new Conversation Laravel 7 Nova Github Action Not Working Anymore

Hi,

I've upgraded my app to Laravel 7 (with Laravel Nova). But now my github action is failing:

- Installing laravel/nova (3.0.x-dev 73f71a3): Downloading (connecting...)Downloading (0%)           Downloading (failed)    Failed to download laravel/nova from dist: The "https://api.github.com/repos/laravel/nova/zipball/73f71a38401dfbdfd6130a0fcc392a9c621b4e45" file could not be downloaded (HTTP/1.1 404 Not Found)
    Now trying to download from source
  - Installing laravel/nova (3.0.x-dev 73f71a3): Cloning 73f71a3840

                                                                                                                                                                                                                                                                                                                                                                                                                              
  [RuntimeException]                                                                                                                                                                                                                                                                                                                                                                                                          
  Failed to execute git clone --no-checkout '[email protected]:laravel/nova.git' '/__w/project/vendor/laravel/nova' && cd '/__w/orihect/vendor/laravel/nova' && git remote add composer '[email protected]:laravel/nova.git' && git fetch composer && git remote set-url origin '[email protected]:laravel/nova.git' && git remote set-url composer '[email protected]:laravel/nova.git'  
                                                                                                                                                                                                                                                                                                                                                                                                                              
  Cloning into '/__w/project/vendor/laravel/nova'...                                                                                                                                                                                                                                                                                                                                                  
  Host key verification failed.                                                                                                                                                                                                                                                                                                                                                                                               
  fatal: Could not read from remote repository.                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                              
  Please make sure you have the correct access rights                                                                                                                                                                                                                                                                                                                                                                         
  and the repository exists. 

My github action looks like this:

name: Laravel

on: [push]

jobs:
  phpunit:
    runs-on: ubuntu-latest
    container:
      image: kirschbaumdevelopment/laravel-test-runner:7.4

    services:
      mysql:
        image: mysql:5.7
        env:
          MYSQL_ROOT_PASSWORD: password
          MYSQL_DATABASE: test
        ports:
          - 33306:3306
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

    steps:
      - uses: actions/[email protected]
        with:
          fetch-depth: 1

      - name: Install composer dependencies
        run: |
          php --version
          composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_PASSWORD }}"
          composer install -n --prefer-dist
      - name: Prepare Laravel Application
        run: |
          cp .env.ci .env
          php artisan key:generate
      - name: Migrate database
        run: |
          php artisan migrate --database=mysql_testing
      - name: Run Testsuite
        run: vendor/bin/phpunit tests/
      - uses: 8398a7/[email protected]
        with:
          status: ${{ job.status }}
          text: overwrite text
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
        if: always()

I've defined the NOVA_USERNAME and NOVA_PASSWORD in my github secrets. It was working before but now it doesn't. Nova is updated to version 3 has it something to do with that?

Please let me know.

Mar
13
2 months ago
Activity icon

Commented on Make Your Apps Faster With Turbolinks

Cool! I was wondering why Laracasts does not use it ?

Mar
08
2 months ago
Activity icon

Started a new Conversation Laravel Airlock Route For Authenticated + Unauthenticated

Hi,

I'm using the new Laravel Airlock package for an app I'm building. I have a route that can be accessible for authenticated and unauthenticated users.

In the controller I check if the user is authenticated with Auth::check();. My route looks like this:

Route::get('post', [PostController::class, 'index'])->name('posts');

The problem is that if I make a request with an authenticated user (with a bearer token), I can't get the authenticated user in the controller (no idea why). And if I add the auth:airlock to the route, it's only accessible to authenticated users (not want I want).

How can I make sure I get the authenticated user in my controller if there is one ?

Feb
21
3 months ago
Activity icon

Replied to How To Create A Constant Which Value Is From Get Axios Result In VueJS

this.mylist = response.data.searchable_columns; ?

Jan
31
4 months ago
Activity icon

Commented on Deferred Loading And Caching Server-Fetched Partials

Nice thanks great lesson!