Skip to content

Instantly share code, notes, and snippets.

View Thewsomeguy's full-sized avatar

Zach Thewsomeguy

  • United States
  • 08:19 (UTC -05:00)
View GitHub Profile
@selahattinunlu
selahattinunlu / Envoy.blade.php
Last active April 3, 2018 13:00
Envoy.blade.php
@servers(['production' => 'user@ipaddress'])
@setup
$repo = 'git@github.com:selahattinunlu/projectname.com.git';
$releaseDir = '/srv/projectname.com/releases';
$storageDir = '/srv/projectname.com/storage';
$appDir = '/srv/projectname.com/current';
$release = 'release_' . date('d-m-Y-His');
@endsetup
@hassansin
hassansin / eloquent-cheatsheet.php
Last active May 23, 2024 07:51
Laravel 5 Eloquent CheatSheet #laravel #eloquent
Model::
/*Select*/
select('col1','col2')
->select(array('col1','col2'))
->select(DB::raw('businesses.*, COUNT(reviews.id) as no_of_ratings, IFNULL(sum(reviews.score),0) as rating'))
->addSelect('col3','col4')
->distinct() // distinct select
/*From*/