Skip to content

Providing a default alias generator? #3

@mabdullahsari

Description

@mabdullahsari

Hello, it's me again 🙃

I'd like to have your take on the fact that perhaps it'd be nice if the package provided a trait which generates sensible defaults for the majority of the use cases? Something along the lines of:

trait AliasesMorphType
{
    public function getMorphClass(): string
    {
        return (string) Str::of(class_basename(static::class))
            ->snake()
            ->lower();
    }
}

This is what I have been doing the whole time and the example in the README fits this. I'd totally understand though if you'd not like to merge such code, that's why I'm creating an issue before submitting a PR.

Thanks again for all of your packages, much appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions