songs2serve/nova-lens-card

This package is abandoned and no longer maintained. No replacement package was suggested.

Add table cards to your Laravel Nova 3 dashboard by using your existing Lenses.

v0.1.0 2020-10-09 20:46 UTC

This package is auto-updated.

Last update: 2024-08-22 09:58:28 UTC


README

Turn your Laravel Nova 3 lenses into summary cards.

Installation

composer require songs2serve/nova-lens-card

Usage

Add a card on your Nova dashboard:

namespace App\Providers;

use App\Models\Song;
use Songs2Serve\NovaLensCard\LensCard;

class NovaServiceProvider extends NovaApplicationServiceProvider
{
    protected function cards()
    {
        return [
            new LensCard(new MyLens(), Song::class),
        ];
    }
}

Add a card on a resource overview:

namespace App\Nova;

use Songs2Serve\NovaLensCard\LensCard;

class Song extends Resource
{
    protected function cards()
    {
        return [
            new LensCard(new MyLens()),
        ];
    }
}

The amount of records can be customized by calling the limit() method.