This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Example usage in a model: | |
class ExampleModel extends Model | |
{ | |
use HasUuid; | |
protected $primaryKey = 'uuid'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The tutorial Getting URL Parameters with Javascript explained how you can get url parameters with the URL and URLSearchParams objects. This tutorial explains how you can change a url - edit a parameter, add a new parameter or delete one. | |
Editing a Parameter | |
The set method of the URLSearchParams object sets the new value of the parameter. | |
After setting the new value you can get the new query string with the toString() method. This query string can be set as the new value of the search property of the URL object. | |
The final new url can then be retrieved with the toString() method of the URL object. | |
var url = new URL('http://demourl.com/path?id=100&topic=main'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function boot() { | |
Passport::routes(function ($router){ | |
$router->forAccessTokens(); | |
}); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
export PATH="$PATH:$HOME/.config/composer/vendor/bin" | |
# Path to your oh-my-zsh installation. | |
export ZSH="$HOME/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Http\Middleware; | |
// First copy this file into your middleware directoy | |
use Closure; | |
class CheckRole{ | |
/** | |
* Handle an incoming request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# PhalconPhp with PHP7 installation on ubuntu:16.04 | |
sudo apt-get update | |
sudo apt-get install -y php7.0-fpm \ | |
php7.0-cli \ | |
php7.0-curl \ | |
php7.0-gd \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Plugin Loading | |
call plug#begin('~/.vim/plugged') | |
Plug 'itchyny/lightline.vim' "Highlights lines | |
Plug 'joshdick/onedark.vim' "The One Dark Theme | |
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } | |
Plug 'junegunn/fzf.vim' "Fuzzy find plugin | |
Plug 'junegunn/goyo.vim' "Removes Line numbers for focusing | |
Plug 'mbbill/undotree' "Creates an undo tree | |
Plug 'preservim/nerdtree' "File browser inside vim | |
Plug 'godlygeek/tabular' "Auto formatting |