public function findOrCreate($id, array $columns = ['*'])
    {
        $model = $this->query()->find($id, $columns);
        if (!$model) {
            return $this->getModel()->newInstance();
        }

        return $model;
    }
public function findOrCreate($id, array $columns = ['*'])
    {
        $model = $this->query()->find($id, $columns);
        if (!$model) {
            return $this->getModel()->newInstance();
        }

        return $model;
    }
public function findOrCreate ( $ id , array $ columns = [ '*' ] ) { $ model = $ this -> query ( ) -> find ( $ id , $ columns ) ; if ( ! $ model ) { return $ this -> getModel ( ) -> newInstance ( ) ; } return $ model ; }
Find a model by its primary key. If not then ne instance is being created.

@param int $id
@param array $columns
@return Model
Find a model by its primary key . If not then ne instance is being created .