Back

Lumen Illuminate\Support\Collection absence of methods


There's illuminate/support: 5.5.* package listed in the dependencies of Lumen micro framework, which should contain all the helpfull methods for working with Laravel collections. However when I run composer install there's no most of methods for working with collections, for instance firstWhere. My composer.json file contents are:

{
  "name": "laravel/lumen",
  "description": "The Laravel Lumen Framework.",
  "keywords": ["framework", "laravel", "lumen"],
  "license": "MIT",
  "type": "project",
  "require": {
    "php": ">=5.6.4",
    "laravel/lumen-framework": "5.5.*",
    "vlucas/phpdotenv": "~2.2",
    "maatwebsite/excel": "~2.1.0",
    "league/flysystem": "^1.0"
  },
  "require-dev": {
    "fzaninotto/faker": "~1.4",
    "phpunit/phpunit": "~6.0",
    "mockery/mockery": "~0.9"
  },
  "autoload": {
    "psr-4": {
      "App\\": "app/"
    }
  },
  "autoload-dev": {
    "classmap": ["tests/", "database/"]
  },
  "scripts": {
    "post-root-package-install": ["php -r \"copy('.env.example', '.env');\""]
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "optimize-autoloader": true
}
Alex replied 1 year ago

It does not seem like Illuminate/Support/Collection::firstWhere() exists in 5.5.* package. https://laravel.com/api/5.5/Illuminate/Support/Collection.html

However Laravel documentation does list this method: https://laravel.com/docs/5.5/collections#method-first-where

Maybe this method did not make it into 5.5 version

Also you may inspect vendor/illuminate/support/Collection.php for available methods

.


Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us