Skip to content

Instantly share code, notes, and snippets.


Nate Ritter nateritter

View GitHub Profile
alexmac05 / gist:efef7a557fcc7ccc89bd17b5ac3cb1a9
Created Apr 19, 2018
HelloSign - Overriding the app white labelling settings when doing the embedded iframe loading in JavaScript
View gist:efef7a557fcc7ccc89bd17b5ac3cb1a9
HelloSign.init("<?php echo $client_id ?>");{
url: "<?php echo $sign_url ?>",
allowCancel: true,
skipDomainVerification: true,
thijskok / config.yml
Last active May 28, 2021
CircleCI 2.0 Laravel build configuration with PHP 7.1, NodeJS, and MySQL support. Runs both PHPunit as well as Laravel Dusk. Proper GD configuration for image editing purposes. Several linters included (requires including them in composer / package.json).
View config.yml
version: 2
working_directory: ~/user/repo
BASH_ENV: ~/.bashrc
paulund / phpcs.xml
Created Aug 20, 2017
PHP PSR-2 CodeSniffer Config for Laravel
View phpcs.xml
<?xml version="1.0"?>
<ruleset name="Laravel Standards">
The name attribute of the ruleset tag is displayed
when running PHP_CodeSniffer with the -v command line
argument. The description tag below is not displayed anywhere
except in this file, so it can contain information for
developers who may change this file in the future.

UsedByTeams Model Trait For Laravel Spark

Automatically limit your models to the current team

So you're using spark, and you have teams enabled. You start creating models and want to have them be team specific. Instead of writing, Model::where('team_id', auth()->user()->currentTeam->id)->get(); use this trait to add that behind the scenes so that every time you call on your model, it's assumed that you mean for the current team.

This assumes that the model has a team_id, while it adds a scope of where team_id = currentTeam->id.

Note: Implicit Route Model Binding in 5.2, auth session doesn't exist at the point of this trait causing issue. fixed in 5.3

dillinghamio /
Last active May 17, 2020
Team Role Middleware For Laravel Spark

Team Role Middleware For Laravel Spark

Makes it simple to use Spark's role feature on routes

Route::group(['middleware'=>'role:owner'], function(){
    // owners only

Route::group(['middleware'=>'role:member'], function(){
adamwathan / belongs-to-many.sublime-snippet
Last active Oct 19, 2020
Eloquent Relationship snippets for Sublime Text
View belongs-to-many.sublime-snippet
public function ${1:relationship}()
return \$this->belongsToMany(${1/^(.+)$/(?1\u$1:)/g}::class, {$2:table});
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
soufianeEL / laravel.js
Last active Oct 30, 2021 — forked from JeffreyWay/laravel.js
You use Laravel 5 and you want to send a DELETE request without creating a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. To use, import script, and create a link with the `data-method="DELETE"` and `data-token="{{csrf_token()}}"` attributes.
View laravel.js
Exemples :
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}">
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}" data-confirm="Are you sure?">
(function() {
njh /
Last active Mar 21, 2021
Install/update rbenv
# Download rbenv
if [ ! -d ~/.rbenv ]; then
git clone ~/.rbenv
cd ~/.rbenv
git reset --hard
git pull origin master
brandonferens / loadRelativeAssets.php
Created Aug 20, 2014
Load relative javascript assets based on route in Laravel
View loadRelativeAssets.php
function loadRelativeAssets()
$routeArray = explode('.', Route::currentRouteName());
// We take the current route, create an array form it, run it
// through the while statement checking to see if that file exists.
// If it does, we load it. Then we remove that last element
// from the array, and do it all again, until the array is empty
while (!empty($routeArray)) {
// Create the path to the js file