Download the PHP package mwebbers/laravel-code-commons without Composer

On this page you can find all versions of the php package mwebbers/laravel-code-commons. 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-code-commons

LaravelCodeCommons

Shared Laravel/Livewire conventions, packaged once instead of hand-copied per project. These pieces used to live as near-identical copies across consuming apps and drifted; this package is the single canonical home.

Requires PHP 8.3+ and illuminate/support ^13.8 (Laravel 13). MIT-licensed.

Install

The package is on Packagist and a tagged release is picked up automatically, so no VCS repositories entry is needed — consumers that still carry one can drop it.

Versioning

From 1.0.0 this package follows semantic versioning: everything under src/ is public API, and breaking changes to it land only in a new major — preceded where practical by an @deprecated tag in the last minor. New features arrive in minors, fixes in patches. Consumers require ^1.0.

What's in it

Support\Json — typed mixed narrowing

The single sanctioned place a JSON/config() mixed becomes a real type, which is what lets a consuming app keep PHPStan at level 10 without scattered casts. Every accessor degrades to a default instead of crashing on a wrong-typed or missing value.

Livewire\Concerns\WithCollectionSorting — a stable sortable-table concern

Click-to-sort for a Livewire table over an in-memory collection. Owns only the sort state and the toggle; the host supplies a column => extractor map. The sort is stable in both directions — equal-key rows keep their natural order whether ascending or descending (it uses sortByDesc, never a reverse() of the ascending sort, which would flip ties). Uses only Illuminate collections, so the logic is testable without a Livewire runtime.

Livewire\Concerns\WithCollectionPagination — paginate an in-memory collection

Composes the sort concern with Livewire's pagination: it paginates an already-derived collection at perPage() rows, renders one page at a time, and resets to page 1 when the sort changes. An out-of-range ?page= clamps to the last real page — the URL is user-controlled input, and the data exists (just not 99 pages of it), so an empty table would be misleading. For a query builder use Livewire's native ->paginate(); this is for a set you already hold in memory.

Livewire\Concerns\LazyTableSkeleton — a #[Lazy] table's placeholder

Pairs with #[Lazy] to render a skeleton while the table body hydrates in a second request. It uses the page's real column headers so the skeleton auto-sizes like the live table (no layout shift). The placeholder view is app-provided — ship a livewire.placeholders.table Blade view (it carries your design system, e.g. Flux), or override skeletonView() to point at your own; a host overrides skeletonColumns() / skeletonRows() to match its table. A skeletonColumns() entry is either a bare label or a 'label' => alignment pair (start/center/end), so a column the live table end-aligns starts where it will end up — the view normalizes both forms. One caveat: a purely numeric label ('2024') cannot carry an alignment pair, because PHP coerces such array keys to int.

Testing\ScopeCoverage — the SCOPE↔test traceability checker

A coverage gate, extracted so every consuming app runs the same checker instead of a hand-copied ScopeCoverageTest. It reads the feature IDs from a SCOPE.md ## Features section and the #[Group('F-00X')] references across a tests directory, and reports either side's gaps.

An app's ScopeCoverageTest becomes a thin wrapper:

Roadmap

Planned for later minors: a DuskTestCase base for browser smoke tests. See CHANGELOG.md.

Development


All versions of laravel-code-commons with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^13.8
livewire/livewire Version ^4.4.6
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 mwebbers/laravel-code-commons contains the following files

Loading the files please wait ...