lemonsqueezy/plain-ui-components 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lemonsqueezy/plain-ui-components

最新稳定版本:v0.7.0

Composer 安装命令:

composer require lemonsqueezy/plain-ui-components

包简介

Plain UI Components for Laravel

README 文档

README

Build Status Total Downloads Latest Stable Version License

A Laravel-based library to easily build Plain UI component cards.

Requirements

  • PHP 8.1 or higher
  • Laravel 8.83 or higher

Installation

Install the package with composer:

composer require lemonsqueezy/plain-ui-components

Usage

/**
 * An Plain Customer Card endpoint
 *
 * @link https://docs.plain.com/adding-context/customer-cards
 */
public function customerCards(Request $request)
{
    abort_unless($email = $request->input('customer.email'), 400, 'No email provided.');

    $user = User::where('email', $email)->firstOrFail();

    return Cards::make()
        // Adding a card directly is easy, but the data is not guaranteed to be used by Plain.
        ->add(Card::make('platform-details')->add(Text::make('Platform Version: '.config('app.version')))

        // As an alternative, you can therefore use a binding, which lazily resolves
        // only when the request asks for that card, making it way more efficient.
        ->bind('user-details', fn (Card $card) => $this->buildUserDetailsCard($card, $user))

        // Finally, we'll render the cards payload using the JSON Request made by Plain.        
        ->toArray($request);
}

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email hello@lemonsqueezy.com instead of using the issue tracker.

This way, we can safely discuss and resolve the issue (within a reasonable timeframe), without exposing users to the unnecessary additional risk. Once the issue is fixed and a new version is released, we'll make sure to credit you for your contribution (unless you wish to remain anonymous).

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 214.02k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 23
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 22
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-11