Skip to content

Instantly share code, notes, and snippets.

View yajra's full-sized avatar

Arjay Angeles yajra

View GitHub Profile
@yajra
yajra / console.php
Created April 22, 2022 02:12
Disable Laravel migrate:fresh command
Artisan::command('migrate:fresh', function () {
/** @var \Illuminate\Console\Command $cmd */
$cmd = $this;
$cmd->ask("Are you sure you want to resign?", "Yes");
$cmd->comment(
<<<'TXT'
.~))>>

How to install OCI8 on macOS 10.15 (Catalina) with PHP 7.3 or 7.4

Requirements

  • Homebrew
  • Command Line Tools for Xcode
  • PHP 7.3 or 7.4 via Homebrew

Preparation

@yajra
yajra / install_oci8_ubuntu20_php7.4.md
Created November 24, 2021 01:04 — forked from eSkiSo/install_oci8_ubuntu20_php7.4.md
Install OCI8 (Oracle) in Ubuntu 20 with PHP 7.4
@yajra
yajra / JSTreeField.php
Created June 22, 2021 10:56
DataTables Editor jsTree field type example.
<?php
namespace App\Editor\Fields;
use Yajra\DataTables\Html\Editor\Fields\Field;
class JSTreeField extends Field
{
protected $type = 'jsTree';
}
<?php
namespace Yajra\DataTables\Processors;
use Illuminate\Support\Arr;
use Yajra\DataTables\Utilities\Helper;
class DataProcessor
{
/**
@yajra
yajra / DataTable.vue
Last active July 25, 2023 11:06
VueJS DataTables Snippets with Delete Button Component
<template>
<table>
<thead>
<tr>
<th v-for="column in parameters.columns" v-html="title(column)"></th>
</tr>
</thead>
<tfoot v-if="footer">
<tr>
<th v-for="column in parameters.columns" v-html="column.footer"></th>
@yajra
yajra / .env
Last active July 5, 2023 19:51
Laravel DataTables Editor Snippets
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:2JTqUn+p24WXtpVdoIyoK3cIaMOMpeuKvE7vEIlShlg=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=sqlite
BROADCAST_DRIVER=log
@yajra
yajra / git-deployment.md
Created August 24, 2017 04:11 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

@yajra
yajra / install-wkhtmltopdf.sh
Last active March 7, 2024 00:17
Install wkhtmltopdf 0.12.4 (with patched qt)
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin/
ln -nfs /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
@yajra
yajra / axios-401-response-interceptor.js
Last active September 20, 2023 06:24
Axios 401 response interceptor.
// Add a 401 response interceptor
window.axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
if (401 === error.response.status) {
swal({
title: "Session Expired",
text: "Your session has expired. Would you like to be redirected to the login page?",
type: "warning",
showCancelButton: true,