Skip to content

Instantly share code, notes, and snippets.

View jason-guru's full-sized avatar
🎯
Focusing

Jason Sharma Gurumayum jason-guru

🎯
Focusing
View GitHub Profile
<?php
namespace App\Models\Traits;
trait UsesUuid
{
protected static function bootUsesUuid() {
static::creating(function ($model) {
if (! $model->getKey()) {
$model->{$model->getKeyName()} = (string) \Str::uuid();
import { shallowMount, createLocalVue, mount } from '@vue/test-utils';
import DateFilter from '@/frontend/components/reusable/DateFilterComponent.vue';
import ElementUI from 'element-ui';
const localVue = createLocalVue();
localVue.use(ElementUI);
describe('DateFilter', () => {
let wrapper;
let wrapperMounted;
let factory;
<?php
namespace Tests\Unit;
use Cache;
use Tests\TestCase;
use App\Models\Property;
use App\Models\PropertyAccounting;
use Illuminate\Foundation\Testing\RefreshDatabase;
<?php
namespace App\Services\Reusable;
use Cache;
use Carbon\Carbon;
class FilterService
{
/**
<template>
<el-dropdown @command="handleCommand">
<el-button type="success" plain size="medium">
Filter by {{ type }} <i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown" v-if="items.length > 0">
<el-dropdown-item
v-for="(item, index) in items"
:key="index"
@jason-guru
jason-guru / Kernel.php
Created March 2, 2019 11:49 — forked from davidrushton/Kernel.php
Laravel 5 Database Queue - Shared Hosting
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
@jason-guru
jason-guru / image.html
Last active April 18, 2019 08:31
Photo Upload Code
The view template
<img id="photooutput" src="{{asset('images/profile-pic.png')}}" alt="Image" height=200 width=180>
<div class="upload-btn-wrapper">
<input type="file" accept="image/*" onchange="loadFile(event)" name="uploadBox" id="uploadBox">
<button class="btn1">Click to Upload Photo</button>
</div>
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />