Skip to content

Instantly share code, notes, and snippets.

View saqueib's full-sized avatar

Mohd Saqueib Ansari saqueib

View GitHub Profile
saqueib / RunwayViewServiceProvider.php
Last active June 14, 2024 01:38
Add Widget Support on Statamic Runway index pages
namespace App\Providers;
use Illuminate\Support\Facades\View as ViewFacade;
use Illuminate\Support\ServiceProvider;
use Illuminate\View\View;
use Statamic\Widgets\Loader;
class RunwayViewServiceProvider extends ServiceProvider
namespace App\Services;
use App\Services\Contracts\CRM as CRMContract;
class CRM implements CRMContract
public function sendEmail(array $contactIds, $emailEntry) : array
saqueib / errorHandler.js
Last active June 9, 2022 06:42
Global error handling using axios interceptor for http calls
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
saqueib / states-ui.scss
Last active May 9, 2018 02:34
is-loading and ui-disabled state classes
// Colors
$defaultSpinnerColor: #dbdbdb;
$primarySpinnerColor: #f0704b;
$lightSpinnerColor: #f3f3f3;
$darkSpinnerColor: #060303;
// Misc
$spinnerDefaultSize: 1rem;
$disabledUiOpacity: 0.7;
saqueib / SimplePagination.vue
Last active December 23, 2020 03:52
VueJS pagination component to paginate anything in Laravel, checkout the tutorial on by
<div :class="{'loading': loading}" class="pager-data-wrapper">
<!-- Pagination Slot -->
<slot :result="getResult()">
<div class="text-center alert-info pb-3">
<span v-if="!loading">
{{ result.length }} items found. render it using v-for="item in result"
<span v-if="loading">
saqueib / 0_uploader.blade.php
Last active June 9, 2021 15:57
Reusable upload component in Laravel with Dropzone.js - visit for tutorial
@php $dropzoneId = isset($dz_id) ? $dz_id : str_random(8); @endphp
<div id="{{$dropzoneId}}" class="dropzone">
<div class="dz-default dz-message">
<h3>{{ $title or 'Drop files here or click to upload.'}}</h3>
<p class="text-muted">{{ $desc or 'Any related files you can upload' }} <br>
<small>One file can be max {{ config('attachment.max_size', 0) / 1000 }} MB</small></p>
<!-- Dropzone {{ $dropzoneId }} -->