Latheesan
Latheesan

Reputation: 24116

Laravel BadMethodCallException Call to undefined method [package] when running composer update

I am trying to use this package https://github.com/laracasts/Validation in my Laravel 4.2 project.

This is my composer.json file entry:

"require": {
    ...
    "laracasts/validation": "~1.0"
},

Now when I run the composer update command, I get the following error at the end:

{  
  "error":{  
    "type":"BadMethodCallException",
    "message":"Call to undefined method [package]",
    "file":"C:\\wamp\\www\\project-name\\vendor\\illuminate\\support\\ServiceProvider.php",
    "line":111
  }
}{  
  "error":{  
    "type":"BadMethodCallException",
    "message":"Call to undefined method [package]",
    "file":"C:\\wamp\\www\\project-name\\vendor\\illuminate\\support\\ServiceProvider.php",
    "line":111
  }
}

This is the full output:

C:\wamp\www\project-name>composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
{"error":{"type":"BadMethodCallException","message":"Call to undefined method [package]","file":"C:\\wamp\\www\\project-name\\vendor\\illuminate\\support\\ServiceProvider.php","line":111}}{"error":{"type":"BadMethodCallException","message":"Call to undefined method [package]","file":"C:\\wamp\\www\\project-name\\vendor\\illuminate\\support\\ServiceProvider.php","line":111}}
C:\wamp\www\project-name>

Any idea what this is about and how to fix it?

Upvotes: 1

Views: 4043

Answers (2)

Joseph Silber
Joseph Silber

Reputation: 220136

Are you sure you're using Laravel 4.2 and not Laravel 5?

Laravel 5 is not even in alpha yet, so things can break at any moment.

Currently, laravel 5 packages are completely broken.

Upvotes: 0

lukasgeiter
lukasgeiter

Reputation: 153150

Make sure you use the latest version of composer. Use the self-update command to update composer itself to its newest version.

composer self-update

Upvotes: 2

Related Questions