Download the PHP package ayup-creative/laravel-dsql without Composer

On this page you can find all versions of the php package ayup-creative/laravel-dsql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-dsql

Laravel Advanced Search DSL

CI/CD Latest Version on Packagist Total Downloads License

A production-ready domain-specific language (DSL) for Laravel applications. This package allows you to expose complex, user-defined search expressions while abstracting and protecting your underlying database schema.

Designed for reporting tools, analytics dashboards, and advanced filtering APIs, it converts a safe string-based syntax into composable Eloquent queries.

✨ Features

🚀 Quick Start

Installation

Basic Usage

🔍 Autocomplete Support

The DSL provides built-in support for generating metadata for your UI via the AdvancedSearch facade.

📖 Syntax Guide

Column Selection

Specify which fields to return with SELECT:

Alias Reuse

Aliases defined in the SELECT clause can be reused in subsequent SELECT expressions and in the WHERE clause:

If no SELECT is specified, the system defaults to selecting all columns (*) in the database query.

Default Selections for UI/Reports

You can define a default set of fields to be returned by getSelections() when no SELECT clause is provided. This is useful for building dynamic report tables.

Or by defining a static method:

If neither is defined, it fallbacks to the model's getFillable() list.

Virtual Columns

Virtual columns allow you to expose internal database logic or complex calculations as safe, user-friendly field names. You can define them using the #[VirtualColumn] attribute on your model classes or static methods.

A virtual column can specify:

If only an expression is provided (on the class or a method), it will be used for both selection and filtering. If a method is decorated, it acts as the primary resolver for filtering.

Fields (Columns)

Fields are always wrapped in square brackets: [status], [customer.name].

Literals (Values)

Arithmetic

Full support for +, -, *, / on the left-hand side of conditions:

Relationship Aggregates

Operators

Relationship Traversal

The DSL supports querying across Eloquent relationships using dot notation:

For selection, dotted paths are supported directly in the SELECT clause:

The system automatically detects relationships in the SELECT clause, eager-loads them using $query->with(), and ensures that necessary foreign keys (for BelongsTo) or primary keys (for HasOne/HasMany) are included in the SQL selection. Plural relationships (e.g., HasMany) are automatically resolved into arrays when accessed via getSelectionValue().

Boolean Logic

([status]:equals"active" OR [priority]:gt 5) AND [category]:in(books, electronics)

Sorting & Limits

Developer Guide

For detailed information on how to extend the system with custom operators or advanced resolvers, please see the DEVELOPER_GUIDE.md.

🛠️ Development

This project uses pre-commit to maintain code quality and ensure consistent commit messages.

Pre-commit Hooks

We use pre-commit to automatically run:

To set up pre-commit locally:

  1. Install pre-commit on your machine.
  2. Run pre-commit install in the project root to set up the git hook scripts.
  3. Run pre-commit install --hook-type commit-msg to enable commit message linting.

Conventional Commits

We follow the Conventional Commits specification for all commit messages. This allows us to automate our release process and generate consistent changelogs.

Common types:

CI/CD & Automated Releases

Our GitHub Actions workflow handles the following sequentially:

  1. PHPUnit tests: Runs tests across multiple PHP versions (8.2, 8.3, 8.4, 8.5).
  2. Commit/PR lint: Validates that pull request titles follow conventional commit standards.
  3. Release Please: Automatically creates GitHub releases, tags, and updates the changelog when a PR is merged into the main branch.

Testing

Run the test suite with PHPUnit:

You can also run tests using Composer:

For coverage reports (requires Xdebug):

Pint is also available for code formatting. Run pint to fix any issues.

License

MIT License.


All versions of laravel-dsql with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ayup-creative/laravel-dsql contains the following files

Loading the files please wait ...