JohnBraun

JohnBraun

Developer at Enrise

Member Since 2 Years Ago

Netherlands

Experience Points
146,510
Total
Experience

3,490 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
1005
Lessons
Completed
Best Reply Awards
71
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 30
146,510 XP
May
27
1 month ago
Activity icon

Replied to Jeroen-G/laravel-packager ProcessTimedOutException When Creating A New Package

@getupkid203 @jeroen I can confirm that using a different vendor / package name (which does not exist on Packagist) works as it should using Laravel 7.13 and Laravel valet on Mac OS 10.15.3.

I was under the impression that composer would check the locally defined repositories first, however it turns out it first checks packagist and when it doesn't find a package there it falls back to a local package.

May
22
1 month ago
Activity icon

Replied to Single Sign-On Authentication (SSO)

In the definition of SSO, you have an identity provider and multiple resources that uses this central identity provider to authenticate users so they only ever need to have an account at the central identity provider instead of separate accounts for the underlying resources.

Socialite provides a solution for your users to authenticate themselves to your website using a third party website (integration). In that sense, Socialite provides SSO for your Laravel application, as users can use their central identity provider of choice (for example Google, Github, Twitter, etc.).

Additionally, socialite also provides an integration with Laravel passport if you want to use your own website as a central identity provider (instead of Google, Twitter, etc.). If you're interested in setting that up, I wrote a blog post on that topic a little while ago: https://johnbraun.blog/posts/oauth2-authentication-across-laravel-projects

Activity icon

Replied to Is There Any Support For Laravel Forge At All?

In Laravel Forge, there is a green chat button in the bottom right of your screen that allows you to contact the team. I raise your question there.

Activity icon

Replied to Generate .ics Calendar File In Php Laravel

I see that Spatie has a package for that, have you tried that one yet? https://github.com/spatie/calendar-links

// Generate a data uri for an ics file (for iCal & Outlook)
echo $link->ics();
May
17
1 month ago
Activity icon

Awarded Best Reply on Mock Notification Gives Get_class() Expects Parameter 1 To Be Object, String Given

The assertSentTo() method on Notification expects a User object (or any other "Notifiable" object in your application), but you are only passing the $email string.

If you pass in the User object that should fix your test.

Activity icon

Awarded Best Reply on Array To String Conversion

https://www.php.net/manual/en/language.variables.variable.php

It is because when calling $this->sponserTree->$array[i], the $array[i] variable is not evaluated. We can force evaluation of $array[$i] first by wrapping the variable in curly braces {}.

Activity icon

Replied to Array To String Conversion

https://www.php.net/manual/en/language.variables.variable.php

It is because when calling $this->sponserTree->$array[i], the $array[i] variable is not evaluated. We can force evaluation of $array[$i] first by wrapping the variable in curly braces {}.

Activity icon

Replied to Mock Notification Gives Get_class() Expects Parameter 1 To Be Object, String Given

The assertSentTo() method on Notification expects a User object (or any other "Notifiable" object in your application), but you are only passing the $email string.

If you pass in the User object that should fix your test.

Activity icon

Replied to 3 Table Relation

It looks to me like you need a Many to Many relationship which relates a certificate to a hotel instead of a hasManyThrough relationship.

https://laravel.com/docs/7.x/eloquent-relationships#many-to-many

The role_user pivot table in the example would be the certificate_list table in your case, having a hotel_id and certificate_id.

Activity icon

Replied to Array To String Conversion

Right, you'll want to use:

if (is_null($this->sponserTree->{$columns[$i]}))

Wrapping the stringified column in {}.

Activity icon

Replied to Array To String Conversion

Could you provide some more details about the problem you're trying to solve? The code seems quite confusing at first glance.

By the way, in your first example you're also returning a $col variable, but you never define it.

Activity icon

Awarded Best Reply on Php Artisan Queue:work Error

Have you tried the solution as suggested in this Stack Overflow post yet? https://stackoverflow.com/questions/29695450/pdoexception-sqlstatehy000-2002-no-such-file-or-directory

Which database driver are you using?

Activity icon

Replied to Select Specific Fields By Polymorphic Type While Using 'with'?

The functionality to select columns for polymorphic relations was added in this PR https://github.com/laravel/framework/pull/25662

I guess all columns have to be available in all the related tables if you want to eager load them.

Activity icon

Replied to Php Artisan Queue:work Error

Have you tried the solution as suggested in this Stack Overflow post yet? https://stackoverflow.com/questions/29695450/pdoexception-sqlstatehy000-2002-no-such-file-or-directory

Which database driver are you using?

Mar
15
3 months ago
Activity icon

Replied to Error With Camel Case Commands - Laracast Generators

