Download the PHP package boss/laravel-district-access without Composer

On this page you can find all versions of the php package boss/laravel-district-access. 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-district-access

Laravel District Access

Configurable district-based query scoping and access control for Laravel applications.

Requirements

Installation

Laravel package discovery registers the service provider automatically.

Publish configuration:

Basic usage

The service returns the query unchanged for a configured super admin. For normal users it adds a whereIn for their allowed districts. By default, a normal user with no districts receives a query that can return no rows (1 = 0).

Configuration

The default configuration assumes a user property named district_role containing either a comma-separated string or an array. This is only a default: applications can replace the resolver callbacks.

For applications using a custom session-based user lookup, configure user_resolver in the application's published config instead of changing the package.

Dependency injection

Middleware

The package registers this middleware alias:

Use it on routes when the endpoint requires a resolved authenticated district-access user:

This middleware does not perform query filtering itself. It only ensures that the package can resolve an authenticated user. Query scoping should be explicitly applied to every relevant query.

Security model

This package follows deny-by-default behavior for normal users with no assigned districts. Super-admin behavior is delegated to the configurable resolver. Never rely on a controller-only filter if sensitive records can be accessed through another endpoint; apply the scope at every data access boundary or introduce your own repository/query abstraction.

Testing

Versioning

Use semantic version tags:

Do not add a version field to composer.json; Packagist detects package versions from VCS tags.

Publishing to Packagist

  1. Push this repository to a public GitHub repository.
  2. Run composer validate --strict.
  3. Create a release tag such as v1.0.0.
  4. Submit the public repository URL on Packagist.
  5. Packagist will crawl the repository and detect future VCS tags.

License

MIT.


All versions of laravel-district-access with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.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 boss/laravel-district-access contains the following files

Loading the files please wait ...