Download the PHP package witify/support without Composer

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

witify/support

Base classes shared by the Witify Laravel applications: the Action contract, the base controller with its confirmation flow, the API resource and query builder bases, the module service provider with its shared-data and user-notification registries, the rich text sanitizer, the notification mail message and database channel, and the IsResource contract that feeds resource_data to the frontend.

Every other witify/* package that needs these classes depends on this one. Applications generated by the Sprintify template consume it instead of their former src/Support copies.

Requirements

PHP 8.2 to 8.4
Laravel 11 and 12
Database any Eloquent connection; DatabaseChannel writes to the application's notifications table

symfony/html-sanitizer is installed with the package.

Installation

The service provider is discovered automatically. It binds the two registries (config::sharedData, config::userNotifications), merges the default config and loads the support:: translations.

Publish the config only when a default needs to change, the translations only to reword them:

Tell the package how to sign the mails, in a service provider of the application:

Without a resolver the mails are signed with support.company_name, then app.name.

What the package provides

Class Role
Action\Action handle() contract of the single-purpose actions
Controller\Controller Base controller: user(), rateLimit(), confirmRequest()
Resource\BaseResource JSON resource that appends can: {view, update, delete} from the policies
QueryBuilder\BaseQueryBuilder Eloquent builder base: protect(), search(), dateBetween(), exclude(), deterministic pagination
Search\SearchQuery, Search\BelongsToSearchConstraint, Search\SearchConstraintInterface Keyword search over columns, expressions, callbacks and relations
Exception\BusinessRuleException, ReportableBusinessRuleException, RateLimitException, ShouldntReportOnRequest JSON exceptions (400, 429) and the marker that keeps them out of the error reporter
Http\Confirmation\Actions\ConfirmRequestAction, Http\Confirmation\ConfirmationHttpException, Http\Middlewares\ClearConfirmationFlow Confirmation flow: the first call answers 428, the replay with the confirmation headers runs the action
Model\IsResource, Model\IsResourceTrait Title, subtitle, icon, color and admin path of a model, appended as resource_data
Model\SanitizesHtmlTrait, Html\RichTextSanitizer Sanitizes the rich text fields of a model on every save against the html-sanitizer allow-list
Mail\MailMessage Notification mail with the greeting and the company signature
NotificationChannels\DatabaseChannel, Events\NewNotification Database channel writing the wide notifications row and broadcasting notifications.created on the user's private channel
ModuleServiceProvider Base provider of the modules: routes, policies, translations, shared data and user notifications
SharedData\SharedData, UserNotifications\UserNotifications The two registries the modules fill and the application reads
Host Resolvers for the values the package takes from the application

Contracts the frontend relies on

These shapes are read by the Vue applications and by the code the Architect generator produces. They do not change inside a major version.

Shared data

Modules put what the frontend needs into the registry from their provider:

The application collects the registry into its window.Laravel payload, together with its own values:

The registry no longer calls the application's ShareDataToClient: the application merges the two, so the package never imports application code.

Configuration

Key Default Purpose
support.admin_url /admin prefix of resource_data.admin_url
support.company_name null, then app.name signature of the mails when no resolver is set
support.notifications.channel user.{id} private channel of NewNotification
support.notifications.broadcast true broadcast after the database channel stored a notification
html-sanitizer.* the TipTap allow-list of sprintify-ui elements, attributes and schemes kept by RichTextSanitizer

Translations live under the support:: namespace: messages (unauthorized action, too many requests), confirmation (titles, buttons, password throttle) and mail (greeting, regards).

Migrating an application from src/Support

  1. composer require witify/support.
  2. Delete the classes listed above from src/Support and modules/Utils/ModuleServiceProvider.php; keep the application-specific ones (ShareDataToClient, UserPermissions, the middlewares, the rules, ...).
  3. Replace the imports: Support\Action\Action becomes Witify\Support\Action\Action, and so on. Support\Config\ShareData\SharedData becomes Witify\Support\SharedData\SharedData, Support\Config\UserNotifications\* becomes Witify\Support\UserNotifications\*, Modules\Utils\ModuleServiceProvider becomes Witify\Support\ModuleServiceProvider, Modules\Notification\Events\NewNotification becomes Witify\Support\Events\NewNotification.
  4. Remove the config::sharedData and config::userNotifications singletons from the application provider: the package binds them.
  5. Make ShareDataToClient merge app(SupportServiceProvider::SHARED_DATA)->all() and point the layout at it.
  6. Register Host::resolveCompanyNameUsing().
  7. Update the Architect stubs so the generated code imports the package classes.

Controller::user() now returns Illuminate\Contracts\Auth\Authenticatable; annotate or check the type where the application relies on its own User model.

Changelog and upgrades

See the CHANGELOG of the monorepo. Every package shares the same version number.

Contributing

This repository is a read-only split of witify/packages. Open pull requests there, in packages/support.


All versions of support with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/auth Version ^11.0|^12.0
illuminate/broadcasting Version ^11.0|^12.0
illuminate/cache Version ^11.0|^12.0
illuminate/contracts Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/http Version ^11.0|^12.0
illuminate/notifications Version ^11.0|^12.0
illuminate/routing Version ^11.0|^12.0
illuminate/session Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
illuminate/translation Version ^11.0|^12.0
symfony/html-sanitizer Version ^7.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 witify/support contains the following files

Loading the files please wait ...