Skip to content

Instantly share code, notes, and snippets.


Philipp Mochine pmochine

View GitHub Profile
saqueib / errorHandler.js
Last active Jun 9, 2022
Global error handling using axios interceptor for http calls
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 / HashidsRoutable.php
Last active May 8, 2022
Laravel Model Bindings with Hashids
View HashidsRoutable.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 / DebouncedJob.php
Last active May 21, 2022
Debounced Laravel Jobs
View DebouncedJob.php
namespace App\Support\Jobs;
use Illuminate\Contracts\Queue\ShouldQueue;
class DebouncedJob implements ShouldQueue
use \Illuminate\Foundation\Bus\DispatchesJobs;
use \App\Support\Cache\PrefixedCache;