Level 70
@rid3638 Have you tried with class_basename() ?
Ref: https://laravel.com/docs/9.x/helpers#method-class-basename
4 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a class like this
$answer = Answer::create([ ... .. ]);
I want to get the name of this class as string.
@rid3638 Have you tried with class_basename() ?
Ref: https://laravel.com/docs/9.x/helpers#method-class-basename
Please or to participate in this conversation.