Skip to content

Instantly share code, notes, and snippets.

View ilterocal's full-sized avatar

ilterocal ilterocal

View GitHub Profile
@ilterocal
ilterocal / button-loading.js
Last active March 6, 2018 11:26
button-loading directive for Vue2
import Vue from "vue"
Vue.directive('button-loading', {
update: function (el, binding, vnode) {
//do nothing if value not changed
if (binding.oldValue === binding.value) {
return;
}
if (binding.value === true) {
@ilterocal
ilterocal / axios-debugbar.js
Created January 24, 2018 13:10
barryvdh/laravel-debugbar with Axios Http Client
import axios from 'axios'
axios.interceptors.response.use(response => {
if(phpdebugbar) {
phpdebugbar.ajaxHandler.handle(response.request);
}
return response;
}, error => {
return Promise.reject(error)
})
@ilterocal
ilterocal / QueryLoggingController.php
Last active March 18, 2016 08:54
Logging Laravel 5 SQL Queries in Controller.
<?php namespace App\Http\Controllers;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
class QueryLoggingController extends Controller
{
public function __construct()
{
DB::listen(