cloudstudio/card-extended 问题修复 & 功能扩展

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

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

cloudstudio/card-extended

Composer 安装命令:

composer require cloudstudio/card-extended

包简介

A Laravel Nova card.

README 文档

README

Total Downloads

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require cloudstudio/card-extended

Next up, you must register the field with Nova. This is typically done in the resource file.

use Cloudstudio\CardExtended\CardExtended;

/**
     * Get the cards available for the request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
*/
public function cards(Request $request)
{
    return [
        (new CardExtended())
            ->view('cards.text')
            ->data(User::find(1))
            ->onlyOnDetail()
            ->width('full'),
    ];
}

First parameter is a typical blade view

resurces/views/cards/text.blade.php

Example view

<div class="max-w-sm rounded overflow-hidden shadow-lg bg-white">
    <img class="w-full" src="https://tailwindcss.com/img/card-top.jpg" alt="Sunset in the mountains">
    <div class="px-6 py-4">
        <div class="font-bold text-xl mb-2">{{ $data->name }}</div>
        <p class="text-grey-darker text-base">
            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil.
        </p>
    </div>
    <div class="px-6 py-4">
        <span class="inline-block bg-grey-lighter rounded-full px-3 py-1 text-sm font-semibold text-grey-darker mr-2">#photography</span>
        <span class="inline-block bg-grey-lighter rounded-full px-3 py-1 text-sm font-semibold text-grey-darker mr-2">#travel</span>
        <span class="inline-block bg-grey-lighter rounded-full px-3 py-1 text-sm font-semibold text-grey-darker">#winter</span>
    </div>
</div>
Nova Card Preview

Captura de pantalla 2019-04-30 a las 18 19 08

( Preview with this blade )

Second parameter is the data, you can use strings, number, array, collection...

$data = User::all();
$data = Auth::user()->name;
$data = ['title' => 'Hello world']
$data = 'hello!';
$data = 1;

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-30