petrelli/live-statics-addons

扩展 petrelli/live-statics 的新功能插件

v0.0.2-alpha 2019-02-20 21:35 UTC

This package is not auto-updated.

Last update: 2024-09-28 09:22:29 UTC


README

Live-Statics 是一个开源的 Laravel 扩展包,可以帮助您快速构建原型和静态页面,并简化将数据注入真实视图的过程。由于所有模拟对象都将以真实对象的行为方式工作,因此您无需花费任何时间进行集成任务。

此包为您提供了新类、特性、Faker 提供者和模块供您使用。

安装

  1. 包含包

您可以通过以下命令运行

composer require petrelli/live-statics-addons

或者直接将其添加到您的 composer.json 文件中

"petrelli/live-statics-addons": "^0.0.1@alpha"

然后运行 composer update

  1. 发布配置文件和服务提供者
php artisan vendor:publish --provider="Petrelli\LiveStaticsAddons\BaseServiceProvider"

使用方法

use \Petrelli\LiveStaticsAddons\BaseMock;

class BookMock extends BaseMock implements BookInterface
{
    #...
}

特性

让我们以将 HasImages 包括进来作为示例,以模拟从 Twill 获取图片。

use \Petrelli\LiveStatics\BaseMock;
use \Petrelli\LiveStaticsAddons\Traits\Twill\HasImages;

class BookMock extends BaseMock implements BookInterface
{
    use HasImages;

    #...
}

待办事项

文档

  • 接口映射器
  • Twill 块
  • Twill 图片

许可证

MIT 许可证 (MIT)。请参阅 许可证文件 获取更多信息。