protected static function handleGlobalScope($type)
    {
        if (Eye::laravelVersionIs('>=', '5.2.0')) {
            static::addGlobalScope('type', function (Builder $builder) use ($type) {
                $builder->where('type', $type);
            });
        } else {
            static::addGlobalScope(new TypeLegacy($type));
        }

    }
protected static function handleGlobalScope($type)
    {
        if (Eye::laravelVersionIs('>=', '5.2.0')) {
            static::addGlobalScope('type', function (Builder $builder) use ($type) {
                $builder->where('type', $type);
            });
        } else {
            static::addGlobalScope(new TypeLegacy($type));
        }

    }
protected static function handleGlobalScope ( $ type ) { if ( Eye :: laravelVersionIs ( '>=' , '5.2.0' ) ) { static :: addGlobalScope ( 'type' , function ( Builder $ builder ) use ( $ type ) { $ builder -> where ( 'type' , $ type ) ; } ) ; } else { static :: addGlobalScope ( new TypeLegacy ( $ type ) ) ; } }
Add a global scope to the model. But we have to handle the different
scenario, as Laravel 5.1 has a different way compared to all other
versions.

@param  string  $type
@return void
Add a global scope to the model . But we have to handle the different scenario as Laravel 5 . 1 has a different way compared to all other versions .