Skip to content

Instantly share code, notes, and snippets.

Gustavo Straube straube

Block or report user

Report or block straube

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
straube / report.php
Last active May 6, 2019
Helping one on a FB group...
View report.php
* Escreva toda a sua lógica antes de enviar qualquer coisa para saída do script
* (output). Se não você pode receber erros como o clássico:
* "Cannot modify header information - headers already sent"
* Então deixe para colocar o que você tiver de HTML, etc para depois.
straube / pagination.php
Last active Oct 12, 2016
Laravel 5 pagination with grouping functions
View pagination.php
// Build your query as usual, but don't use the paginate() method at the chain
// end.
$query = User::select([ 'users.*', DB::raw('count( as roles_count') ])
->join('user_roles', '', '=', 'roles.user_id')
->having('roles_count', '>', 0);
// Due a bug in Eloquent, we need to build the paginator manually.
// For more details refer to:
You can’t perform that action at this time.