Questions tagged [thephpleague]
64 questions
0
votes
1 answer
Learning Plates, what am i doing wrong?
I've already installed composer and verified that it's running properly
this in my controller:
//index.php

Gabriele Battistata
- 27
- 4
0
votes
0 answers
Deleting columns from CSV by header name (or index)
I am trying to modify uploaded CSV files using PHP. More specifically, I want to be able to drop/delete columns.
I have the below CSV file (+100k rows):
,news_headline,news_article,news_category
0,"50-year-old problem of biology solved by Artificial…

oliverbj
- 5,771
- 27
- 83
- 178
0
votes
0 answers
How to add a piece of code for a package in bootstrap/app.php file and its implication in the performance of laravel app
In my project, I am trying to use thephpleague/glide for URL based image manipulation which works absolutely fine with the codes mentioned below.
But the problem is that I am unable to figure out how this piece of code is going to affect the…

Prateek
- 1,229
- 17
- 31
0
votes
1 answer
Uploading files to S3. Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not found
I'm trying to upload files to S3 but I'm getting the error:
Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not found
I have run this command:
composer require league/flysystem-aws-s3-v3:~1.0
I have ran composer update
composer info shows this:
My…

kryz
- 79
- 11
0
votes
0 answers
CSV league showing some space at the beginning of the string even after being trimmed
I am using https://csv.thephpleague.com/ and the code to read csv is:
if (!ini_get("auto_detect_line_endings")) {
ini_set("auto_detect_line_endings", TRUE);
}
$csv = Reader::createFromPath($path, 'r');
$input_bom = $csv->getInputBOM();
if…

Saroj Shrestha
- 2,696
- 4
- 21
- 45
0
votes
1 answer
How to return array instead of collection using Fractal Transformers in Laravel
I am using Fractal Transformers in one of the Laravel based REST API project. I have a $defaultInclude and thus have a function in the Transformer class(ReleaseTransformer) to process the includes. It is as follows :
public function…

Happy Coder
- 4,255
- 13
- 75
- 152
0
votes
0 answers
CSV Import showing weird characters - PHP CSVLeague
I am trying to import csv. And, here is my csv file for test.
https://drive.google.com/file/d/1LU4SHG_EbSj9OTRXRakNHgllZD45iaS3/view?usp=sharing
I am providing exact file so that the file structure / encoding may not changed if I paste the csv text…

Aayush Dahal
- 856
- 1
- 17
- 51
0
votes
1 answer
Could not authenticate temporary credentials for Twitter Oauth
I am able to get temporary credentials and able to get oauth token, but when I do use the returned token to fetch user details, I'm unable to fetch it thus the error.
I am using thephpleague/oauth1-client package and created a simple controller…

alvirbismonte
- 349
- 2
- 7
- 26
0
votes
1 answer
What data do I need to store for OAuth2 server-to-server communication?
Background
My application is getting data from many different sources (APIs) and aggregating across them. So the user logs via OAuth2 into the source once and afterward I continuously make calls to the source.
I am using thephpleague/oauth2-client…

Patrick Kusebauch
- 67
- 3
- 13
0
votes
1 answer
LeagueCSV: undefined index on getRecords()
I'm trying to create users from a csv file in symfony. I'm using LEAGUECSV.
I get this error when I execute php ./bin/console doctrine:fixtures:load
Notice: Undefined index: FIRST_NAME
This is my fixture:
class UserFixture extends Fixture
{
…

Felix Dumitrascu
- 115
- 1
- 10
0
votes
0 answers
The header record must be empty or a flat array with unique string values. - thephpleague/csv
I am trying to import a CSV file to the database using https://csv.thephpleague.com/. And on my CSV file there are some comments on the right side of the CSV file i.e on certain cells with no headers.
And these cells of data which have no header at…

Aayush Dahal
- 856
- 1
- 17
- 51
0
votes
1 answer
Save to Path an Eloquent Collection to a CSV with League CSV
I have this function that export the csv, the it outputs the file so the user can download it.
public function export()
{
$people = Person::all();
$csv = \League\Csv\Writer::createFromFileObject(new \SplTempFileObject());
…

laken
- 1
- 1
0
votes
1 answer
Error passing values from function to a controller as an object
I have the following code:
$storedToken = getStoredToken();
/**
* Verify if the stored token has expired.
*/
if ($storedToken->hasExpired()) {
/**
* If the stored token has…

s_h
- 1,476
- 2
- 27
- 61
0
votes
0 answers
How do you need to send the refresh_token for programmatic access to api endpoint with the League OAuth 2.0 php client
I'm writing a laravel application with the use of League\Oauth2 and Guzzle but I seem to be stuck with something that should be easy.
My authorization works as expected
$provider = new GenericProvider([
'clientId' =>…

Zadder
- 75
- 1
- 6
0
votes
1 answer
How to fix "Uncaught Error: Call to a member function insertOne() on null" in php
I followed the solution introduced here https://stackoverflow.com/a/36041188/11295637 to create a new csv file and fetch specific columns of a large csv file to the new one.
But, I get this error: Uncaught Error: Call to a member function…

Jazal
- 21
- 1
- 5