Skip to content

Instantly share code, notes, and snippets.

View christopherarter's full-sized avatar
❤️
You are not an imposter. You belong, and we're lucky to have you.

Chris Arter christopherarter

❤️
You are not an imposter. You belong, and we're lucky to have you.
View GitHub Profile
public function createStripeSession(Request $request)
{
$trip = Trip::find( session('trip_id') );
\Stripe\Stripe::setApiKey( <dat secret key boi> );
$cartBooking = session('cart_booking');
if ($cartBooking->payment_type == 'deposit') {
$total = $cartBooking->getDepositCost();
} else {
$total = $cartBooking->getFullCost();
<?php
namespace Tests\Browser;
use App\Charter;
use App\Events\Bookings\NewBookingRequest;
use App\Trip;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;
@christopherarter
christopherarter / HasDraftsTrait.php
Created August 12, 2020 16:19
Has Drafts Trait
<?php
namespace App\Traits;
use Illuminate\Support\Facades\Schema;
use Error;
use Auth;
trait HasDrafts
{
/**
* Get the draft data for a model.
*
@christopherarter
christopherarter / regex-images-without-alt.md
Last active June 27, 2020 16:51
Regex to find image tags without alt tag

Regex to find image tags without alt tags

/(]*)(&gt;)/

@christopherarter
christopherarter / php-cs-fixer.php
Last active November 23, 2021 21:14
php-cs-fixer config
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
@christopherarter
christopherarter / Dockerfile
Created September 24, 2019 20:47
Laravel Docker File for existing project
FROM php:7.3-apache
RUN apt-get update -yqq && \
apt-get install -y apt-utils zip unzip && \
apt-get install -y nano && \
apt-get install -y libzip-dev libpq-dev && \
apt-get install -y libxml2-dev && \
apt-get install -y libmcrypt-dev && \
a2enmod rewrite && \
docker-php-ext-install pdo && \
docker-php-ext-install pdo_mysql && \
@christopherarter
christopherarter / MSK-LOD-route-list.md
Last active July 3, 2019 15:32
MSK LOD route list

MSK LOD Route Plan

This is the outline of how the routes will be structured.

0 General Resources

All resources will follow the following pattern using implicit actions:

Index

GET resources/

import config from '../config'
import sharp from 'sharp'
import S3 from 'aws-sdk/clients/s3'
class ImageCop {
constructor(key) {
this.key = key
this.config = config
this.sharp
this.s3 = this.initializeS3()
import firebase from 'firebase'
import moment from 'moment'
const db = firebase.firestore()
const listingIndex = 'listings'
import Factory from './factory'
export default {
factory: new Factory({
index: 'listings'
}),
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;
use App\EndPoint;
use App\Lead;
use App\ResponseRecord;