I was thinking of submitting a PR, but then found this closed PR (https://github.com/laracasts/Laravel-5-Generators-Extended/pull/107) explaining the SeedMakeCommand will be deprecated soon anyways in favor of Laravel's php artisan make:seeder.

Mar
13
3 months ago
Activity icon

Awarded Best Reply on Does Laravel Need CAPTCHA

The CSRF token is not meant to prevent spamming, but from preventing form submissions from other websites (the cross site request forgery). Spambots visiting your website can still submit your form, as the CSRF token is included when they visit your page.

The idea of a CAPTCHA is that spambots can't easily get the answer/value. To block spambots you could and should implement a captcha.

Mar
12
3 months ago
Activity icon

Replied to Does Laravel Need CAPTCHA

The CSRF token is not meant to prevent spamming, but from preventing form submissions from other websites (the cross site request forgery). Spambots visiting your website can still submit your form, as the CSRF token is included when they visit your page.

The idea of a CAPTCHA is that spambots can't easily get the answer/value. To block spambots you could and should implement a captcha.

Feb
18
4 months ago
Activity icon

Awarded Best Reply on Tips On Streamlining CSS

Did you have a look at Tailwind CSS yet? This utility first CSS framework allows you to modularly add classes to style elements exactly how you'd like. Also, you can create standard "presets" called components to apply a bunch of classes at the same time.

https://tailwindcss.com

Activity icon

Replied to Trying To Build Web App For Daily Costs For Members In Work And Want Help About The Guidlie

I'm sure that if you'll follow this course here on Laracasts you can get up and running quite fast: https://laracasts.com/series/laravel-6-from-scratch

Just get Laravel running on your machine and experiment a bit. After you're somewhat familiar with the concept of the specifics of anMVC framework, you'll get a better understanding in how to set up your project.

Activity icon

Replied to Trying To Build Web App For Daily Costs For Members In Work And Want Help About The Guidlie

Try to follow along with the videos on Laracasts regarding development with Laravel, and try to build something that just works and implements basic functionality. Afterwards you can refactor/refine/add more features or ask more specific questions regarding your codebase on the forum.

For now, I think the question is a little broad...

Activity icon

Replied to Telescope 405 Method Not Allowed

Could you elaborate on your problem some more?

Did you change anything in the default Telescope serviceprovider?

/**
 * Register any application services.
 *
 * @return void
 */
public function register()
{
    $this->hideSensitiveRequestDetails();

    Telescope::filter(function (IncomingEntry $entry) {
        if ($this->app->isLocal()) {
            return true;
        }

        return $entry->isReportableException() ||
            $entry->isFailedJob() ||
            $entry->isScheduledTask() ||
            $entry->hasMonitoredTag();
    });
}
Activity icon

Replied to Tips On Streamlining CSS

Did you have a look at Tailwind CSS yet? This utility first CSS framework allows you to modularly add classes to style elements exactly how you'd like. Also, you can create standard "presets" called components to apply a bunch of classes at the same time.

https://tailwindcss.com

Activity icon

Replied to Error: Property [kpi_description] Does Not Exist On This Collection Instance

You define a relationship within your AppraisalGoal model that hasMany "appraisalgoaldetails, however you want to fetch a single "appraisalgoaldetail" in the$goal->appraisalgoaldetail->kpi_description` call in your view. That is not going to work.

Did you mean to implement a belongsTo relationship to AppraisalGoalDetail instead, perhaps?

Edit: basically what @sinnbeck says

Feb
17
4 months ago
Activity icon

Replied to Laravel Broadcast - Disconnect Previously Authorized User

Couldn't you listen to an additional event using Echo, redirecting the user (and therefore closing off access to the channel) whenever a RevokeAccess Event is broadcasted or something like that?

Activity icon

Replied to Using Socialite Not Able To Get Linkedin Id

Hi @shawdow

This is what LinkedIn calls a "vanity name" and can be requested using their profile API using the obtained access token. See https://docs.microsoft.com/en-us/linkedin/shared/integrations/people/profile-api?context=linkedin/consumer/context#request

Does this solve your problem?

Activity icon

Replied to Livewire Not Refreshing Data After Wire:Change

Dear @wallyj

I tried to reproduce your problem, using a simple array instead of a model (for simplicity sake), and the code is working as expected on the Livewire side of things. As soon as a task is checked off, it (directly) applies the completed class to the <span> element. Unchecking the task, it removes the class again (also without refreshing the page).

Livewire blade component

<div>
    <ul class="list-group">
        @foreach($this->tasks as $task)
            <li class="list-group-item d-flex-justify-content-between align-items-center">
                <div>
                    <input
                        type="checkbox"
                        wire:click="toggleTask({{ $task['id'] }})"
                        class="mr-4"
                        {{ $task['completed'] ? 'checked' : '' }}
                    >
                    <span class="{{ $task['completed'] ? 'completed' : '' }}">
                        {{ $task['body'] }}
                    </span>
                </div>
            </li>
        @endforeach
    </ul>
</div>

Livewire PHP component

<?php

namespace App\Http\Livewire;

use Livewire\Component;

class Tasks extends Component
{
    public $tasks = [
        ['id' => 1, 'completed' => false, 'body' => 'First task'],
        ['id' => 2, 'completed' => false, 'body' => 'Second task'],
        ['id' => 3, 'completed' => false, 'body' => 'Third task'],
    ];

    public function toggleTask(int $taskId)
    {
        $this->tasks[$taskId - 1]['completed'] = !$this->tasks[$taskId - 1]['completed'];
    }

    public function render()
    {
        return view('livewire.tasks');
    }
}

The strikethrough can be achieved by defining the CSS class:

.completed {
  text-decoration: line-through solid gray;
}
Activity icon

Replied to Passport: Login From External Website

It is definitely possible to use Socialite on one end while using Passport on the other. I wrote a blog about that here: https://johnbraun.blog/posts/oauth2-authentication-across-laravel-projects

Let me know if that has been of any help. Good luck!

Feb
14
4 months ago
Activity icon

Commented on What I Learned About Cypress On Day 2

Thanks for the videos Jeffrey! I would be in favor of your suggestion to create a Cypress series on Laracasts. I hadn't heard of Cypress before, but it seems like a really useful tool.