No, using ::class in a class returns the full name of the class, so this is the same as writing 'App\Console\Commands\Inspire' (in quotation marks, since this is a string). The class keyword is new to PHP 5.5.
In this example, it looks silly, but it can be useful, for example, in testing or defining relationships. For example, if I have an Article class and an ArticleComment class, I can finish the job
use Some\Long\Namespace\ArticleComment; class Article extends Model { public function comments() { return $this->hasMany(ArticleComment::class); } }
Link: PHP docs .
source share