AsTeR
AsTeR

Reputation: 7521

Laravel service provider is not executed

I have basically called: php artisan make:provider RiakServiceProvider but the new provider does not seem to be called. I have added a var_dump in both boot and register methods.

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class RiakServiceProvider extends ServiceProvider
{
    public function boot() {
        var_dump('Should be call second');die;
    }

    public function register() {
        var_dump('Should be call first');die;
    }
}

But this does not seem to be called. Neither through the web server, neither in PHPUnit?

Upvotes: 1

Views: 906

Answers (1)

Alexey Mezenin
Alexey Mezenin

Reputation: 163768

You should also register your service provider in the providers field of config/app.php. Also, run composer dumpauto command.

Upvotes: 2

Related Questions