Download the PHP package nextgen-tech/laravel-abilities without Composer

On this page you can find all versions of the php package nextgen-tech/laravel-abilities. 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-abilities

Laravel Abilities

Spis treści

Instalacja

composer

W terminalu wpisz

Service Provider

Jeśli aplikacja korzysta z Laravela w wersji 5.5 lub wyższej to możesz pominąć ten krok.

W pliku config/app.php do listy providerów dopisz:

Middleware

W pliku app/Http/Kernel.php do grupy web należy dopisać:

Kopiowanie plików

Aby skopiować z paczki niezbędne pliki wykonaj następujące polecenie:

Można także opublikować część plików podając jeden z tagów: config, translations, models lub migrations:

Migracje

Uruchom migracje

Konfiguracja

Konfiguracja paczki znajduje się w pliku config/abilities.php.

Definicja uprawnień

Domyślnie uprawnienia znajdują się w pliku routes/abilities.php. Ścieżkę tę można zmienić w konfiguracji.

Definiować uprawnienia należy za pomocą fasady NGT\Laravel\Abilities\Facades\Ability lub instancji klasy NGT\Laravel\Abilities\AbilityRegistrar.

Grupy uprawnień

Grupy definiujemy za pomocą metody group. Grupa może składać się z wyświetlanej nazwy (label) oraz przedrostka (prefix), ale żadna z tych opcji nie jest obowiązkowa. Grupa może także zawierać w sobie inne grupy. Dane grupy są przekazywane do podrzędnych elementów znajdujących się w anonimowej funkcji.

Pojedyncze uprawnienie

Każde uprawnienie posiada swoją uproszczoną nazwe ($slug) oraz wyświetlaną nazwe ($label). Dodatkowo można zdefiniować opcje ($options).

Aliasy

Każde uprawnienie może posiadać aliasy. Najlepszym przykładem są akcje create-store oraz edit-update. Aby zarządzać nimi jako jednym uprawnieniem można je zdefiniować w następujący sposób:

Własna funkcja

Aby uprawnienie nie korzystało z domyślnej metody weryfikacji można przekazać do niego funkcję. Funkcja ta zostanie wykonana zamiast domyślnej.

Zasoby uprawnień

Podobnie jak w routingu, w uprawnieniach również można definiować zasoby. Podczas tworzenia zasobu należy podać przedrostek grupy ($prefix) oraz wyświetlaną nazwę grupy ($label).

Dodatkowo można przekazać opcje wykluczace lub dopuszczające tylko wybrane uprawnienia.

Sprawdzanie uprawnień

Kaźde uprawnienie można sprawdzać za pomocą standardowych metod klasy Gate:

Aby kontroler automatycznie sprawdzał uprawnienia do danych akcji można zdefiniować w nim listę powiązań między akcjami a uprawnieniami


class UserController extends Controller
{
    ...

    public $actionAbilities = [
        'index'  => 'admin.user.index',
        'create' => 'admin.user.create',
    ];

    ...
}

All versions of laravel-abilities with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6|^7.0
illuminate/auth Version ^5.4|^6.0|^7.0|^8.0
illuminate/routing Version ^5.4|^6.0|^7.0|^8.0
illuminate/support Version ^5.4|^6.0|^7.0|^8.0
illuminate/translation Version ^5.4|^6.0|^7.0|^8.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 nextgen-tech/laravel-abilities contains the following files

Loading the files please wait ....