Skip to content

Instantly share code, notes, and snippets.

@YuraSk
YuraSk / gist:aac388963e333ec017ea16fda215d0d5
Created October 30, 2017 10:40
group by with count laravel
return $this->count() // return 2258
return $this->groupBy('tid')->count() // return 9
return $this->groupBy('tid')->select('tid', DB::raw('COUNT(tid) as total'))->get(); // also bad result, return many raws of array
@YuraSk
YuraSk / toor
Last active July 17, 2017 20:42 — forked from anonymous/toor
<?php
$link = '';
if(isset($_GET['id']) && isset($_GET['za'])) {
$id = htmlentities($_GET['id']);
$za = htmlentities($_GET['za']);
$link = "<a href='https://minotar.net/skin/$za.png' download='$za.png'>Download</a>";
}
?>
<!doctype html>