Skip to content

Instantly share code, notes, and snippets.

Avatar

Philipp Mochine pmochine

View GitHub Profile
@saqueib
saqueib / errorHandler.js
Last active Jun 9, 2022
Global error handling using axios interceptor for http calls http://www.qcode.in/api-error-handling-in-vue-with-axios
View errorHandler.js
import axios from 'axios'
import toast from './toast'
function errorResponseHandler(error) {
// check for errorHandle config
if( error.config.hasOwnProperty('errorHandle') && error.config.errorHandle === false ) {
return Promise.reject(error);
}
// if has response show the error
@TheNodi
TheNodi / HashidsRoutable.php
Last active May 8, 2022
Laravel Model Bindings with Hashids
View HashidsRoutable.php
<?php
namespace App;
use Vinkla\Hashids\HashidsManager;
/**
* Bind a model to a route based on the hash of
* its id (or other specified key).
*
@cabloo
cabloo / DebouncedJob.php
Last active May 21, 2022
Debounced Laravel Jobs
View DebouncedJob.php
<?php
namespace App\Support\Jobs;
use Illuminate\Contracts\Queue\ShouldQueue;
class DebouncedJob implements ShouldQueue
{
use \Illuminate\Foundation\Bus\DispatchesJobs;
use \App\Support\Cache\PrefixedCache;