Download the PHP package lugege/laravel-aspect without Composer

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

PHP Version Laravel Version

Lugege\LaravelAspect

它融合了 Java Spring Boot 的 AOP 概念,并广泛利用 PHP8 注解来简化开发流程。

该项目目前正在开发中,在生产环境中使用时请谨慎。

简易路由

路由需要在 web.php 或 api.php 中单独配置,这在开发过程中并不方便,因为需要在不同文件之间切换。

相比之下,像 Spring Boot 或 Flask 这样的框架允许使用注解配置路由,使编码过程更加流畅。因此,我封装了基于注解的路由功能。

首先,你需要在 路由文件中注册,代码如下:

然后,你可以在控制器方法前使用路由注解:

自动装配

在 Java Spring Boot 框架中,@Autowired 注解用于自动注入依赖。我们可以使用 #[Autowired] 注解来实现相同的效果。

#[Autowired] 注解可以用于属性。#[Service] 注解用于将类标记为服务,这是自动装配所必需的。

配置值注入

除了依赖注入之外,Laravel-Plus 还支持配置值注入功能,让你可以直接将 Laravel 配置文件中的值注入到类属性中:

#[Value] 注解的第一个参数是配置键名,第二个参数是可选的默认值。如果配置不存在,将使用默认值。

Bean

长期以来,PHP 开发者习惯于使用功能强大的数组作为所有数据的载体。这不是一个优雅的做法,并且存在以下问题:

因此,我引入了 Bean 的概念。Bean 是一个具有强类型属性的数据载体,让你在编码过程中获得更好的提示:

你可以使用数组初始化 Bean,这是最常见的方法。当然,有时你也可以从一个 Bean 转换为另一个 Bean,它会过滤掉不匹配的字段:

你可以轻松地将 Bean 转换为数组或 JSON。默认情况下,将使用蛇形命名法。你可以使用 usingSnakeCase 参数关闭此功能:

有时,你可能需要比较两个 Bean:

通常,我们需要对从客户端传递的数据进行类型转换等预处理工作:

你甚至可以执行 XSS 过滤。

Bean 的一个特别有用的功能是支持嵌套:

它甚至支持数组嵌套:


All versions of laravel-aspect with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
laravel/framework Version ^10.0|^11.0|^12.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 lugege/laravel-aspect contains the following files

Loading the files please wait ...