Skip to content
Discussion options

You must be logged in to vote

My attemp in last night:

protected $nameableClasses = [
    Model1::class,
    Model2::class,
    Model3::class,
];

public function boot()
{
    foreach ($this->nameableClasses as $class) {
        Blade::stringable($class, function ($object) {
            return $object->getName();
        }
    }
}

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@kaozaza2
Comment options

@i-bajrai
Comment options

Comment options

You must be logged in to vote
1 reply
@i-bajrai
Comment options

Answer selected by kaozaza2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants