MartinFolkerts

MartinFolkerts

Member Since 4 Years Ago

Experience Points
47,580
Total
Experience

2,420 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
458
Lessons
Completed
Best Reply Awards
2
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.

Level 10
47,580 XP
Dec
02
1 month ago
Activity icon

Replied to Route Variable But Not Parameter

Hi, I recently had a look at: "hyn/multi-tenant", https://tenancy.dev/docs/hyn/5.4/models

This is an implementation of mta that uses multiple database connections. What I remember is that they use a model trait (UsesTenantConnection) to set the database connection (in the __contructor) this way the it gets switched before you query.

i think you can switch the db connection in laravel like:

 $this->config->set('database.default', $default);
Activity icon

Replied to Global Scope For User Model

I think you should disable it in the boot method of the model the scope is applied to. But I have not tested this

class User extends Model
{
    /**
     * The "booting" method of the model.
     *
     * @return void
     */
    protected static function boot()
    {
        parent::boot();

        // if (your condition) {
        User::withoutGlobalScope(UserScope::class)->get();
        //}
    }
Oct
20
3 months ago
Activity icon

Replied to Form Without Data Is Also Inserting In Table

You could skip your save when null

Activity icon

Replied to Form Without Data Is Also Inserting In Table

Could you dd($request->td_item_desc); You might be posting an empty element.

Oct
04
3 months ago
Activity icon

Replied to Generating Fake Data (using Faker) In A DB Table With A 'unique' DB Constraint?

What you could do is make a generate a unique list some where and then draw from that list every time you need a set.... This way you do the work once and up front.....

Activity icon

Started a new Conversation Upgrade From Laravel 3 To Latest

Does anyone have experience with upgrading a laravel project from version 3 and/ or is there an upgrade guide somewhere to be found? I see the upgrades from 4.2 upwards, but wonder what happend with the lower versions.

Jul
31
5 months ago
Activity icon

Replied to Cache Certain Queries Results

Hi, You could consider having a cache_page_count table in your db as a data storage for a cronjob that updates the stats daily. If you would have a page_key column for each page and a count column for the stats you can just query this table which should be considerably faster then 1 second. For bonus points you could add the $timestamp fields larval provides out of the box. This gives you the possibility to later track stats over pages and dates....

Activity icon

Replied to Validation: Required_unless Or Required_if With Multiple Fields

Hi,

What I do when encountering this problem is dynamicly build the rules array.


    $rules = [
        'title' => 'required|unique:posts|max:255',
        'body' => 'required',
    ];

if (.. someCondition) {
  $rules['field'] = ".. custom validator ..";
}
Activity icon

Replied to Return All Rows For GroupBy

Is this not what you are asking? ->groupBy('user_id') gives you a grouped result set for a every given user

Activity icon

Replied to How Can This Code Be Refactored To Follow SOLID Principals

Hi what I do is do something you are suggesting as a first step. Create a folder in app with the name of your package. I would not prefix all files with the package name, it feels redundant . If the package is self contained you can consider pulling it in with composer as a standalone package and refactoring it that way. Jeffrey has some content regarding this subject (https://laracasts.com/series/how-to-create-custom-presets/episodes/4)

Jul
29
5 months ago
Activity icon

Replied to App.js Not Updating When Using Vue

Did the new app.js compile without errors? And did you bust your browser cache?

Activity icon

Replied to Custom LoginController For Nova

@tylernathanreed

overriding the entry in the service container makes a lot of sense. Thanks for the reply.

Activity icon

Replied to Problem Migrating Laravel 5.1 Php5.6 To L5.8 Php7.2

No No, I was not explicit on this I see this now but I did follow the upgrade guides. . The problem can be a php5 to 7 issue or a laravel issue ... or something with the code in general. I also added a code snippet to illustrate my problem

Activity icon

Started a new Conversation Problem Migrating Laravel 5.1 Php5.6 To L5.8 Php7.2

Hi,

I'm migrating a application from an old platform php5.6 laravel 5.1 to a newer platform php7.2 and laravel 5.8 and I'm experiencing some difficulties at the end of the road (or at least I hope this is the end..)

I have Two models Q and M where Q M extends Q; If I hit code from an instance of M calling a instance method on Q which uses a QueryBuilder of Q. The QueryBuilder resolves to the underlying table of class M. And I cannot figure out why this would be the case.


(new M)->someMethod();

class Q extends BaseModel{
    protected $table = 'qTable';

    public function uses() {
        Q::getTable(); //resolves to 'mTable' not 'qTable'. 
    }

}

class M extends Q {
    protected $table = 'mTable';

    public function someMethod() {
        ...

        if ($this->uses()) {

                ....
    }
}