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
{
######################################################################################################## | |
# This config enables us to: | |
# - Resize | |
# - Rotate | |
# ...the resident images on an upstream server, with Nginx Server in our hand, On the fly! | |
# - Just by using arbitrary Query Parameters | |
# ...and | |
# - Cache the transformed image by address. | |
# | |
# Well, I got the Idea from https://stumbles.id.au/nginx-dynamic-image-resizing-with-caching.html |
#!/usr/bin/env bash | |
# USAGE: mysqlOptimizeForImports <- before importing | |
# mysqlDefaultSettings <- to go back to normal | |
# Based on https://dba.stackexchange.com/questions/83125/mysql-any-way-to-import-a-huge-32-gb-sql-dump-faster/83385#83385 | |
mysqlStateFile="$HOME/mysql.optimized.for.exports" | |
mysqlConfigLocation="/etc/mysql/my.cnf" # <-- change to the correct for your system, should be for global mysql settings |
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |