Skip to content

Instantly share code, notes, and snippets.

View duncanmcclean's full-sized avatar

Duncan McClean duncanmcclean

View GitHub Profile
{{ collection:blog paginate="true" as="posts" }}
{{ posts scope="tag" }}
<div class="post">
<h1> <a href="{{ url }}"> {{ title }} </a> </h1>
</div>
{{ /posts }}
{{ /collection:blog }}
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
user: {
bearer: ''
}
@duncanmcclean
duncanmcclean / .gitignore
Created February 27, 2019 18:05
Gitignore for Statamic sites
.DS_Store
.env
node_modules/
bower_components/
local/cache/*
local/storage/*
local/temp/*
installer.php
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ExampleTest extends TestCase
{
/**
'testing' => [
'driver' => 'mysql',
'host' => env('TESTING_DB_HOST', 'localhost'),
'database' => env('TESTING_DB_DATABASE', 'app_testing'),
'username' => env('TESTING_DB_USERNAME', 'homestead'),
'password' => env('TESTING_DB_PASSWORD', 'secret'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
TESTING_DB_HOST=
TESTING_DB_DATABASE=
TESTING_DB_USERNAME=
TESTING_DB_PASSWORD=
<php>
<env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="MAIL_DRIVER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="DB_CONNECTION" value="testing"/>
</php>
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class LoginTest extends TestCase
{
<?php
use Illuminate\Support\Str;
use Faker\Generator as Faker;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
$response = $this->post('/login', [
'email' => $user->email,
'password' => 'secret'
]);
$response->assertStatus(302)
->assertRedirect('/articles');