Download the PHP package zenithsu/laravel-plus without Composer

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

Laravel-Plus-Logo

PHP Version Laravel Version Setup Automated Download statistics License

Laravel Plus

Laravel is an elegant framework that greatly simplifies development. However, no framework is truly "out-of-the-box" ready for all use cases; customization based on individual habits and project requirements is often necessary.

Laravel Plus addresses this need by incorporating AOP concepts from Java's Spring Boot and extensively utilizing PHP 8 attributes to streamline the development process.

This project is currently under development. Please be cautious when using it in a production environment.

Installation

This is installable via Composer as https://packagist.org/packages/zenithsu/laravel-plus.

Easy Router

In Laravel, routes need to be configured separately in web.php or api.php, which is not convenient during development as it requires switching between different files.

In contrast, frameworks like Spring Boot or Flask allow route configuration using annotations, making the coding process more fluid. Therefore, I have encapsulated annotation-based routing.

First, you need to register in api.php, the code is as follows:

Then, you can use route annotations before controller methods:

You can access this API via /api/login. In addition to GetMapping, PostMapping, PutMapping, and DeleteMapping are also supported.

Furthermore, you can add a Prefix annotation to the controller to uniformly add a route prefix for all methods within the controller.

Request

In Laravel-Plus, inspired by SpringBoot's RequestBody annotation, you can use a class to carry parameters from the body:

Then, you can use the RequestBody annotation to inject parameters from the body:

Validators

In Laravel, parameter validation is not a difficult task. However, it can be made even simpler through the use of annotations.

First, you need to enable the parameter validation middleware:

Then, you can use the Param annotation to validate parameters:

The rule supports Laravel's built-in rules, except for regular expressions.

For particularly complex rules, it is recommended to use custom validators:

In the example above, I wrote a custom rule for a common password validation:

By default, all parameters are required. You can use the required parameter to set them as optional, and use the default parameter to set default values:

Bean

Long-term dependency, PHPers are accustomed to using powerful arrays as carriers for all data. This is not an elegant practice and has the following problems:

Therefore, I introduced the concept of Bean. A Bean is a data carrier with strongly typed properties, allowing you to get better hints during the coding process:

You can initialize a Bean using an array, which is the most common method.Of course, sometimes you can also convert from one Bean to another Bean, and it will filter out mismatched fields:

You can easily convert a Bean to an array or JSON, By default, snake case naming will be used. You can turn off this feature using the usingSnakeCase parameter:

Sometimes, you may need to compare two Beans:

Often, we need to perform preliminary work such as type conversion on the data passed from the client:

You can even perform XSS filtering.

A particularly useful feature of Beans is their support for nesting:

It even supports array nesting:

Autowired

In the Java Spring Boot framework, the @Autowired annotation is used to automatically inject dependencies. In Laravel-Plus, we can use the #[Autowired] annotation to achieve the same effect。

The #[Autowired] annotation can be used on properties. The #[Service] annotation is used to mark the class as a service, which is required for autowiring.


All versions of laravel-plus with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
laravel/framework Version ^11.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 zenithsu/laravel-plus contains the following files

Loading the files please wait ....