Download the PHP package laravelldone/sql-to-signal without Composer

On this page you can find all versions of the php package laravelldone/sql-to-signal. 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 sql-to-signal

sql-to-signal

UNDER-DEVELOPMENT

Call ->toSignal() on any Eloquent or Query Builder chain and get back a reactive Signal object — ready to wire into Livewire 3/4 components and Alpine.js without any boilerplate.


Why not just clone $query?

The clone pattern is the typical workaround when you need to reuse a query builder — but it falls apart quickly in Livewire and Alpine.js contexts.

Reusing a query in a Livewire component

Without toSignal() — clone pattern

Problems:


With toSignal()


Passing data to Alpine.js

Without toSignal()

Gotchas:


With toSignal()


Summary

clone $query ->toSignal()
Survives Livewire serialization No — Builder can't be a public property Yes — Signal hydrates/dehydrates cleanly
Database hits for count + first Extra query each Zero — derived from the same Collection
Refresh in Livewire Rebuild query from scratch $signal->refresh()
Alpine.js wiring Manual json_encode per variable @js($signal) — data + meta in one shot
Model hydration on refresh Lost — raw stdClass Preserved — Eloquent models rebuilt
Polling interval in sync Hard-coded in JS Carried in signal.meta.polling_interval

Requirements


Installation

The service provider is auto-discovered. To publish the config file:


Configuration

config/sql-to-signal.php:


Basic Usage

Query Builder

Eloquent Builder

Override config per call


Using in Livewire

Declare a Signal as a public property — it serializes/hydrates automatically via the built-in Livewire synthesizer:

What Livewire sends over the wire (dehydrated payload):

For a paginated Signal, pagination_meta carries the full page state:

On the next request Livewire hydrates this back into a full Signal — no database hit until you call refresh().

Auto-polling with Livewire

Every 5 seconds Livewire calls refresh(), re-executes the query, and re-renders only the changed rows.


Using with Alpine.js

Signal implements JsonSerializable, so you can pass it directly to @js or an API endpoint:

@js($orders) renders:

Use signal.meta.polling_interval to drive a JS polling interval without hard-coding it:


Pagination

Unlike Livewire's built-in WithPagination (which only works inside render()), Signal pagination works anywhere — including mount().

Pagination meta is carried in toArray() and survives the Livewire wire round-trip:

Pass it to Alpine.js for client-side pagination controls without any extra wiring:

Pagination API

Method Return type Description
isPaginated() bool true when created with per_page
getTotal() int Total rows across all pages
getPerPage() int Rows per page
getCurrentPage() int Current page number
getLastPage() int Last page number
nextPage() Signal Signal for the next page (clamped at last page)
prevPage() Signal Signal for the previous page (clamped at page 1)
goToPage(int $page) Signal Signal for an arbitrary page

Signal API

Method Return type Description
getData() Collection Full result set for the current page
getQuery() string Base SQL with ? placeholders (no LIMIT/OFFSET)
getBindings() array Ordered binding values
getModelClass() string\|null Eloquent model class, or null for raw queries
getConnectionName() string\|null Database connection name
refresh() Signal Re-runs the query; re-runs the same page if paginated
count() int Row count for the current page
isEmpty() bool true when the current page is empty
first() mixed First row/model on the current page, or null
pluck(key, value?) Collection Delegates to Collection::pluck()
toArray() array ['data' => [...], 'meta' => [...]]
toLivewire() array Full serialized payload for Livewire transport
Signal::fromLivewire($value) Signal Reconstructs a Signal from a Livewire payload

Safety: max_rows

To prevent accidentally serializing large datasets through Livewire's JSON cycle, an OverflowException is thrown when the result count exceeds max_rows:

Scope your query before calling toSignal(), or set max_rows to null to disable the limit entirely:


Support me on Ko-fi

License

MIT — see LICENSE.


All versions of sql-to-signal with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
livewire/livewire Version ^3.0|^4.0
spatie/laravel-package-tools Version ^1.9
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 laravelldone/sql-to-signal contains the following files

Loading the files please wait ...