Skip to content

[4.x] Allow passing of constructor arguments on make method helper. #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2021

Conversation

yajra
Copy link
Owner

@yajra yajra commented Apr 21, 2021

This PR will allow make factory helper to accept constructor arguments like how Laravel's Event::dispatch() works.

class ProjectMembersDataTableHtml extends DataTableHtml
{
    public $project;

    public function __construct(Project $project)
    {
        $this->project = $project;
    }
...

Before PR:

$members = (new ProjectMembersDataTableHtml($project))->handle();

After PR:

$members = ProjectMembersDataTableHtml::make($project);

@yajra yajra merged commit 1e17733 into 4.0 Apr 21, 2021
@yajra yajra deleted the patch-make branch April 21, 2021 05:34
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.

1 participant