Skip to content
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

Consider refactoring createProfile() function in IsProfilable trait #107

Open
cbj4074 opened this issue Sep 27, 2018 · 0 comments
Open

Consider refactoring createProfile() function in IsProfilable trait #107

cbj4074 opened this issue Sep 27, 2018 · 0 comments
Labels
good first issue Good for newcomers todo

Comments

@cbj4074
Copy link
Member

cbj4074 commented Sep 27, 2018

Per a discussion on Discord, 2018-09-27 11:47AM EST, @poppabear8883 noted the following observations:

the more i look at that method the more i want to move that logic into the IsProfilable
so that it looks more like:
$this->createProfile($model, $data);

and

public function createProfile($model, array $data) 
{
        $this->profilable()->create([
            'moniker' => $data['moniker'],
            'city' => $data['city'] ?? null,
           ...
        ]);
}

i much rather have those null coalesce ops once and not on every repository that uses the IsProfilable trait
and i am wondering if we can have a more fluent api with the repositories create method

We should investigate further and make the appropriate changes if necessary.

@cbj4074 cbj4074 added the todo label Sep 27, 2018
@cbj4074 cbj4074 added the good first issue Good for newcomers label Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers todo
Projects
None yet
Development

No branches or pull requests

1 participant