PHP code example of songs2serve / nova-lens-card
1. Go to this page and download the library: Download songs2serve/nova-lens-card library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
songs2serve / nova-lens-card example snippets
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),
];
}
}
namespace App\Nova;
use Songs2Serve\NovaLensCard\LensCard;
class Song extends Resource
{
protected function cards()
{
return [
new LensCard(new MyLens()),
];
}
}