PHP code example of luminarix / laravel-jsonl-parser

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

    

luminarix / laravel-jsonl-parser example snippets


use Luminarix\JSONL\Facades\JSONL;

$filePath = "path/to/file.jsonl";

JSONL::parse(string $filePath): LazyCollection
JSONL::parseToDto(string $filePath, string $dtoClass): LazyCollection
JSONL::encode(array|Collection|LazyCollection $objects): string
JSONL::encodeFromDto(array|Collection|LazyCollection $dtos): string
JSONL::write(string $filePath, array|Collection|LazyCollection $objects, bool $lock = false): void
JSONL::writeFromDto(string $filePath, array|Collection|LazyCollection $dtos, bool $lock = false): void