{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/9586","labels_url":"https://api.github.com/repos/laravel/framework/issues/9586/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/9586/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/9586/events","html_url":"https://github.com/laravel/framework/issues/9586","id":94358403,"number":9586,"title":"Console Commands called from code with array argument/option cause error","user":{"login":"CupOfTea696","id":7327050,"avatar_url":"https://avatars.githubusercontent.com/u/7327050?v=3","gravatar_id":"","url":"https://api.github.com/users/CupOfTea696","html_url":"https://github.com/CupOfTea696","followers_url":"https://api.github.com/users/CupOfTea696/followers","following_url":"https://api.github.com/users/CupOfTea696/following{/other_user}","gists_url":"https://api.github.com/users/CupOfTea696/gists{/gist_id}","starred_url":"https://api.github.com/users/CupOfTea696/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CupOfTea696/subscriptions","organizations_url":"https://api.github.com/users/CupOfTea696/orgs","repos_url":"https://api.github.com/users/CupOfTea696/repos","events_url":"https://api.github.com/users/CupOfTea696/events{/privacy}","received_events_url":"https://api.github.com/users/CupOfTea696/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-10T17:54:38Z","updated_at":"2015-07-20T16:06:10Z","closed_at":"2015-07-14T10:24:32Z","body":"Hi,\r\n\r\nI just noticed that Console Commands with arguments or options that need an Array as input cause an error when you give a string as argument. I think the option --tag on the VendorPublishCommand used to be a string so that's how I noticed this. \r\n\r\nHowever, I would expect that somewhere along the line arguments or options that require an array would cast strings to arrays, or at least validate the input and show an error accordingly. This currently does not happen, and just passes the argument/option as a string to the command, which, in case of the VendorPublishCommand, causes a string to be used in the foreach loop rather than an Array.\r\n\r\nIt took me a while to figure out why this error was happening so I thought I'd point it out (the command below used to work in 5.0).\r\n\r\nMy code:\r\n```php\r\n$this->call('vendor:publish', ['--provider' => TwoStreamServiceProvider::class, '--tag' => 'required']);\r\n```\r\n\r\nLog:\r\n```log\r\n[2015-07-10 18:23:44] local.ERROR: exception 'ErrorException' with message 'Invalid argument supplied for foreach()' in /home/vagrant/projects/Stribe/vendor/laravel/framework/src/Illuminate/Foundation/Console/VendorPublishCommand.php:61\r\n```"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/122928841","html_url":"https://github.com/laravel/framework/issues/9586#issuecomment-122928841","issue_url":"https://api.github.com/repos/laravel/framework/issues/9586","id":122928841,"user":{"login":"CupOfTea696","id":7327050,"avatar_url":"https://avatars.githubusercontent.com/u/7327050?v=3","gravatar_id":"","url":"https://api.github.com/users/CupOfTea696","html_url":"https://github.com/CupOfTea696","followers_url":"https://api.github.com/users/CupOfTea696/followers","following_url":"https://api.github.com/users/CupOfTea696/following{/other_user}","gists_url":"https://api.github.com/users/CupOfTea696/gists{/gist_id}","starred_url":"https://api.github.com/users/CupOfTea696/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CupOfTea696/subscriptions","organizations_url":"https://api.github.com/users/CupOfTea696/orgs","repos_url":"https://api.github.com/users/CupOfTea696/repos","events_url":"https://api.github.com/users/CupOfTea696/events{/privacy}","received_events_url":"https://api.github.com/users/CupOfTea696/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T16:06:10Z","updated_at":"2015-07-20T16:06:10Z","body":"Not that I can see, unless it's not on the 5.1 branch?"}}