derekmcwhinnie

derekmcwhinnie

Member Since 4 Years Ago

Experience Points 3,390
Experience
Level
Lessons Completed 187
Lessons
Completed
Best Reply Awards 0
Best Answer
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.

06 Sep
2 years ago

derekmcwhinnie started a new conversation Artisan Output Colours (low Contrast = Unreadable)

Has anyone had a problem with the colour of artisan error messages coming out as light grey on dull red. This colour combination makes error messages almost unreadable.

18 Jul
2 years ago

derekmcwhinnie left a reply on Phpunit Woes

It's a broken symlink to phpunit when project files are installed with larval installer and not composer. Easy to fix......

delete file "vendor/bin/phpunit" delete folder "vendor\phpunit" run composer update

everything will be reinstalled and all will start working again.

30 Jun
2 years ago

derekmcwhinnie left a reply on Laravel Artisan Schedule Run Getting Invalid Foreach

I too have hosted a Laravel app on a shared host. I too have had the same problems with the scheduler. The solution I have found does not agree with the answers above.

Firstly, "register_argc_argv " set to ON or OFF made absolutely no difference to the scheduler. It still failed with a "'ErrorException - Invalid argument supplied for foreach()".

The solution (for me) appears to be the way the cron job is set up. The Laravel documentation states that the cron job should be set up thus..... * * * * * php /home/path/to/artisan schedule:run 1>> /dev/null 2>&1 but for me this did not work. My solution (after a lot of googling...) was to use this instead * * * * * php-cli -q /home/path/to/artisan schedule:run >> /dev/null 2>&1 very similar but not identical.

The "1" after the "schedule:run" causes the Symphony Console component to raise a "Too many arguments exception". I removed the "1" and the error changed so it was having an effect.

The main issue seems to be the use of "php-cli" instead of plain old "php. After this change was implemented everything just started to work as expected.

02 Apr
2 years ago

derekmcwhinnie left a reply on How To Add ServiceProviders And Facades To Only Development Configuration

Add this to AppServiceProvider....

public function register ()
    {
        //register the service providers for local environment
   
        if ( $this->app->isLocal() )
        {
            if ( ! empty( $providers = config( 'app.dev_providers' ) ) )
            {
                foreach ( $providers as $provider )
                {
                    $this->app->register( $provider );
                }
            }

            if ( ! empty( $aliases = config( 'app.dev_aliases' ) ) )
            {
                foreach ( $aliases as $alias => $facade )
                {
                    $this->app->alias( $alias, $facade );
                }
            }
        }
}

Add this to config.app

'dev_providers' => [
        /*
         * Application Service Providers for development only...
         */
        Somedev\SomePackage\SomePackageServiceProvider::class,
    ],
  'dev_aliases' => [
        /*
         * Aliases to be loaded in development only...
         */
        'DevAlias'      => SomePackage\Facades\AliasClass::class,
    ],

We can define service providers in config.app as usual but know they will only be registered/loaded when the environment is development/local. So when you do a "composer up --nodev" to clear out dev packages then the code won't fail.

I've looked at alot of solutions to this problem and the above is a mixture of then all. Some great ideas out there and all I've done is brought them together to keep it all Laravesque.

Hope it helps someone.

23 Mar
2 years ago

derekmcwhinnie left a reply on SqLite "no Such Table" Error In Unit Tests With Migrations

I have (hopefully had) a very similar problem with a table not found error when running phpunit. The test worked fine when using my development database (local.sqlite) but failed when I used the phpunit configuration (phpunit.sqlite). Simply trying to have a separate DB for the unit tests.

After alot of head scratching and stepping through the code it appears that the database to be used for tests must be migrated manually once after creation to initialise it BEFORE the tests are run. The DatabaseMigrations trait appears to expect a base migration to exist already before it can roll it back. It does not appear to like a completely empty sqlite file (as created with "touch abc.sqlite" etc.

I set up a config.database with this entry

'phpunit' => [ 'driver' => 'sqlite', 'database' => storage_path('phpunit.sqlite'), 'prefix' => '', ],

the phpunit.xml file had these entries

then I ran

php artisan migrate --database='phpunit'

After this phpunit stopped complaining and all test started to behave.

20 Oct
4 years ago

derekmcwhinnie left a reply on Errors Not Showing In Laravel 5 App

When "storage/meta/compiled.php" doesn't exist (as in my case) then do " 'php artisan optimize' in your app's directory directly on your Vagrant box." as nwitthaus said above. This worked for me.