Sara Barrera Riano
Sara Barrera Riano

Reputation: 205

Laravel Weblee\Mandrill\MandrillServiceProvider' class not found

I am trying to "merge" Mandrill in Laravel. I always get the same error on my page. Class 'Weblee\Mandrill\MandrillServiceProvider' not found. The weird thing is that I did name the class in my config.app.

Steps that I did.

  1. Mandrill template and stuff around
  2. Complete .env file with the data it needs.
  3. Included "weblee/mandrill": "dev-master" en my composer.json after laravel/framework
  4. 2 folders in vendor, weblee and Mandrill.
  5. added provider and alias
  6. composer update composer dump-autoload/ composer install ==> returning error Script php artisan clear-compiled handling the pre-update-cmd event returned with an error

[RuntimeException] Error Output: PHP Fatal error: Class Weblee\Mandrill\MandrillServiceProvider' not found in /var/www/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146

This is my config/app.php

'providers' => [
 Weblee\Mandrill\MandrillServiceProvider::class,
 ],

'aliases' => [
     *Other aliases*
     'MandrillMail' => 'Weblee\Mandrill\MandrillFacade',
],

cmposer.json

"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "weblee/mandrill": "dev-master"
},
rest of code

Upvotes: 0

Views: 708

Answers (1)

Amit Kumar
Amit Kumar

Reputation: 259

Here is the way to do this

First, install weblee package using composer.json file.

Add this in your composer.json file

"require": {

    "php": "^7.1.3",

    "laravel/framework": "5.8.*",

    "laravel/tinker": "^1.0",

    "weblee/mandrill": "dev-master"

},

And after that run composer update

then add your Weblee\Mandrill\MandrillServiceProvider::class, in config\app.php

One more thing

'aliases' => [
     *Other aliases*
     'MandrillMail' => Weblee\Mandrill\MandrillFacade::class,
],

Don't use single quotes

Upvotes: 3

Related Questions