PHPackages                             projectinfiniteme/sextant - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. projectinfiniteme/sextant

ActiveLibrary

projectinfiniteme/sextant
=========================

Laravel Sextant Engine

00PHP

Since Dec 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/projectinfiniteme/sextant)[ Packagist](https://packagist.org/packages/projectinfiniteme/sextant)[ RSS](/packages/projectinfiniteme-sextant/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Sextant.
----------------

[](#laravel-sextant)

Laravel Sextant - this is powerful, smart and simple filtration engine for api calls for laravel.

Capability Tale:

LaravelFilter&gt;=5.4.x &lt; 5.8.x[2.0.x](https://git.attractgroup.com/amondar/LaravelFilterAndSorting)&gt;=5.8^1.0.7Installation
------------

[](#installation)

- add below code into `composer.json`:

```
"repositories": [
    {
        "url": "https://git.attractgroup.com/amondar/sextant.git",
        "type": "git"
    }
]
"require": {
  "amondar/sextant": "^1.0.7"
}
```

- Publish configuration:

```
php artisan vendor:publish --provider="Amondar\Sextant\SextantServiceProvider"
```

Basics
------

[](#basics)

Use `HasSextantOperations` trait in the model. Redeclare `extraFields()` function if you need to make some relations publicly accessible for the api calls. Use below example:

```
    class SomeModel extends Model
    {
        use HasSextantOperations;

        ...

        public function extraFields()
        {
            return ['someRelation'];
        }

        ...

        public function someRelation()
        {
            return $this->hasOne(SomeRelation::class);
        }
    }
```

By default, after using sextant trait, it connects to the model as scope operation. So you can call it as below:

```
  public function index(Request $request)
  {
      return SomeModel::withSextant($request)->get()
  }
```

Filter Usage
------------

[](#filter-usage)

You must use `$_GET` parameter called `filter` to interacts with model filtering. Filter parameter expects json string with parameters.

### Available operations:

[](#available-operations)

**isNull** - not required parameter parameter, `accept` true or `false`, add `AND $key IS NULL` or `AND $key IS NOT NULL` to sql query string

**operation** - is a logical operation identifier, accept `'>','=','orWhere('field', 'some other search');
            })
     }
 }
```

This code will convert into SQL:

```
  SELECT * FROM `messages` WHERE `some_field` = 'search' AND (`field` = 'some search' OR `field` = 'some other search')
```

Raw usage
---------

[](#raw-usage)

You can use Sextant without model calls or on models that does not use Sextant operations trait. For example:

```
 app('sextant')->filtrate(User::class, $request, $predefinedParameters);

 \\or

 Sextant::filtrate(User::class, $request, $predefinedParameters);
```

As you can see, you can use filtration on model class. If model does not have Sextant operations, we will user our default model, which we will convert into yours:

```
 $newModel = new SextantModel();
 $newModel->setTable($model->getTable());
 $newModel->setKeyName($model->getKeyName());
 $newModel->setKeyType($model->getKeyType());

 return $newModel->withSextant($request, $params);
```

**NOTE:** that default models has empty `extraFields` and `extraScopes`. **NOTE:** that you can pre-define parameters for filtration by passing third parameter into `->withSextant(...)` function. Just pass parameters as array. Example:

```
 app('sextant')->filtrate(User::class, $request, ['sort' => '-created_at', 'filter' => ['posts.views_count' => ['operation' => '>=', 'value' => 10]]]);

 \\or

 Sextant::filtrate(User::class, $request, ['sort' => '-created_at', 'filter' => ['posts.views_count' => ['operation' => '>=', 'value' => 10]]]);
```

Extensions
----------

[](#extensions)

You can create your own extensions for Sextant engine. Just add your new action into config. `NOTE:` Every new action must implement `Amondar\Sextant\Contracts\SextantActionContract::class`

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/199a6b02968163382f0d8103eccd5407ec7ca9c5042b3023f48d3f00d87af235?d=identicon)[projectinfinite](/maintainers/projectinfinite)

### Embed Badge

![Health badge](/badges/projectinfiniteme-sextant/health.svg)

```
[![Health](https://phpackages.com/badges/projectinfiniteme-sextant/health.svg)](https://phpackages.com/packages/projectinfiniteme-sextant)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
