Skip to content

Instantly share code, notes, and snippets.

View danken00's full-sized avatar

Dan Kennedy danken00

View GitHub Profile
@danken00
danken00 / clean-up-git.sh
Created August 3, 2017 06:46
Cleaning up local Git repositories
// Check there's nothing that hasn't been committed and synced
git status;
// Push to the remote to make sure it has a record of any local commits/branches
git push;
// Now, prune your local repos
git remote prune origin;
// And clean up any tracked branches not in the list of remotes (https://stackoverflow.com/questions/13064613/how-to-prune-local-tracking-branches-that-do-not-exist-on-remote-anymore)
@danken00
danken00 / model.php
Last active March 2, 2023 11:46
Laravel 5 model casting function
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
use Illuminate\Database\Eloquent\Model as IlluminateModel;
use Illuminate\Pagination\AbstractPaginator;
class Model extends IlluminateModel
{