# Installation

# Requirements

  • PHP: ^7.2
  • Laravel: ^5.8
  • League/Csv: ^9.0

# Installation

Require Laravel CSV in the composer.json of your Laravel project. This will download the package and League/Csv.

composer require maatwebsite/laravel-csv
1

The Maatwebsite\LaravelCsv\LaravelCsvServiceProvider is auto-discovered and registered by default.

If you want to register it yourself, add the ServiceProvider in config/app.php:

'providers' => [
    /*
     * Package Service Providers...
     */
    Maatwebsite\LaravelCsv\LaravelCsvServiceProvider::class,
]
1
2
3
4
5
6

The Csv facade is also auto-discovered.

If you want to add it manually, add the Facade in config/app.php:

'aliases' => [
    ...
    'Csv' => Maatwebsite\LaravelCsv\Facades\Csv::class,
]
1
2
3
4

To publish the config, run the vendor:publish command:

php artisan vendor:publish --provider="Maatwebsite\LaravelCsv\LaravelCsvServiceProvider"
1

This will create a new config file named config/csv.php.