Skip to content

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

Open
YosefOberlander wants to merge 1 commit intolaracasts:masterfrom
YosefOberlander:master
Open

fixed issue with array_map() expects parameter 1 to be a valid callback, class 'Str' not found in getSortedSingularTableNames#196
YosefOberlander wants to merge 1 commit intolaracasts:masterfrom
YosefOberlander:master

Conversation

@YosefOberlander
Copy link
Copy Markdown

@YosefOberlander YosefOberlander commented Jun 13, 2021

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

fixed `ErrorException : array_map() expects parameter 1 to be a valid callback, class 'Str' not found` in function getSortedSingularTableNames
@pelmered
Copy link
Copy Markdown

pelmered commented Jul 6, 2021

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.

@simplenotezy
Copy link
Copy Markdown

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

@simplenotezy
Copy link
Copy Markdown

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"
    }
],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants