Questions tagged [thephpleague]
64 questions
57
votes
3 answers
Replicating claims as headers is deprecated and will removed from v4.0 - Laravel Passport Problem in lcobucci/jwt package
I'm using laravel/passport:7.5.1 package in my laravel project and recently faced with this exception. Any Idea? I temperory downgrade the lcobucci/jwt:3.4.0 package to lcobucci/jwt:3.3.3
Replicating claims as headers is deprecated and will removed…

Ali Motameni
- 2,567
- 3
- 24
- 34
6
votes
3 answers
How To Wrap League Flysystem with Dependency Injection
The aim is to create a Reader class that is a wrapper on top of League Flysystem documentation
The Reader should provide convenient way of reading all files in a directory no matter the file physical form (local file, or a file in an archive)
Due to…

Jimmix
- 5,644
- 6
- 44
- 71
6
votes
1 answer
Laravel Fractal does not return meta from include relationship
This is my PostTransformer where I have included relationship
public function includeComments(Post $post)
{
if (($post->is_paid == 1 && $post->haspaid == 1) || ($post->author == $this->params) || ($post->is_paid == 0)){
$comments =…

samina Tuladhar
- 61
- 2
5
votes
2 answers
Guide me implementing Oauth2 PHP server using thephpleague library
I am using Slim Framework With Eloquent ORM. Trying to implement https://github.com/thephpleague/oauth2-server but I am totally confused how to do this. After adding this with composer, I created database with sql file provided in this package.
Now…

Tejas
- 2,215
- 2
- 18
- 27
4
votes
2 answers
Fractal transformer with different Serializers for nested items and collections
To change the JSON output send by a Laravel 5.4 RESTful API, I make use of the Fractal package by thephpleague. Because pagination will be added in the future, it is important that collections make use of the default DataArraySerializer and single…

Sam
- 1,303
- 3
- 23
- 41
3
votes
1 answer
Getting "stream does not support seeking" reading CSV from S3
Using LeagueCSV "^9.6"
when reading a CSV file on my local server leaguecsv worked great. I've moved the CSV file to S3 for production and now i'm getting a "seek" error when making the getHeader() call.
"{message: "stream does not support…

scottsuhy
- 315
- 4
- 13
3
votes
3 answers
How to log authentication attempt using Laravel Passport (5.3)
We have a web-app consuming a Laravel REST API back-end via Ang 1.6.5 front-end.
I'm looking to log 3 different authentication request outcomes:
1. Succesful authentication.
2. Valid user account, invalid password.
3. Invalid user account.
I can't…

user2977468
- 183
- 1
- 13
3
votes
2 answers
Laravel 5.1 and Fractal: including pivot table data on the transformer
Tables: contact, company and a relationship table with a custom pivot attribute company_contact (company_id, contact_id, is_main)
Company and Contact have a many to many relationship (belongsTo on both models).
Expected output when I retrieve the…

braindamage
- 2,226
- 4
- 24
- 33
2
votes
1 answer
Capture incoming request data
I have been experimenting with the current version of the wonderful package for routing from thephpleague.
I have a simple index page to handle the routing and it works just fine.

kellymandem
- 1,709
- 3
- 17
- 27
2
votes
0 answers
Laravel How To use another server as file storage
I am using Laravel 7.6:
I have two Laravel projects in each server (server is normal server. Neither AWS nor Digital Ocean, Just dedicated server).
Project1 is in server1.
Project2 is in server2.
My question is:
How can I do CRUD from Project1 To…

LoveCoding
- 1,121
- 2
- 12
- 33
2
votes
1 answer
CSV league not skipping empty records
I am using PHPleague to parse csv and insert it to the database. https://csv.thephpleague.com/
And I have code as follows:
$csv = Reader::createFromPath($path, 'r');
$csv->skipEmptyRecords();
$csv->setHeaderOffset(0);
$csv_header =…

Aayush Dahal
- 856
- 1
- 17
- 51
2
votes
1 answer
ThePHPLeague OAuth2 Client `getAccessToken()` throws "An OAuth server error was encountered that did not contain a JSON body" error
I have been attempting to develop an API and client which communicate to each other via an implementation of ThePHPLeague's OAuth2 server and client. Using the curl command in a CLI, I am able to generate a token and use it to gain access to…

Muckee
- 474
- 1
- 8
- 26
2
votes
1 answer
Import massive csv data with symfony command too slow with doctrine
I need to import a lot of data from a csv file (45 Mo) in myqsl database with Symfony. I imported League\Csv\Reader library
I made a command with doctrine.
It works but I is very slow.
How can I accelerate this ?
I tried to :
adding :…

David Pellecuer
- 21
- 2
2
votes
1 answer
Laravel storage ftp disconnect
Is there a way to call the disconnect() (in flysystem this function is exists, https://github.com/thephpleague/flysystem/blob/master/src/Adapter/Ftp.php#L189) function on a ftp-adapter (storage library)?
I do something like this:
$ftp =…

MVUG
- 45
- 1
- 7
2
votes
1 answer
Create a fresh new access token using refresh token using thephpleague/oauth2-server
I'm facing some problems to wrap my mind about oAuth 2.0. Particularly, thephpleague/oauth2-server implementation.
I managed to set up an endpoint to create access tokens using Password grant type. This is, when someone do a POST /auth, they get the…

leamasuero
- 341
- 1
- 7
- 17