appstract / laravel-opcache

Laravel Package for OPcache
MIT License
1.33k stars 118 forks source link

TypeError: Illuminate\Http\Client\PendingRequest::withHeaders() #107

Closed boopathydreams closed 4 years ago

boopathydreams commented 4 years ago

Hi,

After following all the steps I get the following error. I couldn't find details regarding this anywhere. I get the error on all artisan opcache commands.

Argument 1 passed to `Illuminate\Http\Client\PendingRequest::withHeaders()` must be of the type array, null given, called in `\vendor\laravel\framework\src\Illuminate\Http\Client\Factory`.
php on line 283

at C:\wamp64\www\cms\vendor\laravel\framework\src\Illuminate\Http\Client\PendingRequest.php:231
    227|      *
    228|      * @param  array  $headers
    229|      * @return $this
    230|      */
  > 231|     public function withHeaders(array $headers)
    232|     {
    233|         return tap($this, function ($request) use ($headers) {
    234|             return $this->options = array_merge_recursive($this->options, [
    235|                 'headers' => $headers,

  1   C:\wamp64\www\cms\vendor\laravel\framework\src\Illuminate\Http\Client\Factory.php:283
      Illuminate\Http\Client\PendingRequest::withHeaders()

  2   C:\wamp64\www\cms\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:261
      Illuminate\Http\Client\Factory::__call("withHeaders")

TIA

ovanschie commented 4 years ago

Do you have this in your config?

https://github.com/appstract/laravel-opcache/blob/master/config/opcache.php#L7

genesiscz commented 4 years ago

I fixed this with php artisan config:clear because my config was cached

boopathydreams commented 4 years ago

Do you have this in your config?

https://github.com/appstract/laravel-opcache/blob/master/config/opcache.php#L7

Yes, I do have that. I apologize for the delayed response as I continued working after disabling opcache temporarily.

Also, config:clear is the first thing anyone would do. I did that too.

Let me try today and post the update.

Thanks.

ovanschie commented 4 years ago

@boopathydreams fixed?