This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Billing; | |
class FakePaymentGateway implements PaymentGateway | |
{ | |
const TEST_CARD_NUMBER = '4242424242424242'; | |
private $charges; | |
private $tokens; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use GuzzleHttp\Client; | |
class FastSpring { | |
function __construct() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setup some developer accounts to test with | |
$developers = [ | |
['name' => 'Tony Richards', 'email' => '[email protected]', 'password' => 'secret'], | |
['name' => 'Brad Madigan', 'email' => '[email protected]', 'password' => 'secret'] | |
]; | |
collect($developers)->each(function($dev) { | |
factory(\App\Models\User::class)->create([ | |
'name' => $dev['name'], | |
'email' => $dev['email'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class RememberQueryStrings | |
{ | |
public function handle($request, Closure $next) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Eloquent\Builder as EloquentBuilder; | |
use Illuminate\Database\Query\Builder as QueryBuilder; | |
use Illuminate\Database\Query\Expression; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
public function boot() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Feature; | |
use Tests\TestCase; | |
use Tests\withTestingEnvironment; | |
use Zttp\Zttp; | |
class WebhooksTest extends TestCase | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function destroy(Request $request, $id = null) | |
{ | |
abort_unless($this->authUser->hasPermissionTo('manage assets'), 403); | |
$requestData = $id ? | |
[$request->all() + ['id' => $id]] : | |
json_decode($request->getContent(), true); | |
$assets = Asset::findOrFail(collect($requestData)->pluck('id')->toArray()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Aws\S3\S3Client; | |
use ZipStream\ZipStream; // https://github.com/maennchen/ZipStream-PHP | |
protected function streamPhotosetAsZip($files) | |
{ | |
$s3 = S3Client::factory('...'); | |
$zip = new ZipStream("foobar.zip"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//$wsdl_url = 'https://www.steelroads.com/wsdl/com/steelroads/ws/model/TatService.wsdl'; | |
$wsdl_url = 'https://www.steelroads.com/services/TatService'; | |
$username = 'username1'; | |
$password = 'secret'; | |
$client = new SoapClient($wsdl_url, array("soap_version" => SOAP_1_1,"trace" => 1)); | |
$user_param = array ( | |
'WebProviderLoginId' => $username, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tr v-for="shipment in gridData" id="tr-field-{{ shipment.id }}"> | |
<td style="display:none;"> | |
<input type="hidden" v-model="shipForm[$index].id" value="{{ shipment.id }}"> | |
</td> | |
<td> | |
<input | |
@keyup.enter="saveField(shipForm[$index])" | |
@keyup.tab="saveField(shipForm[$index])" | |
type="text" | |
v-model="shipForm[$index].shipment_number" |