Download the PHP package railken/lem without Composer

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

Lem

Actions Status

A precise way to structure your logic to improve readability and maintainability of your code when building API.

Requirements

PHP 8.1 and later.

Installation

You can install it via Composer by typing the following command:

The package will automatically register itself.

Usage

First you need to generate a new structure folder, use:

php artisan railken:make:manager app App\Foo.

Now you can use it.

How can you get an Error during an operation? An error occurs when a validation or authorization fails. The cool thing about it is that you have the total control during each process: using Authorizer. When you're retrieving errors you're receiving a Collection, it goes pretty well when you're developing an api. Here's an example

So, what about the authorization part? First we have to edit the class User.

You can set the method can as you wish, it's better if a permission library is used such as https://github.com/Zizaco/entrust or https://github.com/spatie/laravel-permission.

If no system permission is needed simply leave return true.

"foo.attributes.title.fill" is passed to User::can() and if the return is false the result will contains errors.

Note: if you don't set any agent, the SystemAgent will be used (all granted).

See Authorizer for more explanations.

Commands

Manager

This is the main class, all the operations are performed using this: creating, updating, deleting, retrieving. This class is composed of components which are: validator, repository, authorizer, parameters, serializer

See Manager.

Model

This is the Eloquent Model, nothing changes, excepts for an interface

Repository

This is a Repository, the concept is very similar to the Repository of Symfony, code all your queries here.

See Repository for more information.

Validator

Here comes the validator, and again it's very simple. validate() is called whenever a create/update operation is called. Remember: always return the collection of errors. You can of course add a specific library for validation and use it here.

Serializer

This class will serialize your model


All versions of lem with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
railken/bag Version ^2.0.0
respect/validation Version ^2.2
nikic/php-parser Version ^4.18
symfony/yaml Version 6.* || 7.*
symfony/validator Version 6.* || 7.*
ext-intl Version *
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 railken/lem contains the following files

Loading the files please wait ....