Laravel-5-Generators-Extended icon indicating copy to clipboard operation
Laravel-5-Generators-Extended copied to clipboard

fixed issue with array_map() expects parameter 1 to be a valid callback, class 'Str' not found in getSortedSingularTableNames

Open YosefOberlander opened this issue 3 years ago • 3 comments

fixed ErrorException : array_map() expects parameter 1 to be a valid callback, class 'Str' not found in PivotMigrationMakeCommand.php located at function getSortedSingularTableNames on line 171

YosefOberlander avatar Jun 13 '21 20:06 YosefOberlander

I solved this with an arrow function instead:

        $tables = array_map(fn($table) => Str::singular($table), $this->getTableNamesFromInput());

But I don't know which is the best solution.

pelmered avatar Jul 06 '21 23:07 pelmered

I face the same error, would be great to get pulled in 😊

simplenotezy avatar Aug 30 '21 14:08 simplenotezy

If you're impatient like me, add this to your composer.json and run composer update then you should be able to receive the fork from @YosefOberlander:

"require-dev": {
	"laracasts/generators": "dev-master", // change this to dev-master
},
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/YosefOberlander/Laravel-5-Generators-Extended"
    }
],

simplenotezy avatar Aug 30 '21 14:08 simplenotezy