Download the PHP package acidjazz/humble without Composer

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

Ideal Sessioning and authentication for Laravel

Packagist License Latest Stable Version Total Downloads

Features

Installation

Install humble with composer:

Add Humble's trait to your user model:

Publish Humble's migrations (sessions table)

Run the migration

Change your guard in your config, to the 'humble' guard in config/auth.php, in my case since I mainly use Laravel as an API

Check your defaults as well, if it's not api, you'll need to change that

If your user class is not App\Models\User, we need to tell humble what it is:

Publish Humble's configuration

Modify config/humble.php and specify your user class

Usage

Humble is similar to Laravel Sanctum in the way you can also assign abilties to sessions.

Primarily humble sessions are stored for user sessions which by default would inherit all session abilities. You can also think of Humble Session as Personal Access Tokens, inside your application your users could create multiple session tokens for various services and integrations like: GitHub actions, CLI Applications, Slack Tokens, etc...

With these addtional session tokens your users can create, you still have access to the session source where you can attach certain Gates & Policy behaviors based on that. If your are fine with leaving these session tokens as-is with same access as the user you can stick with that. If you need more granularity you can also assign abilites.

With abilites you can addtionally set specific rules these session tokens can have. For example you might want to have a session tokens for a GitHub action that only has the abilty to peform READ events and not WRITE.

These abilites can be user defined in your app, meaing its up to you to declare these rules in your app and check/valdiate them. The default ability is set to ["*"] which means full access, but when creating a session you can pass a parameter to only set this to READ, and which your database record would show as ["READ"]

For valdiating these abilites we provide a few helpers and middlewares to make this easier.

To validate the middleware level you first need to add the following to your $routeMiddleware inside of app/Http/Kernel.php

Once you add those, you can apply them in your routes middleware like so:

The example would pass if that session token had the abilites as: ["*"] or ["admin"]

You can also use abilities as middleware which is a strict check that the token must have all the given abilites.

Other ways of checking/valdiating abilites inside of your app in areas like Gates & Polciies

  1. auth()->user()->tokenCan('write')
  2. auth()->session()->can('write')
  3. $user()->tokenCan('write')
  4. $request->user()->tokenCan('write')

We also provide an easy way to create new session tokens with the following method

This would also work with either auth()->user()->createToken(...) or $request->user()->createToken(...)


All versions of humble with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version 9.*|10.*|11.*|^12.0
php Version ^8.1
whichbrowser/parser Version ^2.1
torann/geoip Version ^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 acidjazz/humble contains the following files

Loading the files please wait ....