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

Added support arrow function #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added support arrow function #210

wants to merge 1 commit into from

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