Download the PHP package esanj/app-service without Composer

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

Esanj App Service

The App Service package is part of the Esanj microservice ecosystem. It lets a host application register external services (each identified by a client_id), assign per‑service API permissions, and validate incoming JWT requests from those services — through both a web admin panel and a JSON API.

Supports: Laravel 10 · 11 · 12 · 13 — PHP 8.2+


🧩 Features


⚙️ Requirements


🚀 Installation

app-service:install will:

  1. Publish the assets and config (config/esanj/app_service.php).
  2. Ask to run migrations (creates services, service_metas, service_permissions, service_permission_map).
  3. Import the service permissions (app-service:permissions-import).
  4. Import the manager permissions (the permissions from this package's config) into esanj/managers.

Steps 3–4 are skipped with a warning if the relevant tables don't exist yet — run php artisan migrate first, then re‑run the import commands.


🔧 Configuration

The config file is config/esanj/app_service.php (merged under the key esanj.app_service).

Key Default Env Description
routes.web_prefix admin APP_SERVICE_WEB_PREFIX Prefix for the web panel routes.
routes.api_prefix api APP_SERVICE_API_PREFIX Prefix for the API routes.
just_api false APP_SERVICE_JUST_API API‑only mode (no web panel/views).
middlewares.web ['web', 'manager.auth:web'] Middleware for the web panel.
middlewares.api ['api', 'manager.auth:api'] Middleware for the management API.
permissions 4 services.* permissions Manager permissions guarding the panel/management API.
service_permissions 5 transactions.* examples Service permissions assignable to services.
access_provider action → permission map Which manager permission each controller action needs.
extra_fields [] Blade views injected into the create/edit forms.

ℹ️ Two kinds of permissions — don't confuse them:

  • permissions (services.list/create/update/delete) gate managers using the admin panel/management API.
  • service_permissions (transactions.*, etc.) are granted to services and checked by service.permission.

🖥️ Web UI

Available when just_api is false. Visit route('services.index') (default /admin/services) to list, create, edit, delete, and restore services.

Method URI (default) Route name Manager permission
GET /admin/services services.index services.list
GET /admin/services/create services.create services.create
POST /admin/services services.store services.create
GET /admin/services/{id}/edit services.edit services.update
PUT/PATCH /admin/services/{id} services.update services.update
DELETE /admin/services/{id} services.destroy services.delete
POST /admin/services/{id}/restore services.restore services.delete
GET /admin/services/validation services.validation (authenticated manager)

🔗 Management API

These endpoints manage service records and are guarded by manager.auth:api (a manager Bearer token from esanj/managers) plus the matching services.* manager permission.

Method URI (default) Route name Manager permission
GET /api/services api.services.index services.list
POST /api/services api.services.store services.create
GET /api/services/{id} api.services.show services.list
PUT/PATCH /api/services/{id} api.services.update services.update
DELETE /api/services/{id} api.services.destroy services.delete
POST /api/services/{id}/restore api.services.restore services.delete
GET /api/services/validation api.services.validation (manager auth)

Body for create/update: name (required, unique), client_id (required, unique), is_active (boolean), permissions (array of service_permissions IDs).


🔐 Service permissions

Define the permissions your services can hold in config/esanj/app_service.php:

Import them into the database:

Then assign them to a service from the edit page, or via the API permissions array.


🧩 Middleware

service.validation — validate a service JWT

Validates the Authorization: Bearer {token} JWT (RS256, verified with the auth‑bridge public key). On success it attaches to the request:

On a missing/invalid/expired token it throws a 401 Unauthorized.

service.permission:{key} — authorize a service

Checks that the calling service (identified from its JWT) is active and holds the given permission. It validates the JWT itself, so you don't have to chain service.validation before it.


🌐 API‑only mode

If you don't need the web panel:

This disables the web routes and views; the API stays fully functional. In this mode esanj/layout-master is not required.


🎛️ Extending the forms

Inject your own Blade views into the create/edit forms via config (each is @include‑d):


📚 Documentation

For a complete, beginner‑friendly, step‑by‑step walkthrough — registering a service, assigning permissions, protecting your own service API, adding a custom permission or form field, and troubleshooting — see docs/GUIDE.md.


🪪 License

MIT — part of the Esanj ecosystem.


All versions of app-service with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3|^8.4
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
firebase/php-jwt Version ^6.11
esanj/managers Version >=0.4.0 <0.5.0
esanj/auth-bridge Version >=0.2.0 <0.3.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 esanj/app-service contains the following files

Loading the files please wait ...