In Laravel 5.0 code like this is used for names-pacing/loading classes:
'providers' => [
/*
* Laravel Framework Service Providers...
*/
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
'Illuminate\Broadcasting\BroadcastServiceProvider',
'Illuminate\Bus\BusServiceProvider',
]
However, am seeing this in Laravel 5.1
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
]
My question: What is the benefit of this Illuminate\Bus\BusServiceProvider::class
over this 'Illuminate\Bus\BusServiceProvider'
, when should I append ::class
to a class name?
Is there any where I can find this in PHP documentation?