Skip to content

Instantly share code, notes, and snippets.

Avatar

Brad Estey BradEstey

View GitHub Profile
@BradEstey
BradEstey / Manager.php
Last active Feb 11, 2021
Use the Illuminate Validation Class outside of Laravel (With optional Translation and Database connection instances)
View Manager.php
<?php
namespace Acme\Validation\Capsule;
use Illuminate\Container\Container;
use Illuminate\Database\ConnectionResolver;
use Illuminate\Database\ConnectionResolverInterface;
use Illuminate\Database\Connectors\ConnectionFactory;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Translation\FileLoader;
@BradEstey
BradEstey / gulpfile.js
Last active May 24, 2016
Gulp Task to run PHPUnit from a Vagrant VM
View gulpfile.js
var gulp = require('gulp'),
sys = require('sys'),
ssh2 = require('ssh2');
gulp.task('phpunit', function() {
var ssh = new ssh2();
ssh.on('ready', function () {
ssh.exec('cd /vagrant; phpunit', {}, function (err, stream) {
@BradEstey
BradEstey / gulpfile.js
Last active Dec 21, 2018
Use Gulp to automatically run PHPUnit tests.
View gulpfile.js
var gulp = require('gulp'),
sys = require('sys'),
exec = require('child_process').exec;
gulp.task('phpunit', function() {
exec('phpunit', function(error, stdout) {
sys.puts(stdout);
});
});