Download the PHP package nexusbrother/laravel-archivable without Composer

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

Laravel Archivable

Laravel Archivable 是一个强大的 Laravel 扩展包,用于数据库记录归档,它能够将不需要的记录从主数据库移动到归档数据库,同时保持表结构同步。

功能特性

安装

使用 Composer 安装包:

发布配置文件:

配置

在你的 .env 文件中配置归档数据库连接:

确保在 config/database.php 中定义了 archive 数据库连接:

配置项

在 config/archive.php 中可以配置以下选项:

使用方法

1. 基本归档功能

在模型中使用 Archivable Trait:

2. 基于日期字段的归档

使用 DateFieldArchivable Trait 实现基于日期字段的自动归档:

3. 按月分表归档

使用 MonthlyArchivable Trait 实现按月自动分表归档:

4. 同步表结构

在归档记录之前,确保归档数据库中存在对应的表结构:

也可以指定特定的模型:

5. 归档记录

使用命令行归档记录:

指定特定的模型:

设置分块大小:

仅预览将归档的记录数量:

6. 编程方式归档

事件

当模型记录被归档时,会触发 Nexusbrother\Archivable\ModelsArchived 事件,你可以监听这个事件来执行自定义逻辑:

要求

许可证

该项目使用 MIT 许可证 - 详情请参阅 LICENSE 文件

贡献

欢迎贡献代码!请提交 Pull Request 或创建 Issue。


All versions of laravel-archivable with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
laravel/framework Version ^9.0|^10.0|^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 nexusbrother/laravel-archivable contains the following files

Loading the files please wait ...