Barryvdh\LaravelIdeHelper\Console\ModelsCommand::getCollectionClass PHP Method

getCollectionClass() private method

Determine a model classes' collection type.
See also: http://laravel.com/docs/eloquent-collections#custom-collections
private getCollectionClass ( string $className ) : string
$className string
return string
    private function getCollectionClass($className)
    {
        // Return something in the very very unlikely scenario the model doesn't
        // have a newCollection() method.
        if (!method_exists($className, 'newCollection')) {
            return '\\Illuminate\\Database\\Eloquent\\Collection';
        }
        /** @var \Illuminate\Database\Eloquent\Model $model */
        $model = new $className();
        return '\\' . get_class($model->newCollection());
    }