1. Go to this page and download the library: Download moonshine/import-export 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/ */
moonshine / import-export example snippets
use MoonShine\ImportExport\Contracts\HasImportExportContract;
use MoonShine\ImportExport\Traits\ImportExportConcern;
class CategoryResource extends ModelResource implements HasImportExportContract
{
use ImportExportConcern;
// ...
}
public function beforeImportFilling(array $data): array
{
return $data;
}
public function beforeImported(mixed $item): mixed
{
return $item;
}
public function afterImported(mixed $item): mixed
{
return $item;
}