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
{
#!/usr/bin/env sh | |
find . -maxdepth 2 -type d -name node_modules -name bower_components -print0 | xargs -0 rm -rf |
var lang = { | |
required => "{{ trans('required') }}", | |
email => "{{ trans('email') }}", | |
}; |
<?php | |
namespace App; | |
use Gregwar\Image\Image; | |
use Symfony\Component\HttpFoundation\File\UploadedFile; | |
trait ImageTrait | |
{ | |
protected $imageWidth, $imageHeight; |
#!/usr/bin/env sh | |
alias ping8='ping 8.8.8.8' | |
alias pingg='ping google.com' | |
alias ls='ls --group-directories-first --color -F --time-style=long-iso' | |
alias lsd='ls -l | grep "^d"' | |
alias lsf='ls -l | grep "^-"' | |
alias mkdir='mkdir -p' |
<?php | |
class Calc { | |
protected $value; | |
public static function create() | |
{ | |
return new self; | |
} |
require 'mina/git' | |
# Fix the SSH password prompt problem | |
set :term_mode, nil | |
# Basic settings: | |
# domain - The hostname to SSH to. | |
# deploy_to - Path to deploy into. | |
# repository - Git repo to clone from. (needed by mina/git) | |
# branch - Branch name to deploy. (needed by mina/git) |
Copy RouteListFilterCommand.php
to app/Console/Commands
Edit app/Console/Kernel.php
, then add 'App\Console\Commands\RouteFilterCommand',
to $commands
, like so
protected $commands = [
'App\Console\Commands\Inspire',
'App\Console\Commands\RouteFilterCommand',
];
A Pen by Mulia Arifandy Nasution on CodePen.
/** | |
* @param array $array | |
* @return \stdClass | |
* @internal param array $array | |
*/ | |
function convertArrayToObject(array $array) | |
{ | |
$object = new \stdClass; | |
foreach($array as $key => $value) |