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 {| { | |
| "user": { | |
| "debug": false, | |
| "delay": 0.25, | |
| "error_color": "D02000", | |
| "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme", | |
| "gutter_theme_excludes": [], | |
| "lint_mode": "background", | |
| "linters": { | |
| "php": { |
| <VirtualHost *> | |
| DocumentRoot "C:\xampp\htdocs\yoursite.dev" | |
| ServerName yoursite.dev | |
| <Directory "C:\xampp\htdocs\yoursite.dev"> | |
| Require all granted | |
| AllowOverride All | |
| </Directory> | |
| </VirtualHost> |
| <?php | |
| $dir = __DIR__; // Directory where files are stored | |
| if ($dir_list = opendir($dir)) | |
| { | |
| while($files[] = readdir($dir_list)); | |
| sort($files); | |
| closedir($dir_list); | |
| foreach ($files as $file) |
| server { | |
| listen 80; | |
| listen 8888; | |
| server_name localhost; | |
| index index.php index.html index.htm; | |
| root /path/to/root; | |
| autoindex on; |
| @import url(google-fonts.css); | |
| /*@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic);*/ | |
| /*! | |
| * AdminLTE v2.3.0 | |
| * Author: Almsaeed Studio | |
| * Website: Almsaeed Studio <http://almsaeedstudio.com> | |
| * License: Open source - MIT | |
| * Please visit http://opensource.org/licenses/MIT for more information | |
| !*/html,body{min-height:100%}.layout-boxed html,.layout-boxed body{height:100%}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-weight:400;overflow-x:hidden;overflow-y:auto}.wrapper{min-height:100%;position:static;overflow:hidden}.wrapper:before,.wrapper:after{content:" ";display:table}.wrapper:after{clear:both}.layout-boxed .wrapper{max-width:1250px;margin:0 auto;min-height:100%;box-shadow:0 0 8px rgba(0,0,0,0.5);position:relative}.layout-boxed{background:url('../img/boxed-bg.jpg') repeat fixed}.content-wrapper,.right-side,.main-footer{- |
| <?php | |
| return array( | |
| /* | |
| |-------------------------------------------------------------------------- | |
| | Validation Language Lines | |
| |-------------------------------------------------------------------------- | |
| | | |
| | The following language lines contain the default error messages used by |
| <?php | |
| function execInBackground($cmd) { | |
| if (substr(php_uname(), 0, 7) == "Windows"){ | |
| pclose(popen("start /B ". $cmd, "r")); | |
| } | |
| else { | |
| exec($cmd . " > /dev/null &"); | |
| } | |
| } | |
| ?> |
| // convert space to undersocre (snake case) | |
| string.toLowerCase().split(' ').join('_'); | |
| // convert underscore to space | |
| string.split('_').join(' '); | |
| // camelize | |
| function camelize(str) { | |
| return str.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function(match, index) { | |
| if (+match === 0) return ""; // or if (/\s+/.test(match)) for white spaces |
| // MIT Licence (MIT) | |
| // Copyright (c) 2015 - Mokhamad Rofiudin | |
| // inspired by Facebook Textarea | |
| // Based on code here https://gist.github.com/thomseddon/4703968 | |
| // The Magic Sauce : http://stackoverflow.com/a/3238543/4711810 | |
| // How to use : <textarea auto-grow></textarea> | |
| // For jQuery visit here : https://gist.github.com/mrofi/a5c6bc25539eacf1750b | |
| app.directive('autoGrow', function() { |