elipzis/nova-embed-card 问题修复 & 功能扩展

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

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

elipzis/nova-embed-card

最新稳定版本:v1.0.0

Composer 安装命令:

composer require elipzis/nova-embed-card

包简介

A custom Laravel Nova card to embed external content in an iframe

README 文档

README

A custom Laravel Nova card to embed external content in an iframe, e.g. from YouTube on a dashboard.

Installation

You can install the package to your Laravel Nova enabled project via composer:

composer require elipzis/nova-embed-card

Usage

Use the EmbedCard() by adding it to your cards method of the NovaServiceProvider or your custom dashbord.

/**
 * Get the cards that should be displayed on the Nova dashboard.
 *
 * @return array
 */
protected function cards() {
    return [
        //Your other cards...
 
        //A most simple embed
        (new EmbedCard())->url('https://www.youtube.com/embed/WhWc3b3KhnY'),
        
        //A more complex embed of raw <iframe>...</iframe> HTML with header and footer
        (new EmbedCard())->header('Spring')->footer('A Blender Open Movie')->code('<iframe width="560" height="315" src="https://www.youtube.com/embed/WhWc3b3KhnY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>')
    ];
}

See the Laravel Nova documentation for more insights about cards.

Card options

Content options

  • url('string') : The URL to embed. If an URL is set, code is neglected.
  • code('string') : Raw <iframe>...</iframe> HTML content to embed.

Either url or code have to be configured

Text options

  • header('string'): Header text to lead the embedded content as simple text string or raw HTML
  • footer('string'): Footer text to conclude the embedded content as simple text string or raw HTML

Styling options

  • center('bool') : Center texts and content. Defaults to 'true'.
  • height('string') : The height of the card as 'auto', 'default' or a pixel number. Defaults to 'auto'
  • forceFullWidth() : Force the card to be full width
  • cardClasses('string') : CSS classes to attach to the card element
  • headerClasses('string') : CSS classes to attach to the header element
  • footerClasses('string') : CSS classes to attach to the footer element

Example

Screenshot

Compatibility

This custom Laravel Nova Embed Card has been tested with Laravel Nova v3.8.2

License and Credits

The Laravel Nova Embed Card is released under the MIT license by elipZis.

Disclaimer

This source and the whole package comes without a warranty. It may or may not harm your computer. Please use with care. Any damage cannot be related back to the author. The source has been tested on a virtual environment and scanned for viruses and has passed all tests.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-13