Palmabit-IT / laravel-contact-csv by palmabit

Save contact input in csv file
36
2
8
Package Data
Maintainer Username: palmabit
Maintainer Contact: g.aremare@palmabit.com (Giuseppe Aremare)
Package Create Date: 2015-06-19
Package Last Update: 2016-10-18
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-24 15:05:45
Package Statistics
Total Downloads: 36
Monthly Downloads: 2
Daily Downloads: 0
Total Stars: 2
Total Watchers: 8
Total Forks: 0
Total Open Issues: 0

LaravelContactCSV

Build Status Scrutinizer Code Quality

This Laravel package allows you to easily save contact data in CSV format.

Installation

To install this package follow these instructions

  1. composer require palmabit/laravel-contact-csv
  2. add Palmabit\ContactCsv\ContactCsvServiceProvider to your config/app.php ServiceProviders
  3. php artisan vendor:publish --provider="Palmabit\ContactCsv\ContactCsvServiceProvider"
  4. create csv file and set the absolute path into configuration file config/packages/Palmabit/ContactCsv/config.php
  5. fill generated config file

Usage

Save new row in csv file


$my_array = ["email" => "test@test.com"];
try {
   ContactCsv::save($newletter);

} catch (KeyExistException $e) {
   echo "Key already exsist";

} catch (ConfigValueException $e) {
   echo "Error in configuration file";
}

Download the csv file

ContactCsv::download();

Tests

You can run tests locally with

  phpunit

The build is continuously run on travis.

Contributing

  • Add tests for any new or changed functionality
  • update doc

Author

palmabit.com

License

LaravelContactCSV it's free and easy to integrate within your existing projects. See the MIT License

Todo

• Setup/write/download more than one CSV file