Put SearchTrait.php
in app
directory. Then use SearchTrait
in your model, like so
use App\SearchTrait;
use Illuminate\Database\Eloquent\Model;
class Article extends Model
{
<?php namespace App; | |
use App\Carbon\LocalizedDiffForHumansTrait; | |
use Illuminate\Database\Eloquent\Model; | |
// example model | |
class Article extends Model | |
{ | |
use LocalizedDiffForHumansTrait; |
# sudo su and run the following | |
sudo apt-get update && \ | |
sudo apt-get -y upgrade && \ | |
# install all dependencies | |
sudo apt-get -y install \ | |
build-essential \ | |
checkinstall \ | |
gcc \ |
{ | |
"require": { | |
"php": ">=5.3.0", | |
"composer/installers": "v1.0.12", | |
"webdevstudios/cmb2": "dev-master", | |
}, | |
"autoload": { | |
"files": ["vendor/cmb2/init.php"] | |
}, | |
"extra": { |
namespace Acme\V1\Billing; | |
// BillableInterface.php | |
use Laravel\Cashier\BillableInterface as CashierInterface; | |
interface BillableInterface extends CashierInterface { | |
} |
php -a -d auto_prepend_file=./vendor/autoload.php |
#!/bin/bash | |
echo "********************" | |
echo "Post receive hook: Updating website" | |
echo "********************" | |
#set the git repo dir | |
GIT_REPO_DIR=~/git/<repo>.git | |
echo "The git repo dir is $GIT_REPO_DIR" |
<?php | |
// remove_accents: https://codex.wordpress.org/Function_Reference/remove_accents | |
add_filter('sanitize_file_name', 'sa_sanitize_spanish_chars', 10); | |
function sa_sanitize_spanish_chars ($filename) { | |
return remove_accents( $filename ); | |
} |
#!/bin/bash | |
target_branch="production" | |
working_tree="PATH_TO_DEPLOY" | |
while read oldrev newrev refname | |
do | |
branch=$(git rev-parse --symbolic --abbrev-ref $refname) | |
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then | |
Other people's projects:
My projects (tutorials are on my blog at http://maxoffsky.com):