Skip to content

Instantly share code, notes, and snippets.

@dragg
dragg / Laravel homestead up site
Created August 5, 2015 18:02
Laravel homestead
server appnam.app /home/vagrant/Code/Laravel/public
@dragg
dragg / Backup
Last active June 14, 2020 06:36
Homestead Update
mysqldump -u homestead -p --all-databases > "$(date '+homestead_%F_%T')".sql
@dragg
dragg / AuthenticateController.php
Last active August 17, 2016 10:11 — forked from iolson/AuthenticateController.php
SentinelAuthAdapter for using Tymon\JWTAuth with Cartalyst\Sentinel
<?php namespace App\Http\Controllers\Api\V1;
use App\Http\Controllers\Controller;
use App\Http\Requests;
use Illuminate\Http\Request;
use Tymon\JWTAuth\Facades\JWTAuth;
use Tymon\JWTAuth\Exceptions\JWTException;
class AuthenticateController extends Controller
{
@dragg
dragg / alert-service.js
Created February 10, 2017 06:18
Alert service using inside https://github.com/jirikavi/AngularJS-Toaster and angular translation package
(function () {
'use strict';
angular
.module('app')
.service('alertService', alertService);
alertService.$inject = ['toaster', '$filter'];
/* @ngInject */
location ~* \.(eot|ttf|woff|woff2|jpg|jpeg|png)$ {
add_header Access-Control-Allow-Origin *;
}
@dragg
dragg / down method example
Created April 3, 2017 11:06
Laravel migration - changing enum field
DB::statement("ALTER TABLE $TABLE_NAME$ CHANGE $FIELD_NAME$ type ENUM($ENUM_PREVIOUS_OPTION_1$, $ENUM_PREVIOUS_OPTION_2$)");
@dragg
dragg / .env
Last active June 3, 2017 11:33 — forked from Ellrion/.tinker
Laravel tinker helper include file
PSYSH_CONFIG=tinker.config.php
server {
...
location / {
auth_basic "Restricted";
auth_basic_user_file "/home/vagrant/Projects/school/.htpasswd";
try_files $uri $uri/ /index.php?$query_string;
}
@dragg
dragg / Select2
Last active August 27, 2021 05:31
Vue Components
<template>
<select :name="name" class="form-control">
<slot></slot>
</select>
</template>
<script>
import 'select2-bootstrap-theme/dist/select2-bootstrap.css';
export default {
@dragg
dragg / using
Last active January 29, 2018 07:01
Examples
/**
* Return order field and direction
*
* @param \Illuminate\Http\Request $request
* @return array
*/
function datatable_get_order_data(\Illuminate\Http\Request $request)
{
$columnNumber = $request->get('order')[0]['column'];
$column = $request->get('columns')[$columnNumber];