public function firstOr($columns = ['*'], callable $callback = null)
    {
        if (is_callable($columns)) {
            $callback = $columns;

            $columns = ['*'];
        }

        if (! is_null($model = $this->first($columns))) {
            return $model;
        }

        return call_user_func($callback);
    }
public function firstOr($columns = ['*'], callable $callback = null)
    {
        if (is_callable($columns)) {
            $callback = $columns;

            $columns = ['*'];
        }

        if (! is_null($model = $this->first($columns))) {
            return $model;
        }

        return call_user_func($callback);
    }
public function firstOr ( $ columns = [ '*' ] , callable $ callback = null ) { if ( is_callable ( $ columns ) ) { $ callback = $ columns ; $ columns = [ '*' ] ; } if ( ! is_null ( $ model = $ this -> first ( $ columns ) ) ) { return $ model ; } return call_user_func ( $ callback ) ; }
Execute the query and get the first result or call a callback.

@param  callable|array  $columns
@param  callable|null  $callback
@return \Globalis\PuppetSkilled\Database\Magic\Model|static|mixed
Execute the query and get the first result or call a callback .