porting sg2 to laravel v3