Martenvanurk

Martenvanurk

Member Since 7 Months Ago

Experience Points 21,240
Experience Level 5

3,760 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 195
Lessons
Completed
Best Reply Awards 3
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

05 Apr
3 months ago

Martenvanurk left a reply on Tree Of Categories

Follow the code I paste above and follow the instructions for jsTree. Probably something like $('#selector').treed();

23 Jan
5 months ago

Martenvanurk left a reply on Multiple Polymorphic Relationship In One Model

Think you can learn from the following article:

https://www.easylaravelbook.com/blog/creating-polymorphic-relations-in-laravel-5/

If you've any questions after it let me know!

Martenvanurk left a reply on Access $notifiable Variable In Layout Html Email Template

public function toMail($notifiable)
{
    return (new MailMessage)
        ->subject('Verify Email')
        ->view(
        'mail.email-verification-email', ['notifiable' => $notifiable]
    );
}

Think you should always pass it within the view like above.

21 Jan
5 months ago

Martenvanurk left a reply on Access $notifiable Variable In Layout Html Email Template

Im confused about the vendor/ folder. Is youre namespace setup correctly?

Martenvanurk left a reply on Losing Intended URL After Using It Once. Really Strange Behavior.

The intended method on the redirector will redirect the user to the URL they were attempting to access before being intercepted by the authentication middleware. A fallback URI may be given to this method in case the intended destination is not available.

With the / you're providing a fallback URI, so:

if you're logging in from your / route, you will redirect back to / unless this isn't available. I recommend to just redirect to an URL like so:

return Redirect::to($targetURL);

Martenvanurk left a reply on Tree Of Categories

In your Entities\Category you can define the following relations:

public function parent()
    {
        return $this->belongsTo('App\Entities\Category', 'parent_id');
    }

    public function children()
    {
        return $this->hasMany('App\Entities\Category', 'parent_id');
    }

So you can find all the children and the parent.

In my app, I fetch the root categories en pass it through to a view like so:

<ul id="tree1">
                            @foreach($categories as $category)
                                <li class="categoryListener" data-id="{{ $category->id }}">
                                    {{ $category->name }}
                                    @if(count($category->children))
                                        @include('Categories.childmenu',['childs' => $category->children])
                                    @endif
                                </li>
                            @endforeach
                        </ul>

and categories.childmenu looks like:

<ul>
    @foreach($childs as $child)
        <li class="categoryListener" data-id="{{ $child->id }}">
            {{ $child->name }}
            @if(count($child->children))
                @include('Categories.childmenu',['childs' => $child->children])
            @endif
        </li>
    @endforeach
</ul>

And I render it all with a jQuery plugin: jsTree (https://www.jstree.com/)

Martenvanurk left a reply on Axios Mixed Content

Is your Heroku environment secure? Like your APP_URL env variable? Looks like it will use the non secure version

Martenvanurk left a reply on Access $notifiable Variable In Layout Html Email Template

I think all public members of the mailable / notifable are available for you.

Martenvanurk left a reply on Multidimensional GroupBy() (day Then Week Then Month)

$query = Post::where('created_at', '>=', Carbon::now()->subMonth())
            ->get()
            ->groupBy(function($q) {
        return [
                     'today' => Carbon::parse($q->created_at)->format('d'),
                     'week' => Carbon::parse($q->created_at)->format('w'),
                ];
            });

Something like this maybe?

Martenvanurk left a reply on Multidimensional GroupBy() (day Then Week Then Month)

You can pass a function in the groupBy like so:

groupBy(function($query) {
    // here you can do different stuff like for example a lookup table
})

Martenvanurk left a reply on Reset / Turn Off Phpunit Test Coverage In PhpStrom

You can indeed choose different running configurations! Glad it's fixed! Have a nice day!

Martenvanurk left a reply on Reset / Turn Off Phpunit Test Coverage In PhpStrom

Ok when you're point to the Run > Edit configurations. Look for your configuration and fill in the Test runner options field the "no-coverage" option mentioned above.

Martenvanurk left a reply on Reset / Turn Off Phpunit Test Coverage In PhpStrom

And how are you running your tests? on the commandline or from the PHPStorm IDE?

Martenvanurk left a reply on Any ERP Made On Laravel? ERP Module Based Structure?

I've created an ERP and make use of Laravel Voyager from the control group. But what about giving Laravel Nova a try?

Martenvanurk left a reply on Reset / Turn Off Phpunit Test Coverage In PhpStrom

You can disable the logging part in your phpunit.xml or run the command with --no-coverage

18 Jan
6 months ago

Martenvanurk left a reply on Cant Send Mail In Laravel 5.3

Please remove your credentials from mailtrap :) otherwise everyone can use it

Martenvanurk left a reply on Cant Send Mail In Laravel 5.3

Did you setup your .env file with the right mail settings?

Martenvanurk left a reply on Sending An Email Notification

I think you can create an event for this. In the event you can use the Mailable functionality of Laravel.

https://laravel.com/docs/5.7/events https://laravel.com/docs/5.7/mail

So subscribe to the event 'answer posted' and after the broadcast of this event, send the e-mail

Martenvanurk left a reply on Determine Api Or Web Route Inside Controller?

You can watch the gates of authentication