<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Gleba extends Model
{
    protected $table = 'sige.glebas';
    protected $fillable = ['id'];

    public function search($filter = null)
    {
        $results = $this->where(function ($query) use ($filter){
            if($filter){
                $query->where('id', "$filter}");
            }
        })//->toSql();
        ->paginate();
        return $results;
    }
    
}
