PHP code example of luna / laravel-importer

1. Go to this page and download the library: Download luna/laravel-importer 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/ */

    

luna / laravel-importer example snippets


    'providers' => [
        // ...
        // Package providers

        Luna\Importer\ServiceProvider::class,
    ],

    'aliases' => [
        // ...

        "Import" => Luna\Importer\ImporterFacade::class
    ]

return [
    /***********************************************************
     * Importers are used for defining specific import tasks
     * For instance, a ProductImporter could import a file with
     * products into a table.
     ***********************************************************/
    'importers' => [
        'default' => \App\Importers\ProductImporter::class
    ],

    /***********************************************************
     * Runners are used for looping through the file
     * The default is a CSV runner which will loop though
     * CSV files line-by-line. A runner uses an importer to get
     * import specific settings like the model class.
     ***********************************************************/
    'runners' => [
        'default' => \Luna\Importer\Runners\CsvRunner::class
    ]
];

    php artisan vendor:publish --provider="Luna\Importer\ServiceProvider"