Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 18, 2020. It is now read-only.

Conversation

tabuna
Copy link
Contributor

@tabuna tabuna commented Apr 16, 2020

This sentence modifies the return value for generator methods.

Before

Breadcrumbs::for('home', function ($trail) {
    $trail->parent('home');
    $trail->push('About');
});

After

Breadcrumbs::for('home', function ($trail) {
    $trail->parent('home')->push('About');
});

This small change does not affect backward compatibility. At the same time, it supports arrow functions:

Breadcrumbs::for('home', fn ($trail) =>
    $trail->parent('home')->push('About')
);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant