src/Model.php
public static function find($key)
    {
        $instance = new static;

        $model = $instance->newQuery()->id($key)->take(1)->first();

        if ($model) {
            $model->exists = true;
        }

        return $model;
    }
public static function find($key)
    {
        $instance = new static;

        $model = $instance->newQuery()->id($key)->take(1)->first();

        if ($model) {
            $model->exists = true;
        }

        return $model;
    }
public static function find ( $ key ) { $ instance = new static ; $ model = $ instance -> newQuery ( ) -> id ( $ key ) -> take ( 1 ) -> first ( ) ; if ( $ model ) { $ model -> exists = true ; } return $ model ; }
Get model by key
@param $key
@return mixed
Get model by key