PHP code example of lupennat / import-export-card
1. Go to this page and download the library: Download lupennat/import-export-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/ */
lupennat / import-export-card example snippets
// in app/Nova/<Resource>.php
public function cards(NovaRequest $request)
{
return [
new \Lupennat\ImportExportCard\ImportCard(self::class),
(new \Lupennat\ImportExportCard\DownloadImportSampleCard(asset('import-samples/file.csv')))
->withHelp('By importing you will insert a new row or update duplicate entries.'),
new \Lupennat\ImportExportCard\ExportCard(self::class),
];
}
// app/Nova/User.php
class User extends Resource
{
public static $importer = CustomImporter::class;
public static $exporter = CustomExporter::class;
// ...
}