PHP code example of nebbo.o / laravel-sheet-parser

1. Go to this page and download the library: Download nebbo.o/laravel-sheet-parser 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/ */

    

nebbo.o / laravel-sheet-parser example snippets


use NebboO\LaravelSheetParser\SheetParser;

$parser = SheetParser::fromCsv(storage_path('data/example.csv'));

$data = $parser->toArray(); // Convert to array
$json = $parser->toJson(); // Convert to JSON
$collection = $parser->toCollection(); // Convert to collection

use NebboO\LaravelSheetParser\SheetParser;

$url = 'https://docs.google.com/spreadsheets/d/your-sheet-id/edit?usp=sharing';
$parser = SheetParser::fromGoogleSheet($url);

$data = $parser->toArray(); // Convert to array
$json = $parser->toJson(); // Convert to JSON
$collection = $parser->toCollection(); // Convert to collection