Download the PHP package edulazaro/laraterms without Composer

On this page you can find all versions of the php package edulazaro/laraterms. 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 laraterms

Laraterms

Polymorphic taxonomies for Laravel. Define tags, categories or any custom classification in config. Multi-tenant. Multi-locale. Hierarchical or flat. Spatie-compatible. Cross-locale search via auto-maintained search_text. Zero schema opinion beyond two tables.

Installation

Define your taxonomies

config/laraterms.php ships with tags and categories as examples. Edit or add what you need:

Multi-tenant (scope-scoped)

By default taxonomies are tenant-scoped: each scope (Organization, Workspace, Team) has its own isolated terms. Define how to resolve the scope of any taxable model:

Or per model:

The scope can be a Model, an array (['type' => 'organization', 'id' => 5]), a Scope value object, or null (global). It does not require a morph map: it works with FQCN as scope_type.

For taxonomies shared across all tenants (languages, countries), set scope: 'global'.

Make a model taxable

API

Multi-locale (i18n)

Each translatable field has two columns: the canonical one (name, description) and the translations one (name_translations, description_translations). Spatie-compatible (format: {"en": "...", "es": "..."}).

The accessor on name and description resolves automatically: active locale, then fallback locale, then canonical column.

Spatie integration (opt-in, on your side)

If you want the full Spatie API on the *_translations columns:

Our accessor on name/description keeps working because it reads the raw attributes.

Cross-locale search

search_text is auto-maintained in saving() by concatenating all values across all locales. Language-agnostic LIKE search:

Hierarchical

Model

Activate / deactivate (soft hide)

Each term has is_active (default true). Deactivating hides the term from pickers for new attachments, but models already attached keep showing the badge. Useful for "this tag is no longer used, but old posts that have it keep showing it".

This is NOT soft-delete. If you want proper SoftDeletes (with withTrashed, restore, etc.), extend the model in your app:

Merge terms (mergeInto)

For duplicate cleanup ("we had laravel and Laravel Framework, merge them into laravel"):

Guard: both must belong to the same taxonomy and the same scope. Throws InvalidArgumentException otherwise.

Facade

Schema

terms: id, taxonomy, scope_type, scope_id, parent_id, name, name_translations (JSON), handle, description, description_translations (JSON), search_text, color, sort_order, terms_count, meta (JSON), timestamps. Unique on (scope_type, scope_id, taxonomy, handle). FULLTEXT on search_text (best-effort, ignored if the engine does not support it).

termables: polymorphic pivot. term_id, termable_type, termable_id, sort_order, timestamps. Unique on (term_id, termable_type, termable_id).

Table names are configurable.

Exceptions

License

MIT.


All versions of laraterms with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
laravel/framework Version >=12.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 edulazaro/laraterms contains the following files

Loading the files please wait ...