Skip to content

Instantly share code, notes, and snippets.

View viralsolani's full-sized avatar
🎯
Focusing

Viral Solani viralsolani

🎯
Focusing
View GitHub Profile
@viralsolani
viralsolani / .js
Created March 22, 2018 11:03
Example of Vanila Js and IIFEs
(function(window)
{
FTXCommon.ProductAttribute = {
selectors: {
accountSelect: document.querySelector('[name="account_id"]'),
attributeSetSelect: document.querySelector('.attributeSetSelect')
},
/**
* Initialize
@viralsolani
viralsolani / user.php
Created March 11, 2018 19:13
How to set custom payload/Claims on Laravel JWT?
<?php
namespace App\Models\Access\User;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Tymon\JWTAuth\Contracts\JWTSubject;
/**
* Class User.
*/
@viralsolani
viralsolani / phpunit.xml
Created May 9, 2017 12:16
phpunit.xml Laravel 5.4 with sqlite memory database
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
@viralsolani
viralsolani / 2.TestCase.php
Last active May 9, 2017 12:24
Test Case Model Factory Utility Function with Signin Example
<?php
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
protected function setUp()
{
parent::setUp();
$this->disableExceptionHandling();
@viralsolani
viralsolani / 1.TestCase.php
Last active May 9, 2017 12:17
Laravel - TestCase.php
<?php
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
protected function setUp()
{
parent::setUp();
$this->disableExceptionHandling